All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
55 views

Compare and merge sets from unstructured variables for automatic differentiation

I have developed an automatic differentiation module for my software. Usually AD comes in two forms; forward mode or reverse mode and very clever approaches, beyond me, might mix both. Typically the ...
1 vote
0 answers
2 views

Loading Spinner Implementation

I've recently implemented a loading spinner for my web application and would greatly appreciate your feedback on the code. The spinner is supposed to display while data is being fetched from the ...
1 vote
1 answer
21 views

A function to read ASCII data files with 3*n columns

This function works moderately well. However, I need to increase the speed more. How can I do that? Alternatively, can I start start exactly from the startRowNo ...
1 vote
1 answer
9 views

Determinant of matrix Python

This is an addition of my previous question Python matrix class. I've added a determinant function using Laplace expansion to my Matrix class. What I am looking for specifically is how 3x3 matrices ...
1 vote
1 answer
20 views

Maintain a log containing values if certain conditions are met

I'm trying to capture profits and set a stop loss in my trading strategy. I want the stop loss to be set daily based on the past data and if the current price, i.e., price for the date falls below the ...
2 votes
2 answers
143 views

Find the join of two set partitions

Two partitions of a set have a greatest lower bound (meet) and a least upper bound (join). See here: Meets and joins in the lattice of partitions (Math SE) The meet is easy to calculate. I am trying ...
0 votes
0 answers
8 views

How to pass in a list of generic types in .NET

I'm building a little message pipeline example similar to Mediatr. I have an IMessage interface. ...
4 votes
2 answers
553 views

HTML Editor : online HTML editor with real-time preview

Note Please review the new question and ignore the following. Overview HTML Editor is an online HTML editor with a minimalist approach. Edit your HTML, CSS, and JavaScript code and monitor the ...
1 vote
0 answers
20 views

HTML Editor: Online HTML Editor with Real-Time Preview

Overview HTML Editor is a web-based HTML editor designed for web developers, designers, and learners. It offers a light-weight, minimalist environment for writing and previewing HTML, CSS, and ...
3 votes
1 answer
68 views

A Quine program in C

From Wikipedia: A quine is a computer program that takes no input and produces a copy of its own source code as its only output. The standard terms for these programs in the computability theory and ...
10 votes
8 answers
998 views

Print all correct parenthesis sequences of () and [] of length n in lexicographical order

Given a number n, print all correct parenthesis sequences of parentheses and square brackets of length \$n\$ in lexicographical order. You must enter an integer \$n\$ from 0 to 16 inclusive. The ...
2 votes
1 answer
231 views

Rules-engine to be improved/simplified for Efficiency (performance), Extensibility and Maintenance?

This is a simple implementation of a rules engine. I am really hating the very long MATCH/CASE function. I am wondering what kind of Design Patterns could be used there to make this code more ...
10 votes
2 answers
909 views

Scheme interpreter in C

I created a basic Scheme interpreter in C ...
7 votes
3 answers
414 views

conv2 Template Function Implementation for Image in C++

This is a follow-up question for An Updated Multi-dimensional Image Data Structure with Variadic Template Functions in C++. I am trying to implement conv2 template ...
0 votes
1 answer
24 views

Extract each occurrence from an array of objects (performance)

I have a huge list of 4k+ softwareProduct. My goal is simple. I have a list of products. Each of those products has a software value. I would like to extract each software occurrence and covert it ...
0 votes
0 answers
65 views

Sincere doubts from a beginner in machine learning [closed]

I made this code for an exercise in my machine learning course, and every time I run it, it gives me a different result. the exercise is basically it, the exercise statement asks me to make a loop ...
5 votes
1 answer
194 views

Simple Bank Management System

This is my 2nd C++ project, so I created a bank management system. This was particularly hard because I had to understand OOP. I still don't fully get it, but I'm sure I'll improve as I do more ...
2 votes
0 answers
27 views

Implementation of an Ordered Character Class #2

Overview This is a follow-up review request incorporating commented from the following prior review: Implementation of an Ordered Character Class. I have incorporated many of the suggestions made by ...
11 votes
1 answer
862 views

a not-so optimized, not-so simple brainfuck source-to-source compiler to assembly (fasm) written in python that automatically compile using fasm

first time writing this source-to-source (i think) compiler, not an expert, not a pro, not an advanced person, just a beginner, i don't think this is cross platform. ...
2 votes
1 answer
31 views

Optimal Extraction of Longest Sorted Sequence from Individually Sorted Bucket Arrays Without Repetitions

Consider a bucket array containing sorted and/or empty buckets, and the goal is to extract the longest possible sequence in sorted order, under the following conditions: Only one element in each ...
1 vote
0 answers
36 views

How to properly organise a backend API structure in ColdFusion (CF9)

I have written a very basic API for my client using ColdFusion. Currently I have endpoints with cfm files for each endpoint at that location. For example: ...
5 votes
1 answer
351 views

Mutex lock benchmark

I'm trying to measure how many CPU cycles a mutex lock takes. Can you find any problems in my mutex lock benchmark? ...
6 votes
4 answers
690 views

JSON data format for MCQ data bank

I'm creating a data bank of MCQ (Multi Choice Questions) and their answers so that an app can be built around it. Regarding the actual storage format, I have two ideas: An array of objects with keys (...
8 votes
6 answers
4k views

Goldbach’s Conjecture in Python

Input Format Input starts with an integer n (1 ≤ n ≤ 100) indicating the number of cases. The following n lines each contain a test case of a single even number x (4 ≤ x ≤ 32000). Output Format For ...
2 votes
0 answers
29 views

Convert Image Class to OpenCV Mat Data Structure in C++

This is a follow-up question for An Updated Multi-dimensional Image Data Structure with Variadic Template Functions in C++. I am trying to build the bridge to perform the conversion between the ...
8 votes
3 answers
2k views

"Smart" (ish) pointer in C

I am a programmer with a primarily Rust-based background who has nonetheless taken an interest in C lately due to its simplicity and minimalism. However, one of the things I miss most from Rust is ...
2 votes
1 answer
115 views

Performance Tuning to enable answer for Project Euler #566 "Cake Icing Puzzle"

Related to this question I am still looking for a solution to Project Euler Problem 566 (see link for a nice simulation also): Adam plays the following game with his birthday cake. He cuts a piece ...
2 votes
0 answers
36 views

Srivastava multivariate Fox H function in MATLAB

Cross posted from StackOverflow I was trying to rewrite the Python code in MATLAB. The result is consistent. But, the MATLAB code is so slow. Any help would be appreciated. Ref python code link The ...
1 vote
0 answers
41 views

General Purpose Utility Constants, Macros, and Functions

Overview: I have bundled together different macros and functions I often require in different projects into a single compilation unit (utils.h and ...
3 votes
1 answer
37 views

Creating an API secured only by the request signature

I'm trying to create an API that will receive requests from users without having to do a login request. They will just have a user id and a key. My intention is that they will use the key to create a ...
7 votes
4 answers
1k views

Encapsulating snprintf to avoid repetition of sizeof

Correct usage of snprintf involves very long and repetitive lines: ...
1 vote
4 answers
135 views

Safer & simpler allocation functions and macros

I wrote a bunch of functions and macros for safer and simpler allocation. They are documented in their files. Disclaimer: The library requires POSIX extensions, GCC extensions, and LIBBSD ...
2 votes
4 answers
2k views

Simplified print and input macros in C

For a program I'm writing, it requires a lot of printing and receiving user input. I've found it cumbersome to keep specifying the type strings in printf, and ...
3 votes
1 answer
201 views

An example of hello world LKM

In 2021 I spent a lot of time studying low-level in Linux, as I'm a low-level addict in general, I only now decided to change my area to introduce myself to the market, and I wrote a repository on ...
0 votes
0 answers
21 views

Is the MVP architecture correctly organized in an FXML JavaFX project?

As far as I understand, when creating a project using the FXML JavaFX Maven Archetype, the project is initially designed with the MVC pattern. However, I wanted to convert it to the MVP architecture (...
6 votes
2 answers
713 views

Lotto Number Generator - Javascript

Newbie to Javascript here and just practicing by making a random Lottery number generator. I am practicing by building simple, achievable projects. The aim of this project is to make 10 lines of 6 ...
0 votes
1 answer
43 views

Optimize for compute/timespace - substring matching STD pk / sk format

BUSINESS CASE For users of my application I need to manage a granular list of grants. I'm using an aws dynamodb backend with lite Single Table Design (STD) strategies. A common syntax for STD keys ...
3 votes
1 answer
35 views

Run UNIT TEST automatically from NeoVim

Still working on my neovim configuration. I use Google test to write my unit tests. Which means that all the unit test begin with ...
5 votes
1 answer
247 views

C++ static vector revised implementation

This is a revised and expanded implementation of the original static_vector implementation based on the various suggestions and corrections from the kind people who reviewed the original version.The ...
-1 votes
1 answer
60 views

Word count in Python [closed]

I have the following Python code: ...
6 votes
4 answers
1k views

Simple scripting language (interpreter) in C

I made simple scripting language (interpreter) in C and now, I want to make my code better. Here is my code: ...
10 votes
3 answers
295 views

Reasonable way to implement "safe" math operations using _Generic?

I've been thinking about a way to make it easier to safely use math operations with C's basic datatypes (e.g. using the CERT C coding standard). So far, I've come up with something like this: ...
0 votes
1 answer
42 views

Check against groups of constants [closed]

In my .NET Framework app (stuck at C# 7.3), I use many if checks against group of constants in so many places (maintained more than 10 years). Existing: ...
8 votes
3 answers
1k views

is_decimal Function Implementation in C++

This is a follow-up question for is_number Function Implementation in C++. Considering G. Sliepen's answer and Harith's answer, I want to focus on decimal number here, therefore, ...
4 votes
1 answer
79 views

Multithreaded Alpha-beta pruning for playing Connect Four in Java

Intro (The entire repository is in GitHub.) This time, I have parallelized the famous Alpha-beta pruning algorithm. The idea is that the parallel algorithm descends in a game tree (at least) 2 levels ...
3 votes
0 answers
94 views

An Attempt at Creating a Type-Safe, Generic Swap Macro With Compile Time Error Checking

Properties: It evaluates each of A and B only once (sizeof is special, as it doesn't ...
1 vote
0 answers
35 views

Enhancing Visual Appeal and Usability of CSS/JavaScript Animation

I am seeking suggestions to enhance both the visual appeal and usability of a complex web-based animation that utilizes extensive CSS and JavaScript. The complete code is also available on my CodePen: ...
1 vote
0 answers
70 views

comment-monk - Comment hosting script for static blogs and websites

So few days ago, I had created another review request for sqlite database schema for a comment hosting system. Now that the app development is complete, I have pushed the initial version on github. As ...
1 vote
1 answer
35 views

Listening to bootstrap 5 events in a vuejs application

Starting out with VueJS, making a small fun project. The project is a simple static portfolio website, with a navigation bar at the top and a bootstrap scrollspy, jumping to the different sections (I ...
6 votes
2 answers
548 views

Improving my Tic Tac Toe Solution in Scala

I'm relatively new to Scala and made a small TicTacToe in a functional Style. Any improvement options would be highly appreciated. There are some things which I am unsure of if they are made in an ...

15 30 50 per page
1
2 3 4 5
1555