All Questions

Filter by
Sorted by
Tagged with
1 vote
0 answers
8 views

convn Template Function Implementation for Image in C++

This is a follow-up question for conv2 Template Function Implementation for Image in C++ and conv3 Template Function Implementation for Image in C++. I am trying to perform n-dimensional convolution <...
JimmyHu's user avatar
  • 5,414
1 vote
0 answers
7 views

Mongo Queries In C++

The mongo API uses documents (encoded in BSON) as the way to perform queryies (for find / remove etc). For example a query to find all record where the name field ...
Loki Astari's user avatar
  • 95.4k
1 vote
0 answers
13 views

a Hebrew Date picker package in Flutter: single and range date selections

I have implemented a working Hebrew Date Picker package (link on pub.dev) in Flutter that supports both single date and date range selection. Here's what the date picker looks like in action: Single ...
MendelG's user avatar
  • 151
0 votes
0 answers
7 views

Member detection within a class

Needed to do some Meta programming. I needed to check if a class has a specific member (one case a member variable second case a member type (two distinct use cases)). Since I am writing a library, I ...
Loki Astari's user avatar
  • 95.4k
0 votes
1 answer
32 views

A simple performant factorial function

I am new to algorithm and data structure. After a little introduction to the topic, I have decided to implement a function called calculateFactorial, which takes an integer and calculates its ...
Napoleon Bonaparte's user avatar
5 votes
2 answers
136 views

Guess-the-number game in Python

This is just something I did in my free time. How can I improve my code as a beginner? Is there an alternative to using isalpha() What are other efficient ways to ...
Rollis's user avatar
  • 51
2 votes
1 answer
23 views

Mean by groups Rcpp

Here is an attempt to translate a R function to Rcpp. The goal is to group every n observations together (of a numeric vector) and calculate the mean. In big'ish vectors the R function is almost two ...
snoram's user avatar
  • 425
0 votes
0 answers
27 views

A more efficient algorithm in finding the number of distinct decompositions a number has using only repdigits

This is a problem from a previous semester that I am trying to upsolve. I am trying to solve a problem involving the total number of ways of decomposing a number using only repdigits. A repdigit is a ...
Lesserrafim's user avatar
0 votes
0 answers
48 views

Optimizing a for loop for changing pixels values using lookup table

I tried to parallelize the loop, and I got a good result but still not enough. This post is a follow up to a recent one where I optimized other parts of the code using a lookup table and spacial and ...
Ja_cpp's user avatar
  • 403
1 vote
0 answers
16 views

Is using setup functions for commands, events, and tasks a good pattern for structuring a Discord.py bot?

I'm refactoring on a Discord bot using discord.py and I've structured my project as follows: ...
Hofbr's user avatar
  • 331
2 votes
1 answer
28 views

Distributed locking with fencing token implementation in Golang

I was reading about the implementation of distributed locks where we need to verify the lease using a fencing token as per this article - https://martin.kleppmann.com/2016/02/08/how-to-do-distributed-...
Pratyush Prateek's user avatar
0 votes
1 answer
12 views

Optimizing react router configuration for E-commerce app

I have a React app using react-router-dom and I want to ensure my routing configuration is efficient and maintainable. Below is my current router setup: ...
Andrian's user avatar
  • 21
2 votes
2 answers
497 views

Taming the ArrowHead antipattern

How can I best refactor the code below in order to cleanse it of the ArrowHead antipattern? (Note: this represents a subset of the full code as originally discussed here.) ...
InteXX's user avatar
  • 231
1 vote
0 answers
17 views

unit testing with test double for DataLakeDirectoryClient object of Azure Storage Files DataLake

I want test review on my unit test code. As I got feeling like this unit test code given in Listing 2 is quite not trustworthy. My production code(Listing 1) is accessing or precisely downloading the ...
Siva Sankaran's user avatar
1 vote
0 answers
16 views

Databases, dependency injection and static methods

I'm working on a Next.js app and looking at the best way to structure database access. With Next.js and web based apps in general, there are lots of different "server actions", aka, API ...
Will Calderwood's user avatar
5 votes
2 answers
167 views

Hand-written IUnknown::Release in Assembly Language - Code injection

I've written the following code in assembly, which I then convert to machine opcodes and inject into a process with VirtualAlloc at runtime. This allows me to ...
Greedo's user avatar
  • 2,445
1 vote
1 answer
35 views

conv3 Template Function Implementation for Image in C++

This is a follow-up question for conv2 Template Function Implementation for Image in C++. Besides two-dimensional convolution, I am trying to implement three-dimensional convolution for 3D image in C++...
JimmyHu's user avatar
  • 5,414
2 votes
1 answer
91 views

Actix Web middleware to limit endpoint requests

I would like to publish my first package to crates.io - it is a simple library crate that allows one to rate limit server endpoints. ...
John Harrington's user avatar
8 votes
7 answers
971 views

Rudimentary black jack game implementation

I started the 100 Days of Code: The Complete Python Bootcamp about a week ago. I finished day 11, and I wrote a rudimentary blackjack game. I'm just looking for some advise on how I did. Am I showing ...
Wazeewa's user avatar
  • 81
2 votes
1 answer
49 views

Simple Stack and Deque implementation (v2)

My previous post: Simple Stack and Deque implementation I have implemented 2 classes for my project similar to stack and deque. This is my second attempt to get advice and evaluation of my code. Maybe ...
vansergh's user avatar
-2 votes
0 answers
27 views

Libsodium Encrypt using API methods and pointers [closed]

As I have not found a code snippet to use libsodium with pointers, I would like to ask whether there are memory leaks in the code below or if anything else is wrong. ...
John's user avatar
  • 97
0 votes
0 answers
28 views

Seeking help for spreadsheet script for making it compact (date recovery from serialnumbers script)

I wrote some working code in spreadsheet scripts, but it's a little bulky and slow. Is there any way to refactor this to be more compact and faster? I'm a beginner, so I'm happy it works at the moment....
Lightningmtv's user avatar
0 votes
0 answers
17 views

Golang, designing a flexible attribute system with diverse possible value types

So long story short, I am trying to model an attribute system for my application. It would have user attributes and system attributes, that behave exactly the same except one being tied to a specific ...
Nikola-Milovic's user avatar
1 vote
1 answer
35 views

One centralized class to wrap/manage OpenTelemetry

I am learning OpenTelemetry hands-on. I want to add OpenTelemetry manual instrumentation to my Java webapp, but I don't want to do import io.opentelemetry.api.* in ...
user10931326's user avatar
2 votes
0 answers
56 views

Update Member "In Place" within VBA Collection

Background I encountered this issue a while back, where I tried to "set" the value of a member "in place", without changing its position within the ...
Greg's user avatar
  • 423
8 votes
0 answers
126 views

Movie Barcode Generator

Task I wrote a movie barcode generator in C++ using OpenCV. Self-described engineer, space lover and tea drinker Thomas Poulet defines a movie barcode as follows: A Movie Barcode is the color ...
Jay Gupta's user avatar
1 vote
0 answers
22 views

Gradient in C++/SFML

As an exercise, I've decided to try my hand at gradients using SFML. To truly make this a learning experience, I didn't look at any resources or papers that described an algorithm for doing so; I ...
Linny's user avatar
  • 10.3k
1 vote
0 answers
53 views

Makefile for C project

This is a makefile for a project I'm currently working on. I was wondering, if there was a way to write it more concisely, especially concerning tests and libraries. I would like to maintain the ...
vdrummer4's user avatar
0 votes
0 answers
46 views

Dependency that emulates Spring JPA in Spring JDBC with save/saveAll and entities [closed]

I would like to know if someone could test a dependency that I created to facilitate work with JDBC by emulating the way JPA works with save and saveAll and entities in Java Spring. The thing is that ...
Alderan Smile's user avatar
2 votes
1 answer
66 views

another first tic-tac-toe game

I made this tic-tac-toe game in c# after learning the language around a week ago. Can somebody tell me if this code is good or bad? ...
sminkle's user avatar
  • 31
0 votes
1 answer
35 views

Graph Neural Network (GNN) (2)

This is an implementation of a graph neural network. Edges are represented by an egde-list. ...
user366312's user avatar
1 vote
1 answer
100 views
+50

Graph Neural Network (GNN) (1)

The given datasets are graph data structure that represents social interactions. The nodes will be represented as People{node_id, edge, gender, occupation} and the ...
user366312's user avatar
2 votes
1 answer
184 views

Neural network text classifier

I wrote a simple NN text classifier to help me quickly sort through the new daily submissions to the arXiv. It downloads the new submissions, processings their titles and abstracts, trains a NN on ...
Gabriel's user avatar
  • 597
3 votes
0 answers
282 views

Fluent VBA: Two (Almost Three) Years Later

Part 1 - A fluent unit testing framework in VBA: A fluent unit testing framework in VBA Part 2 - Fluent VBA: One Year Later: Fluent VBA: One Year Later Two (almost three) years have now passed since I ...
Brian Gonzalez's user avatar
2 votes
2 answers
103 views

Generic Dynamic Array Implementation

I wrote a dynamic array implementation in ISO C11 using void pointers. Everything I've implemented works--at least in all my tests--on a 64-bit machine. It has some vague type-checking and resizes ...
Zenais's user avatar
  • 23
2 votes
1 answer
45 views

Fast API endpoint handlers

I'm not so experienced at developing Fast API apps. As I program in different languages, I often get confused as how things are done in a python way. I have this piece of code, and I would like to ...
Alejo Villores's user avatar
3 votes
1 answer
255 views

imgaussfilt Template Function Implementation for Image in C++

This is a follow-up question for im2double and im2uint8 Functions Implementation for Image in C++, conv2 Template Function Implementation for Image in C++ and An Updated Multi-dimensional Image Data ...
JimmyHu's user avatar
  • 5,414
3 votes
1 answer
58 views

A search function that searches for a contact inside a vector

I have this function to search for a specific contact inside a contact management program. I want to know the following: Is returning the contact object as a pointer(...
HusenPatel's user avatar
0 votes
0 answers
50 views

Javascript Signals implementation

I've created my own implementation of signals in typescript, inspired by the proposed tc39 specification (https://github.com/tc39/proposal-signals) in the BOM. I think it would be great if I could use ...
enzoaicardi's user avatar
2 votes
1 answer
75 views

Speed up searching for the lowest element that is not in the array

I try to solve this question: B. Informatics in MAC at Codeforces To solve it, I think I need to calculate the prefix and suffix array of MEX. I made observation that making only 1 subsegment will ...
Szyszka947's user avatar
0 votes
0 answers
32 views

Presence of UB and memory usage of a std::array initialization: version with temporary array on heap

I proposed several techniques to answer to https://stackoverflow.com/q/78672409/21691539. A classical way to answer would be to use std::index_sequence-based ...
Oersted's user avatar
  • 337
2 votes
0 answers
43 views

Shrinkable Swing toolbar

I was tasked with implementing a toolbar that can be shrinked beyond what's necessary to display its buttons' texts. As a last resort, the buttons should hide their texts and only display their icons ...
Sergey's user avatar
  • 581
0 votes
1 answer
41 views

Feature-subset-selection using autoencoder [closed]

The following listing performs feature-subset-selection (not feature extraction) using an autoencoder. My aim is to select the best features from the 1000+ available features in the given dataset. I ...
user366312's user avatar
0 votes
0 answers
34 views

Unity 2D Platformer that saves your past positions and replays them as a "Ghost"

I have been trying to get better at C# and Unity. As my first programming language and game engine, there are still a lot of things I do not yet understand. I know the basics of both, but I don't know ...
MrV's user avatar
  • 1
3 votes
1 answer
50 views

First .bat script to update a git branch

update-branch.bat is my first batch script. Its current behavior is update-branch updates the current branch ...
joseville's user avatar
  • 486
1 vote
1 answer
89 views

Simple Stack and Deque implementation

I implemented a single-linked and double-linked lists (like stack and deque). I would like to receive your feedback on improving the code or maybe some comments. I'm learning C++ for the third month. ...
vansergh's user avatar
6 votes
2 answers
1k views

GUI Interface for a command line program in C# Windows Forms

I am brand new to C# and this is my first time making a GUI. The program is pretty simple, since I don't have too much knowledge of GHDL. All it does is take the file paths, and generate relevant ...
blipblap's user avatar
5 votes
2 answers
916 views

Optimized data structure mapping finite set of integers to values in C++

I'm looking for a mapping data structure, but knowing that the possible values of my keys are small numbers, I would like to trade memory for better performances (for both random access and value ...
Delgan's user avatar
  • 611
3 votes
1 answer
88 views

Simple CLI Hangman Game in C#

I'm a beginner at C#, and this is a console application that I wrote as I'm attempting to recreate simple games such as Hangman, TicTacToe, etc. I'm wondering if there's any logic in my code that's ...
MrTungsten's user avatar
4 votes
1 answer
61 views

Implementing Intersections data structure that is able to hold a container of multiple types that maintains order in C++

I am trying to implement a way to store intersections of rays with arbitrary objects. So far I thought I could make the object derived from an interface and put that as the type in the Intersection ...
Zcahfuz's user avatar
  • 41

15 30 50 per page
1
2 3 4 5
1557