instruction
stringlengths
71
95.1k
I have this repository: https://github.com/coderodde/ParallelRadixSort.java/tree/main It contains a parallel MSD radix sort presented below: package com.github.coderodde.util; import java.util.ArrayList; import java.util.List; import java.util.Random; /** * This class provides the method for parallel sorting of {@co...
I have a Python directory containing some str: int key-value pairs, and my goal is to display that data in a tabular format. I am unable to use the tabulate module because it seems that it cannot display data exactly as is required by the project sponsors (and as far as I know you cannot customise the formats), so I'm ...
I have a series of scripts that I need to run in a DevOps environment; certain routines cannot be executed directly within a session and yet still need to be supported. The following script is what I've come up with after much trial and error. It seems to do exactly what I need but I am curious if there is anything tha...
I have this stored Procedure that is passed in the data below that will building the SQL select that will get EXEC. The data that can be passed in can me null so I have three IF ISNULL checking and then adding to the @SqlWhereCommand object. Any help would be great. parameter @StartDate AS DATE = NULL, @EndDate AS DAT...
I do not want to use methods like MAP.getOrDefault since it requires the default definition every time the MAP is accessed which is not the behavior I want. I want to store a default value to my HashMap whenever a call to my MAP constant does not have a value associated with the key that is passed. This is what I have ...
Here is my code. It reads a file and returns the sum of all the bytes in the file: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <malloc.h> #include <iostream> #include <chrono> #include <thread> #include <mutex> #include <condition_variable> #define BUFSIZE 134217728 // globa...
My first non-trivial bash script after fully moving to Linux Mint last week is attached (modify_cccp_bundles.in). The script performs on protein databank (PDB) files that have been generated using an online CCCP (Coiled-coil Crick Parameterization) server. To use the generated PDB files for my own ends, I am using Rose...
Introduction I'm a new to C++ so please take me easy :) I am currently working on a low-level game engine using C++, OpenGL, and GLFW; I've implemented the Event System and the Input Manager, which you can check out here: Improved Event System & InputManager Using C++. Graph For clarity, I've included a graph: Compone...
I have a class for which I want to overload __add__ to mean adding all fields between obj1 and obj2. I am currently leveraging .__fields__ and getattr(). This works but feels a little ugly? Imagine the class is an N dimensional vector, with a non-example code __add__: class NDVec(BaseModel): # basic dim1: int ...
Here is how I intend to do it: def index_of_first_item_less_or_equal_than(lst, threshold): return next((i for i, x in enumerate(lst) if x <= threshold), math.inf) def index_of_first_item_greater_or_equal_than(lst, threshold): return next((i for i, x in enumerate(lst) if x >= threshold), math.inf)
I implement a working version of the Lift Kata Can you provide me some tips to improve my code? I am not very proud of the handleLiftWithOpenDoors method that have a side effect on calls: as I am in a stream().map() function, I want the lambda to be pure, with no side effects. Do you think of something elegant to solve...
I asked a question yesterday (Protein databank file chain, segment and residue number modifier) and received a very informative answer by J_H whose feedback I have taken onboard. Some of the feedback was new to me such as shellcheck and do going on a newline within while or for loops. I have updated my code and it runs...
I was working on a small python CLI tool using the Click library for the first time and realized I was defining parameters and mappings from them to objects/classes in multiple places and anytime I wanted to make a change it was necessary then to go through and change code all over the place. For this project a series ...
I have an interest in how the number of ways you can reach from the origin to a certain distance on both square and hexagonal lattices. If L is the square of the distance and integer pairs (i, j) are the lattice coordinates (lattice directions separated by 90° and 60°, respectively) then we have L_square = i² + j², and...
Now I have this funny program. I bought an ASUS ZenBook which includes NumberPad. The downside of it is that it turns on with a slightest touch on its upper right corner so that I start write numeric gibberish in my code. This one, disables the NumberPad (must be run as the admin): #pragma comment (lib, "Setupapi.lib")...
Task: Implement a function, which accepts two integers and results the first number raised to the power of the second number. Both numbers have to be positive. Examples: The arguments 4 and 3 shall return the result 64 The arguments 2 and 8 shall return 256 My solution (plus tests): func getPowOf(base: Int, exp: Int)...
The code below will go through an excel spread sheet taken from kaggle, is named "SteamGames (71k games)" and the creator is "MEXWELL". inside the for loop I take only the required information, create a Game object which is very straight forward with only gets, sets and a compareTo function for sorting later also a sco...
I believe reinventing the wheel is in fact a good learning exercise. How can I improve my Set implementation without just copying HashSet? No treeification/detreefication, please. I find it too time-consuming to implement. I decided not to use anything but arrays and Lists as its underlying data structures. Some aspec...
Summary: This project is a simple static blog site generator written in python, utilizing pandoc to convert posts written in Markdown to HTML. It is essentially a follow up to my previous post: blog site generator in shell script. I got a lot of positive feedback, and multiple people suggested that I rewrite this proj...
In Python using Pandas, I am splitting a dataset column into 4 lists based on the suffix of the values. For the 3 suffixes I am using a list comprehension then for the 4th one, a set operation that substracts the 3 lists from the original list with all values: import pandas as pd df = pd.DataFrame({ "alcohol_by_vo...
To learn more about design patterns, particularly the Model-View-Presenter (MVP) pattern, I am currently creating a CLI weight tracker application in Python. I would like you to review the code to determine if it adheres to the MVP pattern. The code or business logic itself is not finished yet. The application can curr...
GeoHash library in C++17 no allocations and no std::strings. It uses fixed buffer GeoHash::buffer_t. optimized nearby search, if possible, it search 2x2 or 2x3 cells, instead of 3x9 cells GeoHash::nearbyCells. suppose to work correctly on latitudes over 65-70' where the geohash cell is really "narrow". Here is the co...
Introduction I am a newbie, so please take me easy :). I am writing a low-level game engine using C++, GLFW and also OpenGL. This is a continuation of Entity Component System Using C++ I've implemented the sugestions. Modifications Here's a rundown of the changes I've made since the last iteration: The entities are no...
I'm testing my C skills by writing my first-ever full application in C. I'm targeting DOS (as in MS-DOS/PC-DOS and DOSBox) and am compiling the code with Open Watcom v2.0. The application does the following: Provides the user with a simple command-based user interface. Generates legal Boggle game boards via emulated B...
I'm trying to traverse a tree-like structure from the bottom-up, and in parallel. Due to some other constraints I also have to allow for thread counts that may be lower than the width of a given set of child nodes. Each parent node also requires all child nodes to be visited before it itself can be visited. I've come u...
As written [above], getint treats a + or - not followed by a digit as a valid representation of zero. Fix it to push such a character back on the input. Please check this is right. If I fully understand what have to be done, that's check whether the character after sign is a digit or not. #include <stdio.h> #include ...
Updated question on 2023-08-31 with extended codebase, since so answers were posted yet. Background I am rewriting a program in Rust, which needs to be able to beep the PC speaker. I am using a udev rule to grant a user in the group beep access to the speaker, which works fine with beep. However, I did not want to invo...
I'm working in a function that generates isochrones for a project of mine and I'm facing a bottleneck performing some distance calculations. Here is what I'm doing: def distanciapunto(row, punto): try: geometriarow = transform(transformer.transform, row["geometry"]) geometriapunto = transform(transf...
I solved LeetCode 137 in C++. TLDR of the problem: array of numbers, nums is given; all numbers appear 3 times, except one which appear only once. Find the number that appears once. When trying to convert my C++ solution to python, I came across few funny things, i.e. the bit operations seem to behave a bit differently...
I am making an incremental-memory-game similar to this https://www.crazygames.com/game/incremental-memory I am not very satisfied of how spaghetti this code is. I am trying to learn to improve my code quality, and make it as professional as it should, I hope if you an try to restructure this code to make it very inovat...
Can you review the following Python code? import random class Point3D: SEED = 1 def __init__(self, x, y, z): self.X = x self.Y = y self.Z = z def __hash__(self): hash_value = 0 # Number of hash functions to use num_hashes = 5 # Random vectors for ...
I was working on Python Crash Course, exercise 9-15: 'Lottery Analysis'. It took me a very long time to get it to work. The reason it took that long is I wanted to use my existing class from the previous exercise 9-14 which used choices() method not choice(). I have looked at the author's and some other solutions but s...
I am remaking an old game, which animates water by rotating its palettes over time. I have written a basic fragment shader to replicate this behavior. It checks which color we are trying to render, and if that color is known to be water, we apply a palette shift. This works well, but there is a lot of branching involve...
I am writing a java class file parsing & serialization library. As part of that i needed to implement a structure for the JVM bytecode instructions as well as come up with a way to parse & serialize these in an easy & generic way. There are over 200+ instructions defined in the JVM bytecode spec and they have variable ...
This is the fourth iteration of a Python script I wrote that splits overlapping ranges, and this is the fastest version I have wrote so far, and also a version that works for all inputs. I have done rigorous testing using randomly generated samples and compared the output against the output of a method that is known to...
My first actual code using GUI. Based off a class I took. Code criticism much appreciated. (I was all over the place with this one) Resources Picture: Sound: https://www.freesoundslibrary.com/success-sound-effect/ Put these in the same directory as main.py main.py from tkinter import * import math from pygame import m...
I have tried to implement a bitwise adjacency matrix to represent a graph with a fixed number of vertices. Instead of wastefully representing each connection with an integer, 64 connections are packed into a single uint64_t, to improve memory and hopefully performance (via improved cache locality). Instead of vector<...
I want to calculate the distance between k-mers instances in a long sequence (words of length k, bigrams, trigrams, etc. In bioinformatics the are called k-mers). I developed this code that look for starts of the k-mers and then calculate the distance between the starts. I am not sure I am doing it right: from itertoo...
Issue: Our application logs and traces are not standard, to help our aggregation tool for multiline content required some intervention on our part. Below I wrote some code to partition those longer strings into lines based on window size. I feel like the code could be improved. private static IEnumerable<string> Parti...
As you'll see from the below code, I'm creating separate data frames of a much larger data frame, then updating a column for each one. What I'm doing is looking at the second column and checking to see if it meets a certain threshold value that is associated with the brand name found within the first column that has ea...
Can someone help me optimize this code especially the LINQ query. It takes 8-12 seconds just to return a response when I'm calling the endpoint. Its super slow, and my whole endpoint call is taking about 30 seconds since I have more functions to call after this. It is a big database that returns many rows and maybe som...
The code has no errors, it is just slow. It takes 1.19s to start. How can I reduce runtime without using threads or multiple processes? I have tried compiler optimization (-o1, -o2 and -o3) These did not do much. typedef struct s_float2{ double x; double y; } t_float2; static t_float2 next(t_float2 z) { ...
Simple command-line option parser with automatic setting of variables and built-in error checking. The story is I was working on another new project that had a lot of configurable options, as they usually do. I got tired of writing the same parser 50 different times, so I spent some time to write one that hopefully I c...
I have a .csv file containing 100 millions records, I would to create multiple files from this file, after certain condition satisfied in each line, I came to this code below, but it is slow, I think, it is due the fact the a file is opened and closed in each iteration. The result is many files renamed after countries,...
I wrote the simple calculator in Ruby. This is my first program in this language. I've switched recently from Python to Ruby. What do you think about my work? Thanks # frozen_string_literal: true def read_number(prompt = 'Enter the number: ') loop do print prompt user_input = Float(gets.chomp) return Fl...
Problem statement: Write a program that takes two command-line arguments number and k. The program should convert number to base k. Assume the base is between 2 and 16 inclusive. For bases greater than 10, use the letters A through F to represent the digits 10 through 15, respectively. This is one of my self-imposed ch...
Preamble I was inspired by this review request to create my own quasi JVM Byte Code Struct, Parser and to top it a bit I also wrote two a quasi executors. Currently, they just print the instructions but the executors are flexible and in the future can take a JavaVirtualMachine class instead of std::cout and act on it i...
Since I only just learnt about this, I wanted some advice on better practices I can use when it comes to cryptography. Still learning python and hoping I can get this 'hashing' and 'salting' thing in the bag. I plan on using this for a personal password manager I am making. So basically what I did was, hash a password ...
"Core", "advanced", "extra" are sets of vocabulary for those who study a foreign language. A user has to choose one, two or all three sets. I would like to get all possible combinations: from itertools import product variants = list(product([0, 1], repeat=3)) variants.remove((0, 0, 0)) # In this case a validation exce...
My question pertains to the style in which I've written this function. Is there anything else I can do, to create a better resolution for user when they create a template from their JSON modal? This is PipesJS + Modala. I get a sufficient amount of clones to keep it going. And no one says anything about issues. This is...
I made a Minesweeper game using HTML, CSS and JavaScript and would like to ask for advice and feedback specifically on the code. Here are some questions to review: Is the use of HTML semantics correct? I would like to know if I am using HTML tags properly and if there is any way to improve the semantic structure of th...
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 may be executed in different threads. My question is to understand what needs to be done at the global level and what need...
Here's the question: Scanner scanner = new Scanner(System.in); long x = scanner.nextLong(); if(x<=1) return; if(x>=Math.pow(10, 12)) return; Map<Integer, Long> y = new HashMap<Integer, Long>(); long k = 5; long yes = 0; for(int f = 0;f<x; f++){ y.put(f, k); ...
SELECT v.valuation_id FROM valuation v LEFT JOIN valuation_task vt on vt.valuation_id = v.valuation_id AND vt.valuation_task_id = ( SELECT valuation_task_id FROM valuation_task y WHERE y.valuation_id = v.valuation_id AND y.valuation_task_name = 'Listing live' AND y.valua...
I am getting about 215 MB/s throughput on this implementation of Welford's algorithm. My hard drive is rated for 400 MB/s reads, so I am wondering how I can optimise this. I assume the bottleneck is in getline or atof as 400 MB/s throughput gives my 4 GHz processor 640 cycles per double to work with, which should be mo...
I'm creating a little library for my pet project that is inspired by Boost's outcome namespace. The main reason why I didn't want to use the Boost version is that I don't like the overhead of including something so massive just for something small like this. Source code: using u64 = uint64_t; using i32 = int32_t; /** ...
Problem statement: Write a program that takes a command-line argument n and prints all integers less than n that can be expressed as the sum of two cubes in two different ways i.e. distinct positive integers \$a\$, \$b\$, \$c\$, and \$d\$ such that \$a^3 + b^3 = c^3 + d^3\$. This is one of my self-imposed challenges in...
I have two behaviours: pulling or cloning a git repository. It started as an Enum, but then I had to switch over the enum all the time. I wanted to turn it into some kind of strategy pattern and fiddled around with the declaration of the enum values. I found the following solution, but I have two questions regarding it...
I'm seeking to get some more practice in rust by writing a chess engine. One of the first parts of this, as it will make testing all further parts easier, is the ability to validate and parse Forsythe-Edwards Notation state descriptions. I've got something that seems to work, however, I'm certain how I'm doing it is ne...
This is a follow-up question for A recursive_reduce_all Template Function Implementation in C++. As G. Sliepen's answer mentioned: std::is_arithmetic_v<> checks whether the type is basically an integer or a float, nothing else will match. I am trying to implement an arithmeticable concept which checks whether the ope...
Are there any ways in which this code could be improved? I'm particularly interested in the ModularExponentiation function as it is the primary bottleneck during performance testing. Replacing the built-in modulus operator with "FastMod" improves things slightly but I'm curious if there are better ways to implement the...
This is a follow-up of my thread in Class SettingView sending messages to a console in C#. Here is the whole project on GitHub. The starting point After attending online courses covering configuration and dependency injection this is my attempt to transfer the knowledge in something I have designed. One of the goals is...
Problem statement: The International Standard Book Number (ISBN) is a 10 digit code that uniquely specifies a book. The rightmost digit is a checksum digit which can be uniquely determined from the other 9 digits from the condition that \$d_1 + 2d_2 + 3d_3 + ... + 10d_{10}\$ must be a multiple of 11 (here \$d_i\$ denot...
The Question What is the percentage of customers who increase their closing balance by more than 5%? Source Code The database and all details can be found here. ERD My Proposed Solution Select TOP 1 Format(Cast(Count(Distinct Y.customer_id) AS Decimal) / (Select Count(Distinct customer_id) F...
The problem I am trying to solve as an exercise is as follows: I have a UI running in the main thread, specifically a list view with many items. Each item represents a file that the user can download. To do so, you need to double-click on the item and the download process should start. I don't want the download proces...
my goal is to have a user input a string that is checked to be valid - by defining a dict of allowed strings - and mapped to another string to be stored in a list. Another function is supposed to map these stored strings to Enums and work with those. Here's the code I have: from __future__ import annotations from enum...
Problem statement: A contestant is presented with three doors. Behind one door is a valuable prize, behind the other two are gag gifts. After the contestant chooses a door, the host opens up one of the other two doors (never revealing the prize, of course). The contestant is then given the opportunity to switch to the ...
When writing multi-threading code, one often need the thread to wait for some condition being met. A naive approach would look like this: std::atomic_bool is_lifted; ... //waiting for it being lifted while (false == is_lifted.load()) std::this_thread::yield(); This code is suboptimal, as the busy waiting loop wa...
I'm currently working on my first web scraping project and I need to scrape a lot of websites. With my current code it takes more than a day but for my project I need to scan the same websites every 5 days or so and 1 day of scanning is too long. From what I read so far my options are threading or something like an asy...
I am working on converting some python code over to Rust, and I have come across a bit of a peculiarity in the way that my code is behaving. Namely, the module that I have written in Rust is much slower than the same code written in Python. I originally thought that this was due to the fact that the module that I was w...
I am working on analyzing product photography data on the website and would like to gather feedback on my approach. The goal is to calculate various image metrics to assess the quality of product photos. I have written the following code to calculate these metrics and classify the image quality: import pandas as pd imp...
I have recently made significant progress in overcoming beginner barriers related to using Git, CMake, libraries, and successfully implementing an API in C++. Despite my achievements, I acknowledge that there is room for improvement and would greatly appreciate someone's opinion on my code. As a beginner, I am open to ...
The code makes following assumptions: std::string_view is not null-terminated there are no exponents, all floating point inputs are in the way 123.123 limiting digits before and after decimal point <ctype.h> free. No locale. Uses own isspace() and isdigits() #include <cstdint> #include <string_view> #include <...
Problem statement: In 1769 Leonhard Euler formulated a generalized version of Fermat's Last Theorem, conjecturing that at least \$n\$ \$\text{n}_{\text{th}}\$ powers are needed to obtain a sum that is itself an \$\text{n}_{\text{th}}\$ power, for \$n > 2\$. Write a program to disprove Euler's conjecture (which stood un...
I have following piece of code that is called by a program many thousands of times as part of Monte-Carlo simulation. using gprof, I see that 38% of the time was spent on this function. Are there any obvious areas of improvement in this code? double StudentTCopula::uniform_to_default_time_student(double u, const std::...
I want to factor random values of n that range from uint.MinValue to uint.MaxValue as efficiently as possible. It is my understanding that wheel factorization is about as good as it gets and this is my attempt at a 2, 3, 5 implementation. public static IEnumerable<T> EnumeratePrimeFactors<T>(this T value) where T : IBi...
My use case is this: There is a long running process that I want to ensure is only ever running at most only a single time. Multiple consumers from different threads may wait on the calculation. If the process is not running, the first consumer triggers it. Here is the code: public class Worker { private int _wor...
Problem statement: A couple beginning a family decides to keep having children until they have at least one of either sex. Estimate the average number of children they will have via simulation. Also estimate the most common outcome. Assume that the probability \$p\$ of having a boy or girl is \$\frac{1}{2}\$. This is o...
I'm writing simple application changing page labels in pdf files. First step is to interpret and show page labels. Here's the code doing this. It uses PDFBox library. I don't think there is a need to know this library. I think that my piece of code should be easy to understand. However, I think that there is some code ...
I have written a class in VB.NET that has the task of applying various arithmetic operations to two complex numbers. The class can also determine the magnitude and phase of a complex number. The project is just an exercise, but I want to make it as good as possible. For each calculation, 3 strings are created for outpu...
I have made a simple Sudoku solver in python and TKinter. However, I have used code from many different sources, so it is not neat. I can only write ugly code, so it is just about impossible for me to neaten it fully. I have made a start, but it is still bad. Here's what I have so far: ## IMPORTS ## import tkinter ...
I wrote a small program that initializes a 3D array in C based on command-line arguments and prints it. I did my best to avoid undefined behavior and memory errors. I wrote comments as if I had an exported API. I don’t know if “owns” is standard terminology, I use it here to mean that a function is responsible for free...
I have a directory structure like bellow. . ├── Course 1 │ ├── 1 - Introduction │ │ ├── 01-First Video.mp4 │ │ ├── 02-Second Video.mp4 │ │ ├── 03-Third Video.mp4 │ ├── 2 - Chapter 1 │ │ ├── 05-Nth Video.mp4 │ │ ├── 06-Nth1 Video.mp4 │ │ └── 07-Nth2 Video.mp4 │ ├── 3 - Chapter 2 │ │ ├──...
Well, recently I'm working on a program which is able to sync files between different folders. However, as a fresh man, the algorithm I worte seems feasible, but looks really disgusting, and inefficient as well (bruh~) The following lines are the related things I wrote, I really hope there would be experts who can help...
In an array of integers find all the pairs of elements whose sum is even and form a new array consisting of these sums. Could you tell me whether my code is ok or not? using System; using System.Collections.Generic; using static System.Net.Mime.MediaTypeNames; using System.Collections.Generic; namespace General { ...
I know there has been many questions on the Model-View-Controller pattern, but this question is a follow up on a previous question I asked regarding the implementation of a download manager: Get files downloaded asynchronously after double clicking on list item (C++) One of the reviewers suggested that I implement (bes...
Been working in games development professionally now for about ~5 years, but have only been doing OOP & haven't worked with multi threading before as I'm mostly a gameplay programmer, I've also been getting back to C++ which I haven't written in a long time. I wrote this small program as an exercise in DOP & multi thre...
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll lower_bound(vector<ll> arr, ll tar, ll n) { ll l = 0, h = n - 1; ll ans = n; while (l <= h) { ll mid = l + (h - l) / 2; if (arr[mid] >= tar) { ans = mid; h = mid - 1; } ...
I currently have the following python code that adds a few calculated columns to my consol file. Essentially it combines all the sales files into one combined DF and then adds 4 new sales columns with some conditions back to the consol file. The code works, but it takes about an hour to complete. For reference the comb...
I have created a LP function to help maximize a set of features. My first time playing with this library and also conducting LP. Variables: Number of features => X Number of Categories => Y Problem function: Maximize the Z(s) given changes in X and Y. If I add more features (X) from specific categories or the pool of...
The following Python code is a guessing game in which players have to guess a number between 1 and 10. They only get 3 guesses, and the code will also display if the number is too high or too low, which the player tries to guess. When the while loop exits, because either the number of guessesleft has reached its limit ...
I have this flow for registering a user. They send an empty user account no to get a temp account no which then they use for verifying the OTP by email and phone. Both done they should register successfully and then have a permanent account no by external system. Service public Account saveAccount(Account account) { ...
This is my first time writing a somewhat non-trivial declarative + recursive macro in Rust. I drew inspiration from this answer. The goal is to come up with a recursive macro that allows to assemble some kind of node tree. The general interface function is something like parent.add_child(child). The macro should simpli...
Problem statement: The \$n\$-by-\$n\$ Hadamard matrix \$H(n)\$ is a boolean matrix with the remarkable property that any two rows differ in exactly \$\frac{\text{n}}{\text{2}}\$ bits. \$H(1)\$ is a \$1\$-by-\$1\$ matrix with the single entry true, and for \$n > 1\$, \$H(2n)\$ is obtained by aligning four copies of \$H(...
I am trying to convert an integer (num) to bins as per given interval. the bin size (intervals) are [1, 200), [200, 400), [400, 800), [800, 1200), [1200, num] I'am doing it in a crude way ... def create_bins(num): """Create Bins as per given intervals.""" s1, s2, s3, s4 = 199, 200, 400, 400 if num > 1200: ...
I try to implement this scenario with a producer/consumer multithread pattern and I'd like to optimize synchronization and memory model directive used. This code originates from a SO question and its follow-up, reproduced here. In the main thread, data are produced and store inside a buffer. A task Workload consumes th...
i want to create a gui that allow me to change through differents frame, i have a main frame where there are multiple button and when clicking on the button i want to open a new page (like a "display PDF" button), when closing the page created by the button i wantto go back to main frame. I made a code with creation of...
This is a, I hope, an improved version of this code, limiting atomic usage (following @GSliepen, @G.Sliepen advice) (NB I'm limited to, at most C++17): #include <algorithm> #include <array> #include <atomic> #include <cassert> #include <cmath> #include <condition_variable> #include <cstddef> #include <cstdint> #include...
The code is for a single producer, single consumer scenario, where the consumer only cares about the latest information shared by the producer. This is just a simple proof of concept created for linux. Synchronization between the processes is done with a single variable: xchg in the zcl3b_map_t struct. On update the co...
This is a simple transform of a Word document to embolden the first half of each word. I used the python-docx module. The environment if needed was VS Code; for now the code is working. What I want to know is that there's a chance of some problem to occur, if not how to better clean this code. I tried, but couldn't fin...