instruction
stringlengths
71
95.1k
Background. I've written an algorithm to solve the Time Difference of Arrival (TDoA) multilateration problem in 3-dimensions. That is, given the known coordinates of N nodes (e.g. optical photo detectors), the velocity of some signal, and the time of signal arrival at each node, I wish to determine the cartesian coordi...
I am working on a blogging application in Laravel 8. In the FrontendController controller I have: namespace App\Http\Controllers; use App\Models\Settings; use App\Models\ArticleCategory; class FrontendController extends Controller { protected $site_settings; protected $theme_directory; protected $site_name;...
I wrote my implementation to Linked List. And I tried to implement all the functions in the standard library list in CPP! I need a review for it to improve it and improve my coding skill. I also will put this implementation on my GitHub account. Thanks in advance. //=====================================================...
This library is a layer of abstraction over file operations in C#. It aims to provide easy file IO syntax, and implicit error handling behaviors, to ensure robustness in scenarios including, but not limited to: No file name supplied Incorrect path supplied File name is supplied without the path But not only for error...
I'm trying to use recursion to find the closest numbers in a list. I made a program that runs correctly without any errors but I want to know if there's a better way to write my program while still using recursion. This is my program: deff = -1 num1 = 0 num2 = 0 def closest(List): global deff, num1, num2 deff1 ...
I've recently watched a few talks on implementing easy-to-use hardware abstraction layers in C++ for use on embedded devices such as ARM Cortex-based microcontrollers such as the STM32F4 that I am targeting with this project. I would like some input into whether or not the following usage structure makes sense to the a...
As a beginner in php, I welcome you feedback on improving or simplifying the following php code that generates this responsive image html (image sizes and formats are auto-generated using Gulp). For example, is having three nested foreach loops bad practice? Generated HTML: <figure> <picture> <source media=...
I've created a small project that fetches data from a 'countries' API and works around with it to display the 'top 10 most populated countries' & 'top 10 most spoken languages'. I kindly wish if this code can be reviewed for improvements since I don't have anyone who can review my code.. :( I mostly care about the js p...
This is a follow up question to Send and receive functions for telnet client. I am designing a simple wrapper around the telnet client using libtelnet for text-based communication to a telnet server. Please see my implementation below: #include <arpa/inet.h> #include <ctype.h> #include <errno.h> #include <netdb.h> #inc...
How can I improve my login script and is there a cleaner way to get the same result? I had this project and redesigned it using MVP patten . Working with this patten is a new challenge for me. It's hard to tell if I've done the best work possible. My project is composed of Models, Views, Presenter, Repository In my pro...
With the demise of passwordsgenerator.net I wrote my own generator; Please review with an eye on correctness and maintainability; //Inspiration; https://web.archive.org/web/20220711113233/https://passwordsgenerator.net/ button.addEventListener("click", generatePassword); //Yes, not super, global constant.. const sy...
I have this program for minimax tic tac toe import java.io.*; import java.util.*; public class TicTacToe implements Serializable { String state; //State of the board such as 1, 2, 3, 4, 12, 13, etc. Integer score; //Score for that state static ArrayList <TicTacToe> States; //AllCombinations static final...
I've implemented a timer thread whose job is to call functions at a certain interval. The functions may be called multiple times if their interval > 0 millisec otherwise only one time. Even if the timer thread is running, still a new function can be registered. Could you please provide your feedback and improvement fac...
Bitmap page allocator that scans the bitmap linearly looking for size amount of pages. Everytime it founds a free page, it check if the next size pages are also free, if yes it marks them as allocated and returns a pointer to the first page uint64_t *bitmap; #define setpage(p, x) bitmap[p / 64] = x << (p % 64) | bitm...
I have a Google Spreadsheet with a few hundreds of sheets there. Users update those sheets with new data under a strict and specific template. I created a Google Apps Script where once every while, I run it to change several things on every sheet, by keeping the original data intact and export those in multiple CSV fil...
Firstly, I apologize for the lengthy post. I was not sure which code I should include. In practice of c++, I am writing a toy application for pub/sub using c++17. To keep things simple, both the publisher and subscriber are on the same OS Process, and thus only a deque is needed to store messages. I don't use a Singl...
I wrote a list of functions in PHP that I want to use in my pet project as an autoloaded file for all parts of the app. The purpose of these function is to shorten the code you write for MySQL queries in PHP using MySQLi. It also uses prepared statements to make it secure. Is this code alright? What improvements can I ...
The purpose of this code is to provide a type-safe approach to apply mixins to classes. It also prevents duplicate mixins. The code depends on ts-toolbelt. It is divided into multiple files, but I've included it in one chunk here for simplicity. Here is the code I am asking to be reviewed. /////////////////////////////...
Simple lightweight queue implementation using data size registration and singly linked lists as the underlying type Update #2 /* Author: Jared Thomas Date: Tuesday, August 2, 2022 Type-generic queue using singly linked lists */ #include <stdlib.h> #include <stdio.h> typedef struct Node { void *...
Overview This is my attempt at a Tic Tac Toe game. I need some criticism and some ideas on what I could do better, because I know somethings need to be cleaned up. Quick Notes I also couldn't figure ways to make the dictionary checks less cluttered and more cleaner(I am noob, pardon this ugly code) I did this without...
I'm pretty sure the script below can be refactored but I'm not sure how to go about it. Assuming I need to make use of inheritances but that's a skill I'm still working on. Any thoughts on how this script can be improved would be greatly appreciated. This is just a snippet of my project - the end goal is to retrieve da...
The below function is used to Remove Duplicate Lines per each cell. It works without problem, but it is slow with a range of only one column and 17k rows. Actually, (with the same range in addition to another two column) , I am using a different excellent code by @VBasic2008 Link which perform complex tasks than my fun...
Virtual Memory manager that has functions, mappage, unmappage, remappage If the physical address that was passed in to mappage is 0, the physical pages will be randomly allocated. I decided to do it like this since i'm using the limine bootloader and it automatically restricts 0 - 0x1000 memory addresses. Here is a pic...
I just started an internship and we have a little task to do. It should follow the SOLID principles and I have a slight idea, but I'm not exactly sure what I'm looking for and if you can tell me how to improve my code you will help me a lot. Also, why is the forEach not working and I have to make a For loop? This is th...
I'm trying to determine I missed something here since python isn't my native language. Python app starts Python creates a cert.pem and key.pem running this command pem openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365 Python sets the flask secret key to a per instance generated uuid Fla...
I made a python script that takes an image and converts it into an ASCII-art representation and saves it as a .txt file. The logic is somewhat simple. It resizes the image to a manageable size, converts it to gray-scale, takes the value of each pixel and assigns it a character according to it. Then appends the characte...
I have code that is responsible for determining move position in a hex grid when the user moves the stick on the gamepad. cameraAdjustedMovement is a Vector3. _xThreshold and _yThreshold are floats. _isOdd is a bool. The code is very simple. We just check input from cameraAdjustedMovement and determine where to move....
This is a simple C-Squares encoder in R. FYI, C-Squares is a geocoding algorithm that assigns GPS coordinates to a spatial grid with a chosen resolution. Its specifications is here: https://www.cmar.csiro.au/csquares/spec1-1.htm intended usage: lon <- rnorm(10, -10, 2) lat <- rnorm(10, 53, 1) csquares <- identify_33ce...
My program implements a function similar to `dup2'. I would like you to please find any problems with the code and what I could improve. code: #include <unistd.h> #include <sys/types.h> #include <errno.h> #include <stdio.h> #include <string.h> #include <linux/limits.h> #define OPEN_MAX 1024 int mydup2(int filedes, in...
I would like to implement a variant of the classical dining philosophers problem which has the definition as: Implement the dining philosopher’s problem with the following constraints/modifications. There should be 5 philosophers sharing chopsticks, with one chopstick between each adjacent pair of philosophers. Each p...
Given the JSON response below: const result = { 'potential': { A: 514, B: 3127, C: 2970, D: 282, E: 41, F: 1, undefined: 48, }, 'current': { A: 2, B: 961, C: 2897, D: 2568, E: 455, F: 47, G: 5, undefined: 48, }, }; I need to transform it to: const tem...
The accepted solution is much cleaner and outperforms the algorithm below for small maps, it doesn't do as well with larger ones: my code takes twice as long as the accepted code for maps of 10 pairs (30 vs. 15 ms), but mine is something like 30 times faster for the larger input described below (8 s vs. 4 m). However, ...
I have the following function in Swift and am looking to improve the readability. The function takes from the deviceData object which holds maps of data like [String:Double], [String:Int], and sometimes just regular String. The function is meant to format the data in the maps into Strings and return an array of Strings...
Problem Context: I needed to make a script that would search through all the files in a GitHub Repo and find all the README files within it, then replicate the File-Tree of the Repo to a specified destination directory. Solution: I made a function that takes in two directories (source, destination). The directory input...
This is a classic thing to want to do since it's in C that one doesn't have the std::string of C++ and input of Python. I believe that the best thing to do is to read the input stream character by character, since scanf is unsafe and fgets requires an expected size to be passed, things which I do not want to do. I've r...
I am a beginner, who is just learning the language (C++) from C++ Primer. I have been trying to build a side pico-project by writing functions for validation of user input for an signed double. The code is provided below. My questions: Are there any logical errors in the code (I have tested several times with invalid ...
I have a C++ project which needs a few periodic timers. I have created a timer class for this project using Grand Central Dispatch. I tried using boost::asio, but for some company policy reasons, I cannot link with said library. Here's the header file with the interface: // // PeriodicTimer.hpp // #pragma once #in...
I recently picked up Rust and was making a CLI for Conway's Game of Life. I got it working but, looking back at it, there are places it could be improved. The main one is the function that generates the next board. Specifically, the part of that function which calculates the amount of alive neighbours a cell has. fn ne...
I'm just looking for general guidance on this short TypeScript function I implemented. Are there any glaring violations? Are there better practices for accomplishing this? Should I be using map/reduce/filter, or is this simple approach just fine here? I'm not sure about efficiency here because we basically just need to...
I wrote this function to take database output like from PDO's fetchAll(PDO::FETCH_ASSOC) and turn it into a tree. For small datasets it works well. However, when I run it on an array of 54,000 elements, it takes around 65 seconds on an Intel 7700K. I was hoping it would take less than a second, though maybe that's un...
Simplified from https://github.com/132nd-vWing/tacview-splitter. External dependencies: zip crate The code would do the following: read a file from disk (determined at runtime) analyze the content, split it into a header and a body divide the body into two categories (here blue and red) for each category, write the he...
I am trying to learn backtracing , so i wrote program for Sudoku It solves sudoku in approx. 1 ms in online c compiler but this one sudoku puzzle is taking approx. 35 sec in that online c compiler with my code. How to improvise the code , does recursion will help ? .If yes how ?(because recursion will also take same nu...
Here is the solution that I have. Due to the legacy product we have all of our URLs in one big Slug model in rails that maps URLs to models. EG [ { 'Product 1' => '/product-1'}, { 'Category 1' => '/category-1'} } Next.js it does not support sending a component from getStaticProps, so our [...slug].js winds up incl...
Thanks to the extremely helpful comments and answers from the original post, I've improved the interface and implementation of this general-purpose queue library. Improvements include: Fixed memory leak when dequeueing items Enqueue is now a constant time operation Improved accident prevention by enforcing a data size...
I'm new here. I wrote the following code to parse the linear temporal logic(LTL) formula and evaluate it with respect to a trace. But I'm totally not happy with my code because I think the complexity is very high and the "if else" condition in the two eval functions can be improved. The LTL grammar is as follows, phi =...
I am porting the C-style socket to design a simple wrapper around the telnet client in CPP. The telnet protocol is accomplished by using libtelnet in C. The C-style code for this wrapper is reviewed here and here as well. I want to follow standard practices in my CPP code, such as using smart pointers in CPP instead of...
The task is to find the longest common prefix. While I had no trouble to find the solution, I'm interested in the statistics of my code: Runtime: 7 ms, faster than 56.36% of C++ online submissions for Longest Common Prefix. Memory Usage: 9.3 MB, less than 54.46% of C++ online submissions for Longest Common Prefix. Al...
Im working on the login screen for my application. It has fields for users email and password. Also users can click on forgot password button to send an email with new passsword. It can validate these fields, show errors. I would like to hear peoples opinion about how I could improve my code to make it more readible, c...
I use the following code to identify some interested values into a dataframe and them plot a time window before and after that value appeared. It works very well, but I would like to know if there is a less coding way/more pythonic way to accomplish this. Thanks in advance! Before I go, I try to use only Seaborn on the...
I am trying to parse a line with a fixed amount of fields and known types. using Text = FieldType<std::string>; using Int = FieldType<int>; using Name = Text; using TextSpecificField = Text; using IntSpecificField = Int; struct LineData { Name name; TextSpecificField textField; IntSpecificField intField; ...
For dummy's sake, let's say that I have a database with columns text, ind and sentid. You can think of it as a database with one row per word, with a word's text, its position in the sentence, and the ID of the sentence. To query for specific occurrences of n words, I join the table with itself n times. That table does...
I want to generate a random seed based on a string value (which is ~32 characters long). I don't want to use string.GetHashCode() since I may later will need a working implementation in another language (C++, Python, JavaScript) (Yes I will need to get rid of Random() too then and all other .NET classes). I also want t...
This is the my solution to a coding challenge in Geektrust. The question is linked here. A shortened version would be as follows. The aim is to simulate a marketplace for banks to lend money to borrowers and receive payments for the loans. It takes as input: The bank name, borrower name, principal, interest and term....
Context Chapter 6 of Learn You A Haskell contains a function called chain, which outputs the Collatz sequence of a given input. (In short, it takes a natural number. If that number is even, it divides it by two. If it's odd, it multiplies it by 3 and then adds 1 to that. It then takes the resulting number and applies t...
I was learning C the past few days and decided to make a mini project to get a better feel for it following the Ray Tracing In a Weekend Series. I got it working however I feel like it is pretty slow as the main image took 3 hours to run. I couldn't really find a good way to profile my code(On Mac M1) and I'm pretty su...
The code run perfectly fine, with no errors. However, the entirety of the code is in 1 function and is kind of hard to read. As well as that I'm not sure if and how the code could be more optimised/improved. Thank you for your suggestions and help! def ScreenShot(): pydirectinput.click(x=483, y=559 ) time.sleep...
This is the question link for the quick reference. Problem : There are two players Kevin and Stuart have to play a game in which they're pleased to create multiple strings and will get +1 score for each sub string for which Kevin would select the sub string starting from vowels and Stuart will select for consonants ...
Background I'm implementing an algorithm which localises overlapping sound sources using the time-difference-of-arrivals across 3 sensors [1]. Compatible 'triples' (e.g. with only 2 common sensors) need to be joined up to make larger N sensor graphs. The compatible triples are found using a recursive routine (```combin...
I'm a freshman student. What does my program solve? This is actually a bot for reddit, and there are language learning subreddits on that website, sometimes when discussing something with people, we may need to show declension or conjugation tables to them, instead of sending a link, this bot will help you to comment i...
I built a table component for an admin panel app using React and Typescript. This admin panel is for a Discord bot where you can do your moderation solely through a web app. This table lists the members in the Discord server. There are three sections: All Members, Muted, and Banned. I would like to know how I could imp...
Is there a more efficient way to check if what the user has entered (“food_ordered”) is on the “order_menu” without having to use “food_keys” or “food_names”? order_menu = {("C", "Chips (Scoops)") : 2.80, ("F", "Fish (Battered)") : 2.90, ("Fc", "Fish (Crumbed)") : 4.90, ("Fib", "Filet (Battered)") : 6.90, ("Fic", "File...
I'm trying to pad a tensor of some shape such that the total memory used by the tensor is always a multiple of 512 E.g. Tensor shape 16x1x1x4 of type SI32 (Multiply by 4 to get total size) The total elements are 16x4x1x1 = 64 Total Memory required 64x**4** = 256 (Not multiple of 512) Padded shape would be 32x1x1x4 = 51...
The problem goes like this: Given two one-dimensional arrays, for example a = (3, 4, 5) and b = (5, 6, 9), write a function that sums the arrays as a number digit by digit, i.e. producing c = (9, 1, 4). Do not use any high-level functions such as str.join() or str.split(). 345 + 569 --- 914 My solution: def sum_arr(...
My program is working properly but I'm unconfortable with code repetition. class Movimentacao(models.Model): data = models.DateField() # complete datetime field from 2019->2022 movimentacao = models.CharField(max_length=200) # text field valor_da_operacao = models.DecimalField(max_digits=19, decimal_places=...
I am building a .Net Core 6.0 application that uses Entity Framework. I have situation where I need to apply the filter(Where clause) based on two properties (eg: Guid? skillType, string skillName). These properties may or may not have values, means that Neither of the property will have value Either of the property w...
I'm wondering if the following Python wrapper for C++ I'm developing is worth expanding upon and including in my portfolio. If so, I plan to add more parameter options and return types. The problem is, that I don't know if my current path is any good. Is my current implementation too amateur? I'm aware there are alread...
In this code I'm using nodemailer for sending otp email from my gmail account. I have also used ejs for creating html templates for emails. This code works perfectly, but I am a bit concerned about how the code is written, particularly the use of try-catch for error handling. Should I use try/catch in a promise if an e...
I am new to javascript and I made a simple Rock Paper scissor game with User Interface. There will be 5 rounds and user will play against the computer by clicking any of the three buttons. See Live preview Review my code: Html: <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>Rock Paper Scissors...
I was recently tasked with creating a function that could generate a "varied" version of some collection of parameters. As in, it should take in a list of parameters, and then vary the value of the first one while leaving the rest fixed -- thus creating some variations. We then move on to the next parameter, and repeat...
I created the code for the problem description below. It works for \$N\le10^6\$ but after that it gives a time out error. What I don't understand is how to optimize the code using dynamic programming. I have used a dictionary to create decibinary numbers with the formula mentioned in this OEIS post. for more descriptio...
This question is about pivoting and padding columns, two very frequent activities in Pandas. I have a raw dataframe. I need to manipulate from long to wide and then pad NaN based on a specific rule. My code works, but I think is not efficient and elegant, plus it is not able to generalize as I highlighted at the end. B...
I needed a set with the following properties: can be iterated in ascending or descending order in \$O(N)\$ time the usual set operations (contains, add, remove, discard) can still be done in \$O(1)\$ if it helps achieve the above, then the set can be constrained to integers within a preset range [minInt, maxInt] Belo...
How could I improve my below program? I do have some warnings. For example: toString() may produce a null pointer exception. I tried to get around that, by specifying the !=null in the if statement if (from != null && to != null && from.equals("NZD")), but that hasn't worked. Duplicate map key if statement can be repla...
I have been tasked in creating a method that would replicate a full directory tree to a remote server using C#. The problem there is that I can only create the folder or the file if it has a parent. I've decided to first get all folders along with their parents and store them in a tuple since a dictionary does not allo...
Let's say you have a book. A book can have an author, an editor, a proof reader, or several other credits. Which credits are available should be dynamic (someone might not want to have the "proof reader" credit, or want to add something not available "out of the box"). Each credit can have one or many people. I would n...
generate all combinations from list of numbers,the combinations can be pair of two numbers example 1 : list of 2 numbers [1,2] [ [[1],[2]], [[1,2]] ] example 2 : list of 3 numbers [1,2,3] [ [[1], [2], [3]], [[1], [2, 3]], [[1, 3], [2]], [[1, 2], [3]] ] example 3 : list of 4 numbers [1,2,3,4] [ [[1], [2], [3], [4]]...
I inherited a solution with many projects, and one of them contains hard coded database connection parameters. These are referenced in a number of other projects, and many of those are dependencies of the entry assembly. The solution has multiple entry assemblies or deployment units, intended as microservices. My first...
I've written a singly-linked list of characters. This is my 3rd C program and I'd like some feedback on what I can improve on in any aspect whatsoever. If you'd prefer to look at the repo directly it's here: https://github.com/JosephSBoyle/LinkedList Thanks in advance for your time :D linked_list.h #include <stdbool.h>...
After writing a basic API with rocket, I'm trying to improve it, but I'm not sure how to follow up. Each time a new request comes in, the code keeps looking for the variable from the environment. // Connect to redis pub fn connect() -> redis::Connection { let redis_host_name = env::var("REDIS_HOSTNAME").expect("mi...
I've expanded, and enhanced my matrix class which uses, aside from dynamic memory for the elements, only 3, const literals. These are rows, cols, and a ptr. The methods are all constexpr and the example code includes compile time verification of tests which compare compile time hashes against hashes generated at runtim...
Inspired by a leetcode exercise, I wrote my own coin changer: You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Return the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up ...
FizzBuzz is a well known Exercise among programmers, but I wanted to add an aspect called "openClosed" principle (from SOLID) FizzBuzz is a very simple programming task, used in software developer job interviews, to determine whether the job candidate can actually write code. It was invented by Imran Ghory, and popular...
I'm training JavaScript and using APIs. So I'm building a recipe website that lets you search ingredients and finds you recipes with it. Here is the link: https://www.themealdb.com/ I found some code I could help myself with, and that I understood, to build on. I then wanted to have a few available Json informations mo...
I have a program which calls a lot of URLs with the help of a goroutine and assigns the result to a mapping. As a beginner in go I chose the simplest implementation as possible. I have ended up launching a goroutine inside the main() function which calls the goroutines that are responsible for the http calls and assign...
I have a piece of code to send and receive files on Windows with C. Is this the right way to do it? And am I guaranteed that the full file will be sent and received? Receiving function: int recvFile(char path[100], SOCKET y) { char buf[BUFSIZE]; size_t size = BUFSIZE; int counter = 0; int totalRead = 0;...
A task: Сollect data from the site in the following format: book; user; book_rating; comment_rating; publication_date; comment For one book at once several pages of reviews (or more than one). Problem: One request to the site can be sent once every 0.25 seconds, so async requests don't work. Question: Can data collecti...
I want to implement a crud movie library system and also some filtering capabilities. Since it is so big, I have added the link to the code. https://github.com/neslihanbozer/Movie-Library. I am aware it would be extendable in terms of testing. But what else could you suggest? package com.movie.lib.service.impl; import...
This code incorporates the new .NET 7 Output Caching. I would like to get some refactoring tips on the RedisOutputCacheStore class. How to use // Redis Output Cache builder.Services.AddStackExchangeRedisCache(options => options.ConfigurationOptions = new ConfigurationOptions { EndPoints = { "localhost:6379" }, ...
I've implemented a destructive merge and quick sort in common lisp, but the code feels verbose and highly imperative. I was wondering if anyone could offer guidance on idioms that could make the code more readable, or more lispy. Any other criticism and advice is also welcome. I chose to make these functions destruct...
ㅤ Hello. As an amateur coder, i'm doing some game mods etc. I have these almost identical and kind of spacious methods, and i wonder if there is any way to make them less bloaty? ㅤ I'm curious about this for future instances too. My original methods are basically for pulling out particular buildings from the map, with ...
I'm an ECE student. My experience in Verilog and FPGAs is mainly from my digital logic design class. To practice Verilog, I decided to implement a controller for Adafruit LED matrices. It interfaces with a single-port BRAM to access pixel data. If helpful, here is an overview of how it works: The design has an FSM that...
I study algorithms, and I try to implement each algorithm in C (Perhaps it would be better to choose C++, but okay) Here is my implementation of sorting by choice. How would you rate it? To be honest, I'm a bit intimidated by malloc and whether I used it correctly. (returning an array from a function is not that easy) ...
This takes the sum of pairs of numbers from 1 to 10 and outputs the sum, the original numbers, and some connecting text. Output: intArray.length 10 {Sum of + 1 and 2 =3, Sum of + 3 and 4 =7, Sum of + 5 and 6 =11, Sum of + 7 and 8 =15, Sum of + 9 and 10 =19} Please see the code below and suggest if this is fine way o...
I am learning to write more modern C++, since my C++ is from the 1990s (I'm a C# programmer). I need to get used to the STL algorithms and such. So I tried some kata, summing up numbers in a given range that are divisible by 3 or 5, using new C++11/14/17 stuff. I know that it can be solved mathematically in O(1), but t...
I started learning Lua yesterday and wanted to write a quick program as a practice. It queries an external service for the IP address and country code, and naively check for the existence of network interface names used by VPNs (like Nordvpn or other). It then prints a colored output containing the country flag emoji a...
Task Write a program that can generate and manage collections of IDs. The user should determine how long the IDs have to be and what symbols they are composed of. Design choices made by me The program functionalities are used via command line arguments A configuration file determines which scheme the IDs correspond to...
I'm building a drag and drop sortable list in Javascript. This is what I have so far. Is this a good way to solve the problem? How can I improve my code? <div id="list"> <ul> <li data-value="Bananas" draggable="true">Bananas</li> <li data-value="Keys" draggable="true">Keys</li> <li data-va...
This exercise is called PDF Paranoia and it comes from CH 15 of the book Automate the Boring Stuff With Python - second edition. There are two parts to the exercise, which I've separated into two Python files. The code I've provided uses Python 3.10 and PyPDF2 v. 2.10.0. The instructions are as follows: Using the os.w...
Task. To generate random mazes using backtracking algorithm. User inputs how many vertical and horizontal pathes the maze should have and then the script uses this information to generate a maze. Evaluation criterion. Maze creation speed. The script should be fast enough to randomly generate huge mazes as fast as possi...
This is my custom implementation of a double Linked list. Code is apparently working fine. Need advices on improvement and/or optimization. This is a tiny academic side-project. I am still pretty green to C++ . Would also want to know what are the differences between all sorts of custom implementations and STL implemen...