All Questions

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

Encryption implementation for websocket chat (RSA + AES)

For learning purposes I am trying to make a encrypted chat in Python using Websockets. I am using AES and RSA to make it safe. The idea of the chat is that it's a group-chat. Users can join a chat by ...
0 votes
0 answers
3 views

Are there other means to apply place holders to an array in a loop for pdo statements for search functions with unknown numbers of keywords in php

I'm a newbie to php and other programming for that matter. I'm doing this simply to learn. Figured the code could be used to search through a police database or something. The statements are Microsoft ...
-1 votes
0 answers
22 views

Hashtable implementation in C

I start to implement the function hashtable insert : The function must be inserted by adding the node to the correct linked list if the key does not exist, or by replacing the value of the correct ...
2 votes
2 answers
81 views

Building a UITableView with fixed number of cells progammatically

I am building this pet project with UIKit. The App's main goal is to keep track of my daily expenses. The AddExpenseViewController is responsible for capturing user ...
1 vote
0 answers
15 views

Advent of Code 2023, Day 8 Part 1 - Beginner Rust Solution

Context I'm doing Advent of Code as a way of learning Rust, and have a working solution to Day 8, Part 1. This involves moving between nodes, starting at AAA and ...
1 vote
1 answer
20 views

Advent of Code 2023 day 1: Trebuchet (Part 1 and 2)

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 ...
6 votes
4 answers
766 views

Matrix Class Implementation

I have written a minimal matrix class. I would like to utilize the latest C++ features, follow best practices, and utilize multi-threading in some of the operations. I have also setup a GoogleTest ...
2 votes
2 answers
41 views

How to reduce the build time of Docker image layer in GitHub Actions?

I have a Dockerfile with ubuntu:22.04 as a base image and a manual Python installation(specific version i.e., 3.11.1) layer which takes a long time. Approach 1: ...
1 vote
0 answers
91 views

Advent of code 2023 day 3: count engine part numbers - 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 ...
2 votes
0 answers
36 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 ...
2 votes
0 answers
34 views

Advent of code 2023 day 7: Ranking Camel Cards hands - mostly in Bash

Part 1 Today's task is to rank hands in a Camel Cards game and compute the total score. In Camel Cards, you get a list of hands, and your goal is to order them based on the strength of each hand. A ...
0 votes
0 answers
6 views

Advent of code 2023 day 8: Path finding in the desert - in pure Bash

Part 1 In today's task, a network of paths is defined like this: LLR AAA = (BBB, BBB) BBB = (AAA, ZZZ) ZZZ = (ZZZ, ZZZ) The first line ...
0 votes
0 answers
12 views

Looping without looping statement

An alternative to loop statements handy when the domain specific language (DSL) prevails the programming language technicalities, is implemented with two instances calling each other while running ...
1 vote
1 answer
27 views

Advent of Code Day 8

Is there a more idiomatic (and concise) approach for the count_steps method? i.e. without using a while loop and incrementing a variable ...
14 votes
6 answers
5k views

Computing the square root of a 64-bit integer

When sieving primes up to some 64-bit number n I need to determine an upper bound for the greatest potential factor of n, which ...
1 vote
1 answer
34 views

Python optimization search pythagorean triplets

I have an optimization problem. Be it about code, algorithm or maths, that, i don't know. My goal is to find pythagorean triplets satisfying a = b + 1 or a = b - 1. m and n are the triplets generators....
1 vote
1 answer
146 views

Efficient Connection Pooling in ODBC-MSSQL with Rust (odbc-api)?

I want to connect to MSSQL using ODBC (odbc-api) at the beginning of my server application created with hyper.rs. I want to have a connection pool and obtain a connection within each request, which ...
-2 votes
0 answers
25 views

Im new to Programming and my code doesnt work [closed]

This program should output the smallest array index of the most common letter in the string and it works for some inputs but for example "zzz" and "AAA" outputs 1 instead of 0 :( <...
3 votes
2 answers
406 views

Hardware API, primarily for Error handling

I have a piece of equipment that I am interacting with. The manufacturer provided an SDK and some simple examples of how to interact with the device. However, I need to write an API for interacting ...
1 vote
0 answers
10 views

Nodejs Websocket pulling new data from InfluxDB

I have a nodejs server with websocket which is pulling the new data from InfluxDB and send it to client. The piece of code is this: ...
0 votes
0 answers
46 views

Summing Duplicates Across Sublists in a Nested List [closed]

I hope my message finds you well. I am seeking your expertise and feedback on a specific issue I have encountered in the repeat_sum function within the codebase. ...
0 votes
0 answers
19 views

Advent of Code 2023 day 1: Trebuchet in JS, part 2

The task involves analyzing a bunch of lines containing lines of text. Each line represents a calibration value that needs to be recovered by extracting the first and last digits and combining them ...
1 vote
1 answer
47 views

Python Runtime Config

I am implementing runtime configuration for a python package. I am doing this in mypkg.config.__init__.py. The idea is to load the configuration from a JSON file ...
2 votes
1 answer
143 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 ...
1 vote
1 answer
37 views

Advent of Code 2023 day 1: Trebuchet in JS

The task involves analyzing a bunch of lines containing lines of text. Each line represents a calibration value that needs to be recovered by extracting the first and last digits and combining them ...
4 votes
1 answer
253 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 ...
6 votes
2 answers
1k views

Advent of code 2023 day 2: count possible qube games - 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
1 answer
149 views

Advent of code 2023 day 1: count trebuchet calibration numbers - 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 ...
5 votes
1 answer
147 views

SQL: How to only look up unique values

I have a piece of code that does what I need. But it looks complicated and messy for what it does. Is there a simpler way to look up the member CIN unqiuely without having a create a sub-query? Get ...
97 votes
6 answers
66k views

File Browser GUI

FileBro is a basic GUI based File Browser. FileBro Functionality Directory tree - shows the file system roots at start-up, but is otherwise built lazily as the user browses around the file system. ...
1 vote
1 answer
61 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 ...
3 votes
1 answer
144 views

Re: C++ 4X Game

This post is regarding the revamp of this post/project I did about 8 months ago. I took a lot of the advice from the suggestions provided (thank you by the way), and fixed the project up, so I'm ...
4 votes
1 answer
217 views

A simple mmap(2) wrapper

I've written a wrapper for the mmap syscall. It's quite limited in functionality at the moment (there are lots of flags to support) but it's sufficient for mapping ...
0 votes
0 answers
33 views

Stopping a running thread without testing variables

The Thread stop method is deprecated. The recommendation is to stop running threads by updating a variable. Many uses of stop ...
1 vote
1 answer
75 views

Extra 0's after rounding

In a project i am doing for AP CSP, I am attempting to make a calculator that can do sig figs, and there is always a ton of extra 0's after i round the number as seen in the picture i attached the ...
0 votes
1 answer
20 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. ...
-3 votes
0 answers
11 views

Trouble converting recursion to dp [closed]

I am stuck in what looks like minor but annoying issue for the minumin sum path leetcode question:https://leetcode.com/problems/minimum-path-sum/ below is my code:`class Solution { public: ...
3 votes
1 answer
49 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 ...
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 ...
1 vote
0 answers
20 views

AutoKeras Network Architecture Search (NAS)

I have two directories, train_data_npy and valid_data_npy where there are 3013 and 1506 *.npy...
-1 votes
0 answers
31 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 ...
3 votes
2 answers
433 views

Graph library including minimum spanning tree using Kruskal's Algorithm

I've only ever made small programs. So, I've tried to make something large but easily reusable/extendable. Posted below are the beginnings of a graph library I've written up. One particular point I'd ...
2 votes
3 answers
104 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 ...
1 vote
1 answer
9 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 ...
2 votes
1 answer
59 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 ...
4 votes
2 answers
939 views

Javascript: Profile Lookup from freecodecamp

This is my answer in freecodecamp "Basic Javascript: Profile Lookup" (third day trying javascript using Udemy and freecodecamp). My problem with the code is the huge number of lines on my ...
3 votes
3 answers
1k views

Concatenating optional strings in Scala

I have two optional strings, any of them can be None. I want to create their combination with a delimiter between them if they both exist. I expect to be able to come with a more concise and nicer ...
0 votes
0 answers
27 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. ...
2 votes
1 answer
1k views

Bootstrap form with floating labels

I have turned a "classic" Bootstrap form into a "floating labels" form. For this purpose, I had to move the labels below the form controls. ...
5 votes
1 answer
454 views

Point distance program written without a framework

I have been developing a cross-platform game based on open C libraries (mainly glfw) with a direct focus on Windows development. The beginning of my programming career taught me familiarity in ...

15 30 50 per page
1
2 3 4 5
1546