instruction
stringlengths
71
95.1k
I a creating a program to parse a simple language in a text file and delegate those actions to python-turtle. You pass the path to the file(s) you want to be parsed into the program, and a turtle window is shown. This is my code: import sys import turtle import time t = turtle.Turtle() functions = { "F": t.forwa...
I have written code to take a cellular automaton configuration and determine a state that could have existed one time-step prior, according to Game of Life rules. The algorithm goes roughly as follows: Take a cell, and iterate through every possible 3x3 configuration of cells that could've evolved into this cell after...
The code below swaps two different-length groups of variables of the same array in the same array. Is there any other method to achieve this that is less heavy or less redundant? static void Main() { //posi 0 1 2 3 4 5 6 7 8 9 10 //resu 0 8 9 5 6 7 1 2 3 4 10 //swap 1 2 3 4 8 9 ...
I am trying to build this: Build a traffic light where the lights switch from green to yellow to red after predetermined intervals and loop indefinitely. Each light should be lit for the following durations: Red light: 4000ms Yellow light: 500ms Green light: 3000ms Please review and suggest if this is the right solutio...
I was solving this task https://leetcode.com/explore/learn/card/fun-with-arrays/525/inserting-items-into-an-array/3253/ The main idea is to merge two sorted arrays (more details in the site) Example: Input: nums1 = [1,2,3,0,0,0], m = 3, nums2 = [2,5,6], n = 3 Output: [1,2,2,3,5,6] Explanation: The arrays we are merging...
I'm trying to optimize a function that takes a sorted list of integers and tells me what is the maximum number of elements in the list between any definite size range. To be clear, the range itself isn't given, the size of it is; the lower and upper bounds can be anything as long as they are the given distance apart. E...
I am currently developing a web app and am using Spring as a Backend. I have some user data that is provided by one of our services and I need to display it in my frontend. The subject of the code review is the part, where I process the data in my backend to create a simpler data type that I can directly use in the fro...
I have a coding task. Remove smiles from string in-place. Smile is a set of characters starting from ':' and ending with one or more brackets ')' or one or more brackets '(' Example Input "AA:)))( :((" Output "AA(" Could you please review my solution? (My tests are OK, but I want to confirm that everything is OK) #inc...
This is a follow-up question for A recursive_sum Template Function Implementation with Unwrap Level in C++. As G. Sliepen's answer mentioned, I am trying to implement a recursive struct for retrieve the unwrapped type in nested containers. The experimental implementation recursive_unwrap_type struct implementation // ...
I wanted to write a c++ program to solve a 3x3 rubik's cube using algorithm named simulated annealing, but failed at it. This idea appeared when I watched this: https://www.youtube.com/watch?v=FyyVbuLZav8 So I find some information about that, and i found this text(All other articles depends on this): https://www.resea...
This is a variation of an interesting problem I am currently dealing with. We have a large input file which is being continuously written (size: 10-20G). We need to write a log filter which reads content from the file with the following conditions It looks for specific keywords in each line and if they present, it wri...
I am still just starting out with python and just finished learning about classes, with no further understanding on many python modules. With this in mind, this is one of the biggest/hardest things I have done. The password manager creates a file with as many passwords as you want or one individual password to a file. ...
I needed to implement a way to track idle state / inactivity in a browser (Angular app), so I tried to create an observable that would trigger whenever there wasn't any user-interaction event, so the client can automatically log out: import {filter, from, fromEvent, mergeAll, Observable, of, repeat, timeout} from 'rxjs...
I have a HTML form that allows users to filter their choices when browsing. There are multiple fields (radio button groups) that when the user clicks on them, the search results are updated accordingly. I'm doing this with an Ajax call to results.php and passing a different variable depending on the radio button group ...
I have a directory where there are some script files, some binary files, and some subdirectories. I have tried to write a program which gets names of all files in directory, and excludes if they are directory or binary files. It then reads first line of each file, excludes if "bin" is not there. Then it splits first l...
I'm writing (or at least trying to write) a chess engine in C++. This is the first time I write code in C++, and I use this project to practice. Anyway, I'm following the general guidelines of a tutorial from YouTube and chess programming wiki page but I'm trying to come with improvements on my own. At the moment I'm ...
function bellmanFord(start, graph) { const distances = {}; const predecessors = {}; // Initialize distances and predecessors for (const node in graph) { distances[node] = Infinity; predecessors[node] = null; } distances[start] = 0; // Relax edges repeatedly for (let i = 0; i < Object.keys(grap...
I'm very new to Python and this is my first ever Python GUI app. I am writing a little app to interact with my STM32 Black Pill board. This is very minimal as I intend to use this as the basis for future project with specific intentions. How did I do? What can I do better? import tkinter as tk import serial.tools.li...
I need my cache hold items to be accessible by key. The items should disappear after a configured time period. I do not need the lifetime of items to be exactly as configured. All I need is to make sure that the cache does not grow infinitely and that items are accessible for at least the given time. The rate of items ...
I am looking for a review of my Binary Tree Zipper implementation on Ocaml. These are the defined operations: get (gets the substructure, or the trees after the focus element) bempty creates an empty BTZ (binary tree zipper) bnext bprev bdown bup bupdate bremove to_btree (BTZ to binary tree) from_btree (binary tree to...
I am trying to implement a "proper" pthread multithreading program with pthread mutex. I want it to be as C-standard-conforming and POSIX-conforming as possible. The below is my implementation, any thoughts or bugs?: main.c: #include <pthread.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <strin...
I am a beginner programmer, I decided to make this calculator program to test my knowledge on basic C# syntax, the code executes as intended, however I would like to shorten it to be more concise. Console.WriteLine("Please select your first number: "); double numberOne = Convert.ToDouble(Console.ReadLine()); Console....
I am learning sorting in rust. I want to sort vector as such that even numbers go first My code is OK. But can it be improved (I want to use sort function)? fn main() { let mut v = vec![1, 2, 10, 4, 3]; v.sort_by(|a, b | { (a % 2).cmp(&(b % 2)) }); println!("{:?}", v); // [1, 2, 10, 4, 3] }
I am writing this class to render HTML forms. It is working as expected, so far. There are many things to be done yet (including testing). Is it ok to keep this way? /** * * This class renders (or aims to render) a valid HTML form * * Note: this documentation still needs to be completed. For now...
This app collects info via form that is rendered by Django. The code posts data with JavaScript to viewset. Anybody can post to viewset but only admin users can view or edit them. Please review my code and point out bad practices or errors. views """ I've used serializers with inputs overrides as forms here We can do ...
I want to improve this code to efficiently create all possible permutations/combinations of a string. For example, if I have the string "abc", the result would be the list [ab, ac, ba, bc, ca, cb, abc, acb ...]. I have a solution for this but it takes too long on larger inputs. I need help with improving its efficiency...
I want to apply custom regular expression as data annotation for all of my Model properties. So I create a custom regular expression with dynamic pattern like below:- Purpose:- So the purpose of DynamicRegularExpressionAttribute class is to make generic custom regular expressions where regx pattern could be dynamic. S...
This is a weather app that provide health and weather details based on the location you enter. Can someone help me to review my code? import React from "react" import axios from "axios" import Clockm from "./Clockm" import { useState } from "react" import "./Home.css" export default function Home(){ const [cityData,s...
I finished my web project a while ago and decided to revisit one my first Java projects – the first project that had anything to do with databases. It looked pretty messy to my more experienced eye. For example, I created a new SessionFactory at each method call. I decided to refactor it a bit. I'm still more or less a...
I need to store data in Scrapy Item in parts. To update only the information that I found at the moment. I did it, but the code looks too verbose. Three lines I repeat very often: price['pricereg'] = pricereg price['priceprolong'] = priceprolong price['pricechange'] = pricechange Is it possible to make the code shor...
I'm playing around with a toy implementation of binary trees in C. I have a typedef'd struct BTree like so — typedef struct BTree { struct BTree* left; void* value; struct BTree* right; } BTree; I have three functions implemented so far — BTree* genRandomTree(int depth) — Creates a balanced binary tree of ...
Running this up the flagpole to "put it out there". The code has been compiled with an ancient C++ compiler for the niceties of declaring/defining variables as needed. With some minor tweaking, I'm fairly sure a modern C compiler would be content. (Please excuse the antiquated castings.) What sets this apart from the p...
You are given a, b and c. You need to convert a to b. You can perform following operations: Multiply a by c Decrease a by 2 Decrease a by 1 You can perform these operations in any order and any number of times. You need to find and print minimum number of steps to convert a to b. Constraints: 1 ≤ t ≤ 10⁴ 0 ≤ a, b, c...
I have implemented a service locator, but I am unsure if the services (instances) obtained from it can guarantee the security of the accessed or manipulated data. In some classes where services cannot be injected (such as attribute classes or static extension classes and my team's coding style), I need to use a static ...
I am trying to syncronize the queue between threads using mutex. I have 2 mil random integers in input.txt file. Main thread reads integers then puts them in queue. Other threads are simultaneously taking number from the queue and are doing stuff with it. I succeded to get accurate result each time I run program, but I...
This is a single header event manager that I'm using in my game. Disclaimer I ripped everything from these lovely people: https://austinmorlan.com/posts/entity_component_system/ C++ Event System - Game Engine so give me little to no credit for the ideas used, but I did write every single line myself (using they're im...
I implemented a basic Socks4 client and server which can handle CONNECT requests only right now also without identfication protocol support. I've tested it with a simple ncat echo server which works but I would like to have a review of my: project structure filenaming/code splitting naming/design of structures error h...
Problem Given an array of natural numbers a. Find the number of such pairs of elements (a_i, a_j), where abs(a_i − a_j) mod 200 == 0 and i < j Solution I came up with this solution: // n - the length of numbers array // numbers - the array of natural numbers function getNumberOfGoodPairs(n, numbers) { let coun...
Using plain JavaScript, I want to load an array of objects, display the first one in a Bootstrap Card, and then click a button to advance to the next one. Focusing only on the point of getting the next object in the array, is this a good/bad/ugly/decent/standard technique? const data = [ { "id": "168ad7d0", ...
I wrote a C++ program to find the solution to a puzzle board (a custom puzzle from my school). The puzzle board is made from squares - tiles. On the different tile middle, side or corner there are points (random amount of points). The mission is to construct blocks from tiles, so that each block contains one and only o...
I've started to experiment with (void *) in C, in order to work with Dynamic Data Types, that is, to surpass the need to pass specific type of data. I have implemented this doubly linked list in C and I tried to keep it versatile so it can hold and kind of data type (primitive and non-primitives). I'll be glad to have ...
I am a physics PhD student who co-developped a python package for file conversion of standard file format used in Scanning Probe Microscopy (SPM) and archiving of data manipulation for tracability. If you want to know more about the package, an article was published there: https://doi.org/10.1016/j.ultramic.2021.113345...
With the code I'll provide my objective is to build a map (table) based on the trips the truckers should do for each week with all of the charge/discharge operations. I do not need a deep analysis, just some ideas on how I could make my code more readable and/or efficient. @page "/Dispoplan" @using xizTrucks.Models @us...
This is a follow-up question for A recursive_sum Template Function Implementation with Unwrap Level in C++ and A recursive_unwrap_type_t Struct Implementation in C++. Considering the answer provided by G. Sliepen: Make it more generic Summing is a very specific operation. What if you want to calculate the product of a...
For several projects I need a way to use cubic splines inside cythonized functions and since the scipy functions cannot be used within cython, I went out and built my own. I would like some suggestions and comments, if possible. My goals are: Be able to call the cubic spline (after initialization) as efficiently as po...
I've written this password-keeper application to keep my passwords safe in one place. From something over few lines it grew to almost 200 lines of code. I would greatly appreciate it if someone could review it and provide me with feedback on whether there are any potential improvements, optimizations, or simplification...
This is a Python script I wrote to identify the country code of a given IP address, using data obtained from tor. It uses geoip.txt to identify country code for IPv4 addresses, and geoip6.txt to do so for IPv6 addresses. This is done by converting the address to an integer, then find the index of the starting IP addres...
A while ago I posted the code for this library I'm working on, and have refactored the code quite a bit ever since. I would appreciate any feedback in regards to what I have so far to see what can I improve still. binaryio/reader.h #include <iostream> #include <ranges> #include <stdexcept> #include <string> #include <v...
I'm trying to build step by step a C library that will include some of the major Data Structures such as Linked Lists, Stacks, Binary Trees etc., mostly in order to practice my C programming skills and study new concepts. I have posted previously about my implementation of a doubly linked list, and it had a bunch of su...
I'm getting an XML file from an application, want to extract some information from that file and write it to an Excel file. The XML file contains data about vacations. I need data from the last month with an approval status 1, 5 or 6. The following function returns the month and year: def set_month(): year = ...
I'm building a simple blog with Axum and Rust, mainly to practice Rust. I find myself finding working solutions to the things I want to do, but I don't like the end result of my code, it doesn't feel right, too many unwraps and too many "if let Ok"s". I'm sure there are more idiomatic ways of achieving what I'm trying ...
Summary This is my core networking code for the lockstep RTS game that I am creating. Clients connect to a relay server via a TCP socket, and any packets sent to the relay server are forwarded to all other players. The relay server does not care about the packet contents or game state, it just passes packets around. Cl...
I work with gtsummary package a lot and wanted to try creating a function to sort the columns of table output from tbl_summary() function. tbl_summary has a parameter by which is used to create multiple columns per level of a categorical variable. An example table object is created using trial dataset from gtsummary. t...
I am learning Rust by implementing a series of simple modules which I tend to use a lot in other languages. One of them describes simple methods done on intervals (union, intersection, etc). Here I define a method to split an interval into 2 at a given position. use std::error::Error; #[derive(PartialEq)] #[derive(Deb...
I want to write a decorator in Python 3.11 that adds some basic logging to functions. I want to use the decorator without any keyword arguments: @add_logging In that case it should log with a default logging level of logging.DEBUG. I also want to use the decorator with a keyword argument that then specifies a logging ...
That's about how the logic of my application is implemented. Are there any comments, mistakes or tips? Here is my folder structure ───alembic ├───auth ├───celery ├───crud_routs_func │ ├───accounts_db_func │ ├───dash_board_func ├───db │ ├───backup_folder ├───logger ├───rabbitmq │ └───mnesia ├───routes ├───utils ...
I wrote this function, which (shall) count all occurrences of a specified character within a given string. func countOccurrence(of char: Character, within str: String) -> Int { var strCopy = str var indexes = [String.Index]() while true { let curr = strCopy.firstIndex(of: char) if let curr ...
Is there a more elegant way to set this boolean value? SetScript() is a game API, while "OnClick" is its handler. What is important is the method that triggers when I click on the checkbutton. local foo = true checkbutton:SetScript("OnClick", function() if foo == true then foo = false else foo = true end end)...
I am mechanical engineer and have started learning Python from a book called 'Introduction to Computation and Programming Using Python' by John V. Guttag. This is one of the examples. I know that there are several similar questions posted here, but I thought my program is too simplistic. Here is the code: #Program to e...
I am writing a python REST API library for Starburst and am trying to figure the best way to structure the code so it's dry but also easy to understand. Below is an example of code that is not dry. Other methods I've researched is having a config file with the different API calls and having a single function for get/pu...
Because I've waited until now to bother learning the magical JSON functions that modern MYSQL affords, I wonder if my code is optimally written and if there are cautions/limitations to be aware of. My script uses PHP to pass API-borne data to a MYSQL query where it is LEFT JOINed with locally stored product data. The t...
This is a backend side of Node.js running a simple Http endpoints for a monitring system for a time-related task I recently developed a habit that I would rather spend time to make the code as less as possible because I consider neat looking code is art. I'm lazy to come up with a name for variables and functions, for ...
An ideal subsequence is a subsequence of a string, where the distance between adjacent characters in the subsequence is bounded by a maximum, i.e. \$\lvert c[i] - c[i\pm 1] \rvert \leq k\$ Example: Input: s = "acfgbd" k = 2 Output: 4 Explanation: The longest ideal subsequence is "acbd". The length of this string is...
As an exercise we should write a small Neural Network with the following structure: There should be additionally a bias for each layer and sigmoid should be used as the activation function. The relevant method is the backwards method, which implements backpropagation. It receives results saved from the forward propaga...
I am doing some assignments on my own and one of them is about a Island Counting program, I have come up with a working program but the problem is its very slow. When running test on for example maps that are 30x30 in size is its around 24 ms, which is not bad but pretty slow. because when I test on maps that are 10000...
I'm learning how to use R coming from a python background. I'm following Andrej Karpathy's zero-to-hero course, reimplementing it in R. We start with a list of 32033 names. These names have to be broken into a format digestible by the network. For example, if the first name in the dataset is emma, we would represent it...
From the following script, the "similarity" function should be callable to compare two sets of lists and return a certain similarity score. The elements of the lists represent intervals, so [12,16] represents 12, 13, 14, 15 and 16. From the sets, the lists are compared one by one. So the first lists from both sets are ...
After my previous question I revised the code to the code below. I am using PHP 7.0.33 and tried to accomplish PSR-12 as much as I could. In "condensed usage" in the docblock you can find a full copy-paste example. Here is the code: /** * This class aims to render a valid HTML form block * * @author julio * @date 1...
I have created a Makefile template file which I hope to be able to easily drop in to a folder and have useful targets ready. I am, however, not very familiar with make's language and am looking for suggestions about correctness/readability, or ways to make this file simpler. The template is only intended to be used for...
A while ago, I came up with a function that is similar to this one: Decorator to log function calls and return values, but with a different implementation. What this function does: when applied to a function as a decorator, it captures the positional/named arguments and values passed to the function and outputs results...
From a stream, I receive buffers of varying length. I want to consume chunks of fixed length from this stream. I build a buffer accumulator to accumulate the chunks in an internal array, then I can extract a buffer of a specific size by concatenating and truncating the chunks. Here is an example usecase: const assert =...
I made an implementation of xoshiro256** in JavaScript, using BigInts. It's designed to mimic Math.random. Any feedback on the code quality? function rol64(x, k) { return (x << k) | (x >> (64n - k)); } // state is an array of BigInts that are unsigned 64-bit integers // you could use a normal array, or a BigUint64A...
I have this methods that take in a xml file and add XDeclaration for utf-8. I want to optimize the code because it need to XDocument.Parse and then XDeclaration. It also needs to XDocument.save. Any help would be great. private static string addXmlDefinition(string xmlContent) { string xml = Encoding.U...
A personal project I'm working on needs Worker (thread) pool. The libraries I looked at were too high-level for my needs, as I simply needed access to the Worker itself while the libraries offered task-runner abstractions that were difficult to work around. I decided to write my own, but I figured I would make it gener...
I am trying to write some code for processing streams of asynchronous data from multiple sources (Producer Nodes), process them using a multistage pipeline of Processors Nodes and then forward them to multiple Consumers Nodes. So the way I have thought of going about it is the follows: Each Node has a run function whic...
This class is meant to work exactly as an unsigned integer should work, but it limits the value based on a set amount of bits. /** * @brief Any amount of bits integer. * @tparam bits amount of bits * * @note stores with size of uint64_t */ template <uint8_t bits> requires((bits >= 1) && (bits <= 64)) class uintx_t...
Here's the problem from the book Automate the boring stuff: write a program to find out how often a streak of six heads or a streak of six tails comes up in a randomly generated list of heads and tails. The #comments are a hint by the author. This program I created ran just fine but the chance of streak is surprising...
I was working on a project recently, where I needed to process some tasks periodically, but the execution of those tasks could not overlap with one another. System.Threading.Timer is definitely the best choice for this, but it does not prevent callbacks from overlapping. Realizing this, I wrote my own, aptly named NonO...
I'm currently learning Java at home with YouTube tutorials. I took a short break from the course to make a small project for calculating costs of loan. It's not economically accurate - I followed basic logic and not exact mathematical formulas. I started 1-2 weeks ago but Im learning mainly in the evenings so theres no...
I know this is basic, being a Bash beginner, I like to learn the level of checking and testing when calling commands like; cp, mkdir, wget,... in a Bash function, and returning a result for the function execution status. For example, consider the following function. # copy a file to a directory # ${1} : full file path...
tmpfile() creates a temporary file which is automatically deleted when php exit. I wanted the same for directories, came up with: /** * create a temporary directory that is automatically deleted when the script exits. * * @throws RuntimeException on tmpfile()/mkdir() failure * @return string absolute path to the t...
I wrote a search function, similar to std::find, that uses SIMD instructions. Since I am new to SIMD, I would appreciate comments on other SIMD instructions I have missed that would be useful for this use case, possible corner cases I have overlooked, and best practices in using SIMD and C++ in general. #pragma once #...
Here's my solution to the Chess Dictionary Validator project in Automate the boring stuff by Al Sweigart. I'd love to know how I can improve this code so that it's more efficient. Thank you Function accepts a dictionary that represents a chessboard. Eg: {'1h': 'bking', '6c': 'wqueen', '2g': 'bbishop', '5h': 'bqueen', ...
The following program makes random files. By default, they are of the form /tmp/rfile-XXX. Certain options allow for the user to specify where these files are placed(using the -d dir flag) or what name is used to generate (using the -n name flag, which generates name-XXX) and then uses mkstemp(3) followed by fopen(3) I...
I have written a Python function am_i_wilson(P) that takes an integer P as input and checks if it is a Wilson prime. Here's how it works: If the input P is equal to 0 or 1, the function returns False. Otherwise, it calculates (fact(P-1) + 1) / (P * P) using the fact() function, where fact(n) calculates the factorial of...
This class synchronizes access to an async resource. If retainFutureErrors is false, it will keep retrying until there is a success. Otherwise, the locked method will return a Future with an error. This will form the basis of getting dependencies in ioc_container in the next version. By default, the container should no...
I wrote a C++ class which can take a vector of functions and their respective arguments and execute them in parallel and return a vector of results from its respective functions. // @file: mthread.hh // @author: Tushar Chaurasia (Dark-CodeX) // @license: This file is licensed under the GNU GENERAL PUBLIC LICENSE Versio...
I'm working on building an encrypt/decrypt feature using AES, and a fixed AES 256-bit key size. I have decided on using AES-GCM, as it seems the most performant and secure. I would like to know whether the following use of the browser's Crypto.js library is correctly used. async function generateAESGCMKey() { ...
This is my first time implementing a doubly-linked list. I would like some feedback on my code. Any comment would be appreciated regarding the quality of the code, bad implementation, memory management, memory leaks, etc. This is the API: #include "linked_list.h" #include <stdio.h> #include <stdlib.h> #include <string...
I'm learning PS scripting. Jeff Hicks suggested running the following each day to gain more knowledge - I really like this idea: Get-Command -Module Microsoft*,PS* | Get-Random | Get-Help -ShowWindow Get-Random -input (Get-Help about*) | Get-Help -ShowWindow I want to add them to my Profile.ps1 but only want them to r...
I tried to write a function that will hide a sensitive data from logs. But I am thinking about the optimizations. For example about reduction a nested loops. There are two options how a logs can pass in the function. First is as string, the second is as object that have a __dict__ where "args" located. For exaple in a ...
This class aims to render an HTML compliant div styled table. I added a help() method that provides usage and styling in a more user-friendly way. Besides the review of the code and every advice I will receive I would like to hear your thoughts about the fact __construct() method taking all arguments. Thanks in advance...
I have a C function that generates a range from the given start, step_size and end values. I use this function in a .Net app by PInvoke, therefore I want to optimize it as much as possible. I am novice SIMD programmer but intermediate in C and x86. I have written the SIMD version of it but not sure that it is well-impl...
I have written a Python function called closest_multiple_10() which takes an integer as input and returns the closest multiple of 10. The function works as expected, but its execution time is quite long, and I'm looking for ways to optimize it. Below is my current implementation: def closest_multiple_10(i): a = i ...
This is an ongoing project that has undergone a major update to speed up list processing. Here is the homepage for anyone interested! It processes lists defined in lists.json by transforming the list content into raw hosts, and places those hosts into a lists that matches its corresponding action method and host format...
I've been writing c# for about 4-5 years now mostly at school/uni. I consider it my most fluent language, but I am always learning. I decided to re-try a beginner project with the skills I've learned over the years - kata style. The task is to make a simple bank account object which can take deposits and withdrawals an...
I am a novice in nonparametric modeling and have recently begun exploring the world of varying coefficient models. Essentially, these models involve a non-linear least squares problem that relies on kernel weights. My current challenge is the slow performance of my R code, which is the only programming language I am fa...
I see three complexities in accessing (reading/writing) integer field in network packet. Handle endianness. Integer in network packet is big-endian (BE). The host may be either big-endian or little-endian (LE). The integer may have a bit width that is not a multiple of 8. E.g., IPv4 fragment offset has 13 bits. The in...
I am learning object oriented programming in Rust. I created my own struct for complex numbers. Could you please review and answer my questions: Is it possible to implement C++-like default constructor? I want to replace let c0 = my_math::Complex::default(); with let c0: Complex;. Why should I implement PartialEq ins...
This is supposed to subdivide a n-dimensional aabb (axis aligned bounding box) into 2ⁿ equal pieces as if sliced by n planes that are perpendicular to only one axis and parallel to the rest of the axes at a time. The code: CGL_bool CGL_aabb_subdivide_ndim(CGL_int n, CGL_float* aabb_min, CGL_float* aabb_max, CGL_float* ...