All Questions

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

Copying data from a network share to another

The code below copies large amount of data. It does so in 2 steps. I was wondering if both step1 and step2 can be done in parallel. ...
Newborn's user avatar
2 votes
1 answer
15 views

Advent of Code 2023 day 1: Trebuchet

Part 1: The task involves analyzing a calibration document containing lines of text. Each line represents a calibration value that needs to be recovered by extracting the first and last digits and ...
Harith's user avatar
  • 2,322
0 votes
0 answers
9 views

Advent of code 2023 day 6: Count ways to win boat race - in pure Bash

Part 1 To paraphrase the puzzle, given the times and record distances of boat races like this: Time: 7 15 30 Distance: 9 40 200 That is, the first ...
janos's user avatar
  • 111k
2 votes
1 answer
20 views

Fuel Gauge Python

I was wondering if my code is good or maybe if it could be written better or simpler. The task was to implement a program that prompts the user for a fraction, formatted as X/Y, wherein each of X and ...
Hoodati's user avatar
  • 21
0 votes
0 answers
15 views

Function to find successive primes with sums of previous terms as divisiors

Is this a successful piece of code and an appropriate way to rephrase the mathematical notation? Currently it does not find pairs, so I wonder how to approach reasoning deductively about this problem ...
atlvd's user avatar
  • 101
1 vote
1 answer
6 views

Start script for several Spring Boot services

I have several Spring Boot and Angular applications/microservices that form together a whole application. As it is tedious to start them via the terminal, I've written the following script to perform ...
jmizv's user avatar
  • 113
0 votes
0 answers
23 views

Train Dispatcher in Java [closed]

I am developing a simplified train dispatch system as a final assessment for my CS major, first semester. I have a user interface class, with the TrainDispatch instance as a UI class variable. ...
Mikael Stray Frøyshov's user avatar
1 vote
0 answers
15 views

AutoKeras Network Architecture Search (NAS)

I have two directories, train_data_npy and valid_data_npy where there are 3013 and 1506 *.npy...
user366312's user avatar
2 votes
1 answer
61 views

Logger for a Game Engine

So I'm making a logger for a program and it has 6 levels increasing severity and things I don't think its as memory efficient as it could be but I'm just getting into c++ and memory coding. I feel ...
Xuul's user avatar
  • 23
1 vote
1 answer
55 views

String represents a road. One character travels on the road obeying the stops - Code challenge (advent.js day 5)

This is my code to solve the 5th Adventjs challenge. In that link you can read the instructions. How can I improve it? It's a bit messy... and I'm repeating some part of the code. All must be in just ...
Sofia Chardin's user avatar
-2 votes
0 answers
26 views

C++ template function specialisation within class template [closed]

I'm not used to template programming - much more used to inheritence & composition. But in terms of a general solution, I'm using a tiny project to ensure a reasonable approach for using class ...
Konchog's user avatar
  • 183
0 votes
3 answers
81 views

Declaring type definition once for all variables

To avoid the use of magic numbers, I created a static class to store some integer values that are represented inside a database. I avoided using enums because I need to cast them every time I use them....
Abcd's user avatar
  • 103
2 votes
1 answer
24 views

Using async websockets in Rust with tokio, rmp-serde and varint encoding

This is my first attempt at a real life app in Rust. I would mostly like to know if I am writing idiomatic Rust code, coming from Java and Python. I'll appreciate any pointers to improvements, though. ...
Sebastian's user avatar
  • 121
5 votes
2 answers
1k views

Advent of code 2023 day 4: Count scratchcard points - mostly in Bash

Yesterday I thought was the last day of Advent Of Code 2023 that I do in Bash. I was wrong. I'm not even sure anymore that today will be the one. We'll just have to see tomorrow! Part 1 To paraphrase ...
janos's user avatar
  • 111k
0 votes
3 answers
88 views

Java - Should I use getter in method?

I have two working solutions, but which one should I use? Which solution is correct? Solution 1: List<Client> myClient = new ArrayList<>(); ...
user avatar
0 votes
2 answers
48 views

Optimisation: Conversion from int to Roman Numeral

A while ago I made a post about optimising the multiplication of every number in an array by 2. With everyone's help I was able to go from 1,500 ns (LINQ) to 30 ns. So I thought I'd try something ...
Henners2002's user avatar
2 votes
1 answer
29 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 ...
Deb's user avatar
  • 21
0 votes
1 answer
30 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 -...
Felix ZY's user avatar
  • 103
-2 votes
0 answers
37 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....
Matheus Silva's user avatar
1 vote
0 answers
82 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 ...
janos's user avatar
  • 111k
1 vote
0 answers
89 views

Python integer optimization with PuLP involving polynomials 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 ...
Matt Samuel's user avatar
2 votes
3 answers
93 views

Redouble each occurrence of char recursively, and add n

In following of this question, I would like to have a second review. The exercise is to write a recursive method that takes a String and a ...
Tobias Grothe's user avatar
1 vote
0 answers
73 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 ...
Natecat's user avatar
  • 111
0 votes
0 answers
27 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 ...
Bigbob556677's user avatar
2 votes
2 answers
43 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 ...
JimmyHu's user avatar
  • 3,996
0 votes
0 answers
72 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 ...
FloorSign's user avatar
0 votes
1 answer
26 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. ...
Alex Orbit's user avatar
2 votes
1 answer
85 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 ...
code writer 3000's user avatar
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 ...
janos's user avatar
  • 111k
5 votes
2 answers
174 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 ...
unique's user avatar
  • 153
0 votes
1 answer
43 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 ...
Koala's user avatar
  • 103
2 votes
1 answer
51 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? ...
HeavyIsSpy's user avatar
3 votes
1 answer
55 views

Simulating a Moving Average Process

I was studying stochastic processes and thought to independently simulate a moving average process. ...
insipidintegrator's user avatar
2 votes
1 answer
46 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 ...
Vladistone's user avatar
1 vote
1 answer
41 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 ...
Alexovsky's user avatar
5 votes
1 answer
124 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 ...
janos's user avatar
  • 111k
3 votes
0 answers
107 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 ...
Richard Neumann's user avatar
1 vote
1 answer
42 views

Managing users via SQLAlchemy DB model (updated)

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 ...
Michael's user avatar
  • 161
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: ...
Gagandeep Singh's user avatar
2 votes
0 answers
34 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 ...
Yulia V's user avatar
  • 633
0 votes
0 answers
50 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 ...
Max's user avatar
  • 1
-3 votes
0 answers
23 views

Raspi5 Throws "mmap of gpio registers failed" with pwm fan script [closed]

basically the title. the following code ...
sellem's user avatar
  • 1
2 votes
1 answer
49 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 ...
Aliaksei Badnarchuk's user avatar
3 votes
1 answer
62 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) ...
Doruk's user avatar
  • 105
0 votes
0 answers
41 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 ...
J.Olufsen's user avatar
  • 161
2 votes
1 answer
78 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 ...
Tobias Grothe's user avatar
-3 votes
0 answers
38 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 ...
some_math_guy's user avatar
-3 votes
0 answers
44 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. ...
TheJungus's user avatar
3 votes
1 answer
76 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 ...
Amir reza Riahi's user avatar
1 vote
1 answer
50 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 ...
Gustaw Ohler's user avatar

15 30 50 per page
1
2 3 4 5
1546