instruction
stringlengths
71
95.1k
While writing a web application I've stumbled upon the following problem: I have a relational database. For each table with n columns I have an object-type (called model-object, think ORM) with identically named n fields. Any records queried from a table are converted into such object types. If these are updated by a u...
The goal of the project is to take in input for a data, perhaps in the future as a csv, then print it out using UNICODE box-drawing characters. The main function declares the necessary data and Table class contains all methods and data. Code from typing import List import random class Table: def __init__(self, he...
Yes, I know, I did an (ab) use of the nodes. Is there a better way to make this image with TeX/LaTeX? Using MiKTeX with Texmaker \documentclass{article} \usepackage[margin=1.5cm,top=1cm,headheight=16pt,headsep=0.1in,heightrounded]{geometry} \usepackage{chemfig} \usetikzlibrary{arrows.meta,shapes,positioning,intersectio...
I tried my hand at the freecodecamp python algorithm and I came up with a solution for the first question but need help refactoring it. Here is the arithmetic arranger question click here to access the question and the detailed question can be found below: Students in primary school often arrange arithmetic problems v...
I'm a self-taught programmer starting out with Python and my latest project is this game: It runs in the console, displays an equation, takes the user's answer, and increases your score if it's correct. Every level has 5 questions, and the operands get bigger each level. At the end of each level. It asks if you want to...
I wrote a simple Linter that checks for matching opening and closing braces for one line of JavaScript. It utilizes a stack to store opening braces found in the line, then compares the first closing brace found to pop(). I wrote this in Java based on a Ruby version in "A Common-Sense Guide to Data Structures and Algori...
I have an algorithm that calculates the maximum value of an expression that is made from numbers and * or + by adding parentheses. It has 3 nested loops, so the time complexity should be N^3 static void printMinAndMaxValueOfExp(string exp) { List<int> num = new List<int>(); List<...
I am using Vue3 together with Collect.js. I have an object records that can have n number of items. On my website, I display these records - one by one. The current record is captured by a variable called current Users can navigate through the records (previous or next): <button @click="navigateRecords('previous')" typ...
So I would like to split a string in two by the last space within the first 40 characters, the best solution I could think of: public static void Main(string[] sargs) { var address = "...Are included in two of the " + "substrings. If you want to exclude the " + "period characters...
I wrote a middleware for laravel that grabs the current metadata for the specific URL you visit. How it works: we use the $request and compare the current URL: $request->getRequestUri() with the URL in the database table: So a User visits e.g. /features/landing my code would display the metadata (keywords, descriptio...
Pooja would like to withdraw X USD from an ATM. The cash machine will only accept the transaction if X is a multiple of 5, and Pooja's account balance has enough cash to perform the withdrawal transaction (including bank charges). For each successful withdrawal, the bank charges 0.50 USD. Calculate Pooja's account bala...
Extra gaps A string is given. Write an application that will remove all extra spaces from this string. A space will be considered superfluous if: it is at the beginning of the line, before the first word; it is at the end of the line, after the last word; several spaces are located between two words (in other words, i...
I have an assignment due Friday to make a family tree. Started to code in January. My reviews from the teacher for this code was that the use of pointers was horrendous and it wasn't OOP enough. This code compiles and works. What can I do better to make the code more object oriented? The best commentary was "It's horre...
This is a follow up to my previous post which also follows up on my first post regarding my thread pool implementation. I have since made some further changes and attempted to improve performance with work stealing. The most up to date version of the code is available on my Github. Previously, I removed the use of mult...
Request to review my code please and see if I am following the best practices. This is sending a POST operation via a Python script using the requests library to a networking cloud orchestration endpoint import requests import sys requests.packages.urllib3.disable_warnings() token = input("Please enter your token: ")...
This is my method to split strings into parts by last index of character and by max length, the rationale for this method is because I have to send, in a payload via POST, a list of strings that cannot have more than 40 characters each, suffice to say that I can't cut words in half otherwise it would be much easier. pu...
I’m currently taking an online embedded programming course. This was our 4th programming assignment. The device is Microchip(Atmel) XMEGA-A3BU Xplained Development Kit, Mfr. Part Number: ATXMEGAA3BU-XPLD, the short name is Atxmega256A3BU. The device has an 8 bit data bus and a 16 bit address bus. I'm doing the developm...
I was redirected from StackOverflow to your community in hope to get some help and improve my script. The script receives letters as input and generates possible words, then extracts readable words from comparing my list items with file containing English words. For example when I enter as input : eys this will generat...
I'm practicing my coding on leetcode. I implemented the following algorithm to solve the longest substring problem: class Solution { public: int lengthOfLongestSubstring(string s) { int max = 0; int start = 0; int rec = 0; int curs = 0; char p; char q; ...
I added the getCValue method to reduce the cyclomatic complexity, but the cyclomatic complexity still persists. How can I reduce it? Can I change this code using regular expressions? if I can how? public final class UnicodeEscapeUtil { public static String unicodeUnescape(String unicod...
I'm a bit new in python and I'm trying to achieve what I can't with VBA, get things faster. I have large datasets like this in the source(just a sample): This is done also by python and it's a CSV file. What my code has to do with this is: Get the column "Planned" And "Department Planned". Convert the schedules in "P...
I want to apply a tolerance value to my sketch using a custom property, the input for which will be provided as JSON Here I tried to collect the sketch name from the specific feature (i.e ISO Standard Feature) from the Solidworks feature tree. Once the feature is available, GetDispDimension collects all the names avai...
I'm trying to solve the following exercise from codility: A prime is a positive integer X that has exactly two distinct divisors: 1 and X. The first few prime integers are 2, 3, 5, 7, 11 and 13. A semiprime is a natural number that is the product of two (not necessarily distinct) prime numbers. The first few semiprime...
For mainly didactic reasons, I have designed my ElementsView<I, T> class template, which provides a view over the I th elements of each tuple contained by a given container T, provided that container supports operator[]. The entry point is the factory function template animal::util::elements<I>(...sequence-container-o...
I have this function in python: def executecommand(call): if call.data == "/getpair": return getpaircmd(call.message) elif call.data == "/menu": return menucmd(call.message) elif call.data == "/setalarm": return setalarmcmd(call.message) And I was hoping to replace it with object an...
I spent a lot of time looking for the right coefficients of the two arrows, in order to align the three xylenes. There is probably a more elegant method. Could you suggest it to me? \documentclass{article} \usepackage[margin=1.5cm,top=1cm,headheight=16pt,headsep=0.1in,heightrounded]{geometry} \usepackage{chemfig} \uset...
I have a side menu that appears when click on button, which works fine. But now I want to clean up my code, shorten it if possible. I was wondering if there is an easier and cleaner way to achieve the same result shown in the example below. I would like to reduce the css and delete the "setTimeout" function from js cod...
I implemented the tee command from linux. The program implements the -a option Reads standard input until end-of-file, write a copy of the input to standard output and to the file named in argv[1]. This is another implementation of the tee command. I posted another code trying to implement the command, but I think I fo...
I developed a blackjack game. I am relatively new to c++ and OOP, so I am asking for feedback on what could be improved. This game features betting, taking a card, standing, and splitting a hand. Besides, it also has a dealer that takes when his hand is under 17 and stands when it is over. #include <bits/stdc++.h> usi...
I have written a server-side app in Python that manages email by comparing senders against different lists and then dispositioning the messages according to which list the sender is on. As a side module, I wrote list_manager.py to ensure that a sender exists on only 1 list. It works, but it's already a bit unwieldy w...
I have written a code below for printing the first n fibonacci numbers, the code is as follows var fibo = function (n){ var num = 1, prevNum = 1, currentNum = 1, printNum = []; do{ if(num == 1){ prevNum = num; currentNum = num; printNum.push(num); num++; ...
I have developed a class structure with methods to return a matrix from a single input array. The objective is to insert the middle value of the array so 2n remains in terms of array length. So there should be an even number always. The minimum length is provided by a prime number, which is not a product of two smaller...
I am not an expert with C++, but I am trying to implement a 4-dimensional integral using GSL numerical integration approach. The code below shows the whole algorithm. Although it seems correct what I wrote, I have some difficulties to get results. It actually takes very long time. Do you have any suggestion on what cou...
The following code is pulling data off an exchange. It keeps the subscriptions to the channels because when the websocket client reconnects, all subscriptions are gone and we basically need to resubscribe. When a message is received, it parses it directly from ReadOnlyMemory<T> to avoid string allocations and if it's r...
Any suggestions on how the implementation of the C++ Adapter pattern could be improved here? Implemented via: Composition Inheritance What needed to be adapted was the OptionLegacy class which returns implied volatility of the option but the client needs the dollar price so a simple conversion was included. #include ...
The following code represents a simple indexed binary search tree of integers. The insert method inserts an int. The indexed lookup looks up the ith smallest element (0 indexed). I'm trying to write C++ that is idiomatic, clean, modern, and efficient in that order. Can people give me pointers? #include <iostream> #incl...
I have written some code that shows a div class, based on what ID is clicked. I'm a beginner, so not sure how to make this code compact, it seems way too long at the moment. Can anyone suggest a better way to write it please? $("#Thumb1").on("click", function() { $('.v1').show(); $('.v2').hide(); $('.v3').hide();...
I would appreciate review of this implementation of the concurrent list that is, to my knowledge, currently missing in .NET Core. Requirements Thread safe Lock free Ordered Supports get and set by index Implements generic IList Acceptable performance and time complexity compared to regular IList The main idea To kee...
Problem Inputs: 1. min length of subsequence 2. binary sequence outputs: 1. starting index of sequence 2. subsequence length The task is to find a subsequence from the given binary sequence with highest win rate. The subsequence should be at least of given min length. 1 = win, 0 = loss win rate = number of 1s / subse...
I am trying to find a method to shear/skew an image horizontally or vertically by n degrees (n ranges from -90 to 90 excluding the terminals) so that the result would meet the following conditions: The result would keep the size of the dimension that is not sheared, it means if you shear the image horizontally, the re...
I have a class with a "mode" state. There are currently two modes and we are not likely to add more in the future. The class has a CurrentMode property, and a function to swap to the other mode. I have implemented this using another property called ModeNotInUse which returns the opposite value of CurrentMode. However, ...
Singletons can be very tricky to work with in Unity, especially when you dont want to give up on Monobehaviour features. Most examples I've seen make use of Awake to initialise, but this requires careful managing of script execution order, here is my attempt at a "lazy instantiated" (kind-of) singleton that moves all t...
There are frozenset in Python, but no frozendict or frozenmap. I tried to implement it (Don't care too much about class naming, because I want to try to imitate the standard library) with frozenset, which implement O(1) time to find elements, and only calculates hash values according to all keys. The effect is almost p...
Can someone point out what possible edge cases/leaks/inefficiencies my code has and how they could be avoided/fixed. Basically, I want to know what mistakes I make so I can avoid making them in the future. I chose an LSD radix sort function as a sample for no particular reason. The function: //arrPtr - pointer to the a...
I have the following VBA code (across three modules) to make UDFs to calculate sun & moon position data. The issue I'm facing is that they are very slow to run as I have over 6000 rows (over 10 years of sun/moon position data for multiple locations), and a sheet calculation takes ages when opening/closing/saving the wo...
Any improvements on this combination generator. Seen a lot of combination generators online, but none like this. Found pseudocode at: https://www.baeldung.com/cs/generate-k-combinations Fastest I could make, make it FASTER if you can. Also appreciate improvements in code structure and oop, fairly new on c#. public clas...
I computed a 2D vector field U = (u(x,y), v(x,y)) with radial symmetry, parametrized as (u,v) = a(r) (x,y) + b(r) (-y,x), where a(r), b(r) are given as solution of an IVP which I solved using Y = scipy.integrate.solve_ivp(..., dense_output=True), which yields a solution function Y.sol: r ↦ array([a(r),b(r)]). To simpli...
Im implementing a BST using templates and dynamic memory, here is my attempt: This is the BSTNode.hh #ifndef BSTNODE_HH #define BSTNODE_HH #include <list> #include <algorithm> using namespace std; template <class K, class V> class BSTNode { public: BSTNode(const K &key) { this->key = key; this->va...
I'm trying to find the square root of a number (num) using binary search in Rust. I'm new to Rust, but I've done quite a bit of programming in other languages, though. I'm more interested in how to generally improve this, as I'm not familiar with Rust best-practices and simaler than I am about the algorithm, although I...
Minimal implementation of a circular buffer based on std::array, where elements can only be pushed and iterated. I'm interested on potential failures and very trivial optimizations, as I'd like to keep it as simple as possible. #ifndef CIRCULAR_BUFFER_H #define CIRCULAR_BUFFER_H #include <array> // Array-based push-o...
I made a program that will loop and calculate the average of the input given by the user. There are no problems here. I just want to know if there is a better way to do this, or a way to optimize this code. How this program works: First, the program will read a double and a separator in a forever loop until it finds a ...
I have made a few functions for some basic stack operations using linked lists. Please review my code and suggest some ways to increase its readability. I would also love to hear ideas on how to make my code more compact and simple. #include <stdio.h> #include <stdlib.h> struct node { int data; struct node *ne...
How can I optimize the program? To make it more optimal? The program should be more optimal in terms of source code, compiled executable size, memory usage, speed, bugs etc. Please criticize the program from these points of view. The -a option adds text to the end of a file (if it exists). The program clones the tee fu...
I built a method using reduce of JS to aggregate together data from a DB in a better shape. What I'm wondering is, if that method can be simplified with a more modern approach or better written. Like using a different method instead of a reduce. The method takes the dbData which includes data in the following form: con...
So basically my question is what would be a better way to achieve my goal? The code below works fine but looks like it is extremely inefficient and could be achieved in a better way. The code essentially spawns several child processes with a dynamic name and because the eval() function is in the global scope, the child...
I have implemented minesweeper in C++. You can get a box by entering the coordinates -row number, then column; starting from 0- of said box (eg: "0 0"); you can mark a box as a bomb by adding the prefix "mark" (eg: "mark 0 0"); you can unflag a box by adding the prefix "unmark" (eg: "unmark 0 0"). The game ends when al...
I want to become proficient in Rust and I've followed the PNGme exercise. I've completed it up until Chapter 4 included, where I've written a lot of tests myself for verifying that the command line arguments work as expected and the involved files are manipulated correctly. Unfortunately, the tests have gotten quite me...
This package is on pub dev here It's on Github here class IocContainer { final Map<Type, Object Function(IocContainer container)> _map; IocContainer(this._map); T get<T>() => _map[T]!(this) as T; } class IocContainerBuilder { final Map<Type, Object Function(IocContainer container)> _map = {}; IocContainerBu...
This function creates takes an int * buffer and creates a neatly formatted string (useful for printing the contents of an array). Is the code easy to follow? Is it efficient? Am I allocating and freeing memory properly? Bonus question: is there an idiomatic way to do this in C, such as through a set of library routine...
I'm looking to compare kafka's producer and consumer offsets, get the delta of that and sum it per topic. The code iterates through each topic & partition -- each topic has many partitions. Each partition has an offset value. I'm looping thrice on offsets: Get TopicPartition & offset Get TopicPartition & OffsetAndMeta...
as an exercise from multithreading and networking I have decided to create my own implementation of TCP server accepting connections from two clients (which is I think a pretty common case e.g. chess online games). The works as I wanted it to. Clients are connecting to server, messages from one client are passed to the...
Search directories and their subdirectories for images and videos, except: Windows system folders, locked folders, and folders selected by me. For example, as a developer I have dozens of Visual Studio folders with folders named bin and debug in them. The goal was to write the program in a smart way. That's why I wor...
I wrote a program that changes the attributes of a file. How can I make the program more efficient? Please find program problems. How can I improve the program? #include <stdio.h> #include <string.h> #include <fcntl.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/stat.h> #include <linux/fs.h> typedef en...
This is my solution for problem 1 of the projectEuler with python: import time start_time = time.time() #Time at the start of program execution def multiple_3_or_5(n): if n % 3 ==0 or n % 5 ==0: return True else: return False sum = 0 for i in range (1,1000): # print ("checking :" , i) ...
I have the following part of code. I dislike this, because if I need to add additional validation rule, I have to make changes in loop and create a varaible to store boolean result. For example check age. $nums = []; $linesState = []; $wrongCardNums = []; foreach ($lines as $index => $columns) { $expired = false;...
This is the code currently and it works. Currently have a DB with the type of note and the amount of that note available. This will, later on, remove the amounts of notes from the DB. I am happy with this solution I was just hoping there was a more clean way of writing this part of the code to cut down on the lines. fo...
This is my solution for problem 2 of Project Euler using Python: a, b = 1, 1 total = 0 while a <= 4000000: if a % 2 == 0: total += a a, b = b, a+b # the real formula for Fibonacci sequence print (total) I put the codes in the function IsEven: def IsEven(n): if n % 2 == 0: return True ...
This is my event handler for a videochat client that takes all the events that the server throws at us and routes them to different functions. All of the functions are imported and both settings and session are global objects. My main priority on this project is readability and style and this big switch statement doesn...
I want to process a file chunk by chunk to prevent memory exhaustion. I need to consume the file using a read stream. When trying it, this implementation seems to work fine. I am asking your expert eyes: have I overlooked anything or did I forget some case? have I made a mistake somewhere and it's going to bite me in ...
I developed this hash game in C for my college, but i need to optimize this code, can you help me? it works well, but I need it to be a little more organized and faster, the rand function is the only one used in the code, it uses random to randomize the pc turn, i.e. the pc is completely inefficient. Maybe using more o...
I have inherited a project in bad conditions that contains the following class and I need your help to improve it, the truth is I don't know if it is correctly optimized or if it has security problems or if it can be simplified or refactored to mitigate some overload / overheating . I can't afford to scrap the entire p...
The Stack Overflow question, I'm trying to create an inMemory database using Collections and generics, presents some code that attempts to use Java Generics for an in-memory cache of objects of any particular type that contain an identifier of any particular type. I revamped that code in to the following code. My code ...
I am trying to speed up as much a possible this function in C++. As I explained in another post, Implementing multidimensional integral for a custom function in C++, this function will be used inside multi-dimensional integrals. Do you have any tips that could help me speeding up the computation? For instance, by impro...
I am wondering can I please get some feedback for my simple implementation of the Kosaraju algorithm. More specifically how I de-allocate the things I allocated using malloc and method names. /** * Kosaraju's algorithm implementation which is a linear time algorithm * to find the strongly connected components of a di...
I have written a Rust program that lets you input a citation's metadata in a Bibtex-like format and generates a bibliography entry formatted in Markdown that conforms (more or less) to the Chicago Author-Date style described here. Currently, it supports citations for Books, JournalArticles, and NewspaperArticles with a...
ٍProblem description: The prime factors of 13195 are 5, 7, 13 and 29. Largest prime factor 13195 is 29. What is the largest prime factor of the number 600851475143 ? Prime Factor: any of the prime numbers that can be multiplied to give the original number. Example: Find the prime factors of 100: 100 ÷ 2 = 50; save 2 ...
My function accepts a number, which generates total Fibonacci numbers. I am using recursion. Please follow the code below, var fibo = (n) => { var fibonacci = fibonacci; var fiboNums = [], prevNum = 0, currentNum = 0; fibonacci(n, prevNum, currentNum); console.log(fiboNums.toString()); ...
The daemon program is associated with a message queue with a predefined key, to be blocked later when waiting for messages. The two programs implement a producer-consumer problem. The process sends a message to the queue, and the daemon wakes up to write the message it receives in a file. daemon creates a queue and sen...
We have modified the tee program with your suggestions from the previous pull request. Did I implement well? I would like to optimize the program even more, what else could I improve? What other possible issues are being implemented? previous question Implementation of the "tee" utility program #include <stdio.h> #incl...
I have written a C++ program that uses the Crypto++ library to encrypt files using AES-256Bit (in GCM mode). I am planning to eventually have the program store the keys for the files in a file e.g. keys.txt and encrypt that file again, maybe with a different algorithm which apparently adds security instead of using the...
Background ConHex is game by Michail Antonow where two players try to create a connected chain of cells from one side of the board to the other side. They do this by claiming one empty position each turn. If a player first possesses at least half of the positions of a cell, the cell belongs to that player. Cells can't ...
I've been working on this game the last 2 days. The game is working but I need a feedback for my code. Can it be made simpler? Sorry if my code is very complicated or not well written: I am in the learning process! I feel that I could save some code and have more clear code for others to read Gameplay looks so: you ent...
I'm learning OpenGL and started work on a small 3D game (like Sokoban) for practice. I want to know if the design of my OpenGL code reflects a good understanding of the technology. For example, one problem I ran into was how to handle drawing multiple objects with different shaders, which I fixed thus far by using a se...
Problem description: A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made from the product of two 3-digit numbers. Palindrome: In math, a palindrome is a number that reads the same forward and backward. Ex...
Is there a nice simple function to return which diet has the highest average? I can calculate the means from each diet using: mean(filter(data, grepl('Chow', diet))$Ileibacterium) mean(filter(data, grepl('HFD', diet))$Ileibacterium) mean(filter(data, grepl('HFHSD', diet))$Ileibacterium) mean(filter(data, grepl('HSD', ...
I am currently creating my own 3D renderer (think something like OpenGL). As a first step, I created a mini program below to render primitive 2D shapes essential to 3D graphics: points, lines, and triangles with z buffering. I'm hoping for code review on three essential methods in the class Display _DrawFilledTriangle...
I wrote a rudimentary implementation of doubly linked list. Feel free to comment anything! #ifndef __CLRS4_LINKED_LIST_H__ #define __CLRS4_LINKED_LIST_H__ #include <common.h> #include <concepts> #include <iterator> namespace frozenca::hard { using namespace std; template <typename T> class ListNode { public: T ke...
Problem description: 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? Least Common Multiple(LCM): In arithmetic and number theory, the least common multiple, lowes...
I recently started to learn functional programming and wan't to know If I'm doing things right. I use @effect-ts/core lib as well as date-fns to check if interval overlaps other intervals import * as Arr from '@effect-ts/core/Collections/Immutable/Array' import * as B from '@effect-ts/core/Boolean' import { pipe } from...
What I need: I need a lookup table. Once the keywords are all found, then the value of the std::unordered_map is returned.And I don't care about the sequence of the strings in the std::vector. I think std::unordered_map<std::vector<std::string>, int> could achieve this goal. Any better method to achieve this goal? Or a...
I made a smart Hangman game in Python and now want your opinion about the readability and code quality of this script. I want to improve my overall coding style. So I am happy to hear improvements for naming conventions, proper docstrings and logical/runtime enhancements. So lets start with a quick explanation how my p...
I've constructed code using prepared statements to try and avoid chances of SQL injections. This code is meant to insert the employees information. It does what I need it to do but I want to know if the php or html used in this is suitable for a proper application or if its vulnerable. <form name="register" action=...
I ported the Physical Memory Manager from Vinix into C for a little OS I'm working on. I'd love to get some feedback. Here's my code: // PHOTON INTERNEL "Wave" Kernel // CODE PORTED FROM VINIX Copyright (C) 2021-2022 The Vinix authors. #include <stdint.h> #include <stdbool.h> #include <stddef.h> #include "serial.h" #...
I saw this post. Is this a good implementation of malloc using mmap? memory.hpp #ifndef MEMORY_HPP #define MEMORY_HPP void *malloc(unsigned int); void *calloc(unsigned int); void free(void *); #endif memory.cpp // https://stackoverflow.com/questions/33791310/c-mmap-initialize-at-0xffffffff // https://stackoverflow.c...
I made a couple of little games and cellular automata in Java. For every new 'game', I used the same code as a base, except for the game logic of course. With every iteration of me customizing my existing code to my new idea, my coding skills have much improved and I added new things that I learned. Which is quite a lo...
I am basically a beginner, so I Wrote some code that implements a zero cost singleton, through it will crash your program if you have a MMU. use core::cell::UnsafeCell; use core::mem::{size_of, transmute, MaybeUninit}; /// This type is mean to Static allocation of variables that should life all the program's life /// w...
Is there a way to beautify my code? It works but there repeated blocks and I am not sure that I'm using some functions in the right way. I'm not new to JavaScript but I want to improve it and get rid of Bad Coding Habits. Below is my code snippet that I'm using on the server to upload product images to cloud storage us...
Started learning Rust by solving LeetCode problems as they involve all the standard data structures of the language. I have the following standard hash table solution to the two-sum problem: use std::collections::HashMap; impl Solution { pub fn two_sum(nums: Vec<i32>, target: i32) -> Vec<i32> { let mut pos...
Does the below TS type still need to be improved? I use actions: any as the more general signatures. Is there any better way? import { ActionCreator, ActionCreatorsMapObject, bindActionCreators } from 'redux'; import { useDispatch } from 'react-redux'; import { DependencyList, useMemo } from 'react'; function useActio...
These are what I was working on in the last few days, I wrote a bunch of functions that fill a given region with rectangles of different colors. The functions can: Randomly split a region into sub regions recursively based on n random points: one point (each region is split into four sub regions): two point (each regi...