instruction
stringlengths
71
95.1k
I have finished my router and would like your thoughts about my code. I think it works well, but I'm not sure since I'm new to the VHDL world. Could someone please help me? Is my code correct? SOURCE CODE library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; -- ------------------------- -- Entity ...
I've created something that looks like a volume bar that changes based on how high the user has the volume. Here I've set it to 63 as a example but it actually gets it from the Spotify API. Is there a more efficient way to do this? volume_percent = 63 if volume_percent == 0: volume_graphic = '--------' elif volume...
The problem is Find the names of all characters which are from the same homeworld as Chewbacca My code is Chewbacca = df.loc[df.name == "Chewbacca"],"homeworld" print(Chewbacca) df.loc[df.homeworld == "Kashyyyk"] I first found Chewbacca's homeworld and then filtered it. Is there more efficient way to do this?
The following algorithm is used to find a word from Blacklisted words in a string (called text) and replace these words with censored text, as shown in the example. Example: Blacklist ["bomb"] text: "bomb bombs" Output: "b*** bombs" Code public List<string> Blacklist { get; set; } = new List<string>(); public string...
I am working on a project where I see the following methods wrapped in a Util class public static Boolean isEmpty(Collection<?> collection) { return (collection == null || collection.isEmpty()); } public static Boolean isNotEmpty(Collection<?> collection) { return !isEmpty(collection); } Using Util method void p...
I want to have some classes that would contain arrays of different sizes. I want this to be statically allocated because it is intended for an embedded system. The only good solution I can think of is using templates. However, I want to use the same class type to access those objects. This is my solution so far. class ...
This is my first project in julia. It is a raytracer based on spheres. using Random: rand, seed!, randn using LinearAlgebra: norm, normalize, ×, ⋅ using Statistics: mean using ImageCore: RGB, ⊙, clamp01 using FileIO: save ±(a, b) = @. a + [-1, +1] * b Black = RGB{Float32}(0.0, 0.0, 0.0) White = RGB{Float32}(1.0, 1.0,...
A function random_int_with_probability that returns a random number within a range, where the chance to get a bigger value decreases linearly towards the maxima. In the example below, the chance decreases by 10%, meaning to you will have guaranteed 100% chance to at least get 1, then have 90% to get 2, 3 at 80% and so ...
I implemented this context manager for importing modules from arbitrary directories. Good? Bad? - Keen to get thoughts: Implementation import sys class CustomPath: def __init__(self, path:str): self.original_path = sys.path self.custom_path = path def __enter__(self): sys.pa...
The following snippet is for a basic notebook. You can take a note. You can delete a note. You can see all your notes. You can change a note. You can also see a see a specific note; for this you will need its name. You can restart everything you did until now. When you take a note you need to give it a name so you can...
By analogy with std::thread, I've written an RAII POSIX process: class posix_process { public: explicit posix_process(std::function<void()> proc_main) : _pid(fork()) { if (_pid == -1) throw std::system_error(errno, std::generic_category(), "fork"); if (_pid == 0) proc...
I have implemented some basic functionalities of task manager wherein whenever a new process is created it will be added to list of processes. Also if any process creates thread(s) it will get added to the thread list which is per process. ProcessManager.h #ifndef DLP_PROCESS_MANAGER_H #define DLP_PROCESS_MANAGER_H #i...
I have some code that needs to branch depending on if a value from a database is absent. Essentially our database contains some key value pairs from a dictionary. If the key is absent from a set, we should append zero as the value for that key. Otherwise, we should append the value from the database. values = [] known_...
So I was in need of a way to draw a patterned line that passes through several points on a 2D space, something that no Python library seems able to do out of the box (at least, the ones I've been looking at). I stated my problem (with visual illustrations) in this question, but no one answered. After mulling over the p...
This project was part of the JetBrains Academy Java course. The project was about implementing an Encryption program that uses either a simple Caesar Cipher (or) a Unicode Cipher depending on the arguments being passed to the program. The data to be Encrypted/Decrypted is just one line. The different arguments being pa...
I made a minimax algorithm for a connect 4 and I would like to optimize it to improve the calculation time. I have already done the classic optimization such as alpha beta pruning and a variable where I store all the play already calculated so as not to recalculate them. I think there are still optimizations to be done...
PrimaryCoordinates are the coordinates in meters. SecondaryCoordinates are the coordinates in decimeters, with the origin located at the primary coordinates. TertiaryCoordinates are the coordinates in cm, with the origin at the secondary coordinates. The Position of an object, depending on its size, could have all t...
I am writing the Restaurant Management homework which must be following the MVC pattern. My Menu model has two parts: Drink menu and Food menu. With Food menu, it separates into three different types of menu: Breakfast, Lunch and Dinner menu. About the Drink menu, it also divide into two different menu: Alcohol and Sof...
Pillow is a popular library for handling images in Python. My code adds support for the QOI image format to Pillow. Aside from loading and saving QOI images, my goal was to write a streaming decoder and encoder deriving from PIL.ImageFile.PyDecoder and PIL.ImageFile.PyEncoder respectively, which, as far as I know, has ...
I'm using SQLite3, via php's extension module, to create a persistent object cache for WordPress. It's intended for use on modestly sized sites that don't have access to redis or memcached. Why use this? To give smaller WordPress installations access to similar performance-enhancing tech as the bigger ones. Many php c...
I'm working on porting the bullet3 physics engine to Go to learn more about physics simulations. I'm working through some of the convex hull computing code, and I've reached a component-wise, double precision multiplication class in the original C++ code. I'm not familiar with this type of low-level math, so I'm not su...
This is a payment platform that takes in two types of cards and checks for authorization and pin verification. I'm particularly interested in finding any semantic/logical errors I've overlooked. #include <cstdlib> #include <iostream> #include <functional> #include <vector> enum class CardType { PISA, BlasterCar...
Background/context: This program randomly selects predefined items ("Names" as strings) according to 2 rules: #Rule 1: Each name/item in the list can only be selected once. #Rule 2: Single item exclusion cases for all random selections such that a person cannot select themselves. This program serves its intended purpos...
Advent of code, Day 2. Here is my code. Less verbose version of the question follows. import itertools import pathlib from typing import TypeAlias Shape: TypeAlias = str WinStatus: TypeAlias = str RPS = Rock, Paper, Scissors = "RPS" WLD = Win, Lose, Draw = "WLD" shape = dict(zip("ABCXYZ", (*RPS, *RPS), strict=True)) ...
For a recent project of mine I had to create various data structures in pure C with no external libraries (in other words, code I've written by myself), which lacks the templating and OOP capabilities of C++. However, I figured a macro might be easier than a void*-based solution, so here it is. It's functional as far a...
When creating a function to be reusable throughout the project I came across something strange. After looking at this function it looks very much like it could be refactored. The function should only return the short month and day, in that order. If it receives a parameter, it will be a Firestore Timestamp with the fol...
I've implemented the 2D ISING model in Python, using NumPy and Numba's JIT: from timeit import default_timer as timer import matplotlib.pyplot as plt import numba as nb import numpy as np # TODO for Dict optimization. # from numba import types # from numba.typed import Dict @nb.njit(nogil=True) def initialstate(N): ...
There was this type challenge: Get an Object that is the difference between O & O1 I came up with such solution but I wonder if you have advice to simplify my approach? My solution: type Diff<O extends object, O1 extends object, tmp extends object ={[k in keyof O]: k extends keyof O1 ? never:O[k]} &{[k in keyof O1]: ...
from collections.abc import Iterator import itertools import pathlib import string PRIORITY = {v: i for i, v in enumerate(string.ascii_letters, start=1)} def parse(f: pathlib.Path) -> Iterator[str]: yield from f.read_text().splitlines() def parse_line_blocks(f: pathlib.Path, block_size: int) -> Iterator[list[...
I have a .NET 6 web API that does some requests to another third party API, this API has a token that expires after a few hours, so I want to cache this token and reuse in the requests. Here how I implemented it: public class TokenInformation { public string Token { get; set; } public DateTime ExpiresIn { get; ...
These are five implementations I’ve come up with for an equivalent for Haskell’s Maybe in Python. It’s not called Optional because typing.Optional already exists. Here’s a simple monolithic class. The benefit of this one is that it can be inherited from: from __future__ import annotations from typing import Callable, G...
I have these six files: Reservation.hpp; #ifndef RESERVATION_HPP #define RESERVATION_HPP #include <string> #include "Date.hpp" class Reservation { std::string referenceID; Date startDate; Date endDate; public: Reservation(const std::string& referenceID, const Date& start, const Date& end); Res...
Below is my attempt at Advent of Code 2022 - Day 3 - Part 1. That link will bring you to the problem description. I'd like to get some feedback on this. I'm new to Python, started working with it for this years challenge in order to learn. I'm quite certain there are better ways to solve this particular problem. I'd ap...
The code is designed to see if the first alphabetic characters in the *str argument refers to a known function, as part of a calculator app, and sets *str to the first character after the name of the mathematical function if found, similar to the endptr argument in strtol, strtod, etc. I seek to make this code as direc...
i really need to optimize this piece of code for my master thesis. it take up to 20 seconds to lemmatize documents with >6000 words. the problem is that i have to lemmatize more than 200.000 documents with an avarage of 10.000 words each. import pandas as pd import nltk import gensim from nltk.stem.wordnet import Word...
For a recent project of mine I had to do read input from the console in pure C with no external libraries (in other words, code I've written by myself). I don't like the standard formatted input such as scanf or std::cin in C++, I feel like having to do a dummy read to get rid of the leftover newline is not great. In C...
I have following code: fruits = content.find_all("fruit") matching_fruits = [fruit for fruit in fruits if fruit.has_info('name') and fruit.has_info('source') and fruit.info['source'].endswith('primary')] return len(matching_fruits) How can I either reduce the code, or make it more readable? I am interested in mak...
The following code is producing the desired output but I'm wondering if there's a way to accomplish the same result by applying .filter() to data. Any other more concise approaches than shown below are also welcomed. Data description: scenarios consist of a scenario object plus an array of profile objects Filtering go...
I got inspired by this blog post and implemented a fixed-size sparse set, removing the need for vectors, because the sparse set's size equals at least sizeof(value_type * Size), it should be allocated on the heap when using a large set. The idea is to be enable for the creation of contiguous sets inside a container tha...
I read up on and dived into the Repository pattern for a project I am working on. I have understood that the repository abstracts the actual access to any form of storage for my data model. What I was a bit hazy on was how to use everything in the context of an ordinary application, so I had a stab at it and came up wi...
I have a thread safe queue in my library c9y. It is generally used as a task queue in the task_pool class, but in can be used for any producer / consumer problem. queue.h #ifndef _C9Y_QUEUE_H_ #define _C9Y_QUEUE_H_ #include <mutex> #include <condition_variable> #include <deque> #include <chrono> namespace c9y { u...
My second little project. I would like to hear all the critics possible. This is a C++ Long Int library. It is self-education project, however I would like to make it better. For me possible things to change are: Fix enormous re-copying, where it shouldn't be. Add move-semantics where possible. * Create an internal co...
I have recently created a Hangman Game in C++ and I would like your feedback on any improvements that can be made to this Hangman game I have written especialy in class organization. Here is the code : https://github.com/ydepledt/Hangman. (for now code function only for french words because I haven't yet implemented wo...
I need to find cosine similarities between two lists of different sizes. I have this code but it is running for a long time. The first list has 40 000 words and the second list has 400 words. Is it possible to speed this up? I have been trying different approaches instead of using vectorizer but none of the other appro...
I'm new to Python and programming in general. Let's imagine I have a simple task: Given 3 numbers from user input, I need to count negative ones and print the result. Considering what I know about Python at this moment, I can solve it like this: class ListTooShort(Exception): pass def input_check(): temp_list ...
I am working on a problem where I need to get specific information for min and max outliers. This is in relation to the ggplot library. I will be getting all my information from ggplot_build object. The data that is used will look something like this: cleandata <- data.frame(middle=c(1, 4, 7), xmiddle=c(2, 9, 1)) clean...
Could you please help with speeding-up this code? Input: UTF-8 text (encoded 1-3 times from known pool of encodings). Every time was encoded and decoded by random encoding from pool. Original was koi8-r. Output: UTF-8 text decoded You can use only built-in libs or own code in one script import sys import timeit from st...
Here is my current .zshrc: # If you come from bash you might have to change your $PATH. export PATH=$HOME/bin:/usr/local/bin:$PATH # Path to your oh-my-zsh installation. export ZSH="$HOME/.oh-my-zsh" # Set name of the theme to load --- if set to "random", it will # load a random theme each time oh-my-zsh is loaded, i...
I am working on a project in react. Where most of the data on different tabs have a table. So I design the "TableItems" component and passed the data according to the component. Right now based on params I toggle the table data. Is this the correct way? some tables have different columns so the data table is varying. i...
This is a project for a class and all the requirements are met, I just wanted to do a little more and make this even better. All the changes that I've made are already implemented and I would like to know what could I do more. I tried doing some changes here and there but could not think of anything substantial to chan...
I have a simple cookie popup where the component technically runs on every page, giving the user the option to accept all or essential cookies. Once they accept an option, the popup no longer shows. However, I keep wondering whether many of the variables need to be memoised because the CookiePopup component itself rend...
As part of a larger program, I'm trying to find the cleanest way to architecture my program to query a cosmos db and use its return values (dict objects) as easy to manipulate and maintain objects in the whole program. So I created a parent class called cosmos_objects which inherits from dict and in which I wrote the c...
Context: This is a program that translates spreadsheets to English from Dutch using another custom library (transl). Question: Would like to hear criticism or advice on how to make the code better - not noob-like (Though I am one). Also, want to know what I do good. Thank you. Backstory: I Never got feedback on my code...
This class has a Log function that appends text to a log text file. It takes a format string and a variable amount of arguments, much like a printf sort of function. It then writes the formatted string with the interpolated arguments to the file. I wanted to know if there are any edge cases I might've missed, or if any...
Am using AJAX script to have data fetched from database. For example has Motorola Samsung Apple as company and using AJAX to fetch models of it. Like when apple is selected then it shows apple iPhone 12, iPhone 13, iPhone 14, 14 pro max Using this older generic script as test basis which is like years old where whe...
Instructions for the 'is my friend cheating' kata in codewars are: A friend of mine takes the sequence of all numbers from 1 to n (where n > 0). Within that sequence, he chooses two numbers, a and b. He says that the product of a and b should be equal to the sum of all numbers in the sequence, excluding a and b. Given ...
The tricky thing was keeping copies of list iterators in a tree map and managing both together. I'm not handling invalid input cases (like popping an empty stack) in this code. I am following Google C++ style guide. Any advice and feedback would be appreciated! // A Max Stack data structure which supports the push/pop ...
I am a beginner to Rust, started learning because of Advent of Code 2022. I solved Day 7's problem by implementing a tree data structure and traversing it. TLDR, the problem provides a log of terminal inputs and outputs, consisting of either ls or cd <dir> commands, such as $ cd / $ ls dir a 1 b $ cd a $ ls a 2 a 3 b ...
First I would like to thank everyone for whatever help you may offer me. In full disclosure this is a project for a bootcamp class I have. My problem is, and I've asked them about this, that they aren't really teaching anything beyond beginner-level at General Assembly. This seems like the next place to come for the he...
I have an ever growing switch case statement I plan on adding 3 more case statements to. Given an int, compare it to an enum, and call IMapper.Map<TDestination>(sourceObject); public WebhookActivity MakeMessage(WebhookActivityRequest request) { WebhookActivity command = _mapper.Map<ConsecutiveCaseCreated>(request);...
I would like a review regarding the method I use to create the new columns and then reposition them in the correct place where they should be. The new column called total_matched_vls should always be on the right side of the column called total_matched, which in the original CSV is at position 10 The new column called ...
I wrote this cat clone in C++. It does two things prints the content of file if only one file is given. concatenate and print contents of file if more than one file are provided. I am especially concerned with the overloading of << for the class CLI. I mainly wanted to gain some abstraction with this. Below is the co...
I wrote a number plate generation program. The program generates number plates for a car registered with a specific Memory Tag and on a specific date. Number plates use the following format: (2 letter Memory Tag)(2 digit Age Identifier)(space)(3 Random Letters) The Memory Tag is already given. Age identifiers are the l...
When a user using a Retina display makes a screenshot and pastes it into the browser, the size of the image is twice the selected area. This is expected as a Retina display, but the pasted image should have the proper size (the same as the selection) and not double the size. When doing a screenshot on MacOS, the OS add...
I am using AJAX script to fetch data from a database. For example, it has Motorola Samsung Apple as company and I use AJAX to fetch models of it, so that when Apple is selected then it shows Apple iPhone 12, iPhone 13, iPhone 14, 14 pro max. This is an improved version of my AJAX script to load data for mobile phon...
I wrote this script as part of a Suricata course where I had to annotate destination IP addresses with GeoIP data in an EVE JSON log file. I would like your input on my code style and smell, especially the gen_geoip() function - it takes an IP address and return a "geoip" JSON object. It is very compact and it has a Li...
I have a thread_pool class, that mimics std::thread. (I would have liked std to have a pool, but alas that is not the case.) thread_pool.h #ifndef _C9Y_THREAD_POOL_H_ #define _C9Y_THREAD_POOL_H_ #include <functional> #include <thread> #include <vector> #include "defines.h" namespace c9y { //! Thread Pool cla...
I trying to figure out the most effective way to accomplish this task: A function, check(), contains a list of strings. Calling the function with a string as argument, will return True if the argument string is part of any of the strings in the list. False if not. I want to guess the content of that list in as few chec...
We have several thousand large (10M<lines) text files produced by a windows machine. We need to change the file encoding of these files from cp1252 to utf-8, replace any bare Unix LF sequences (i.e. \n) with spaces, then replace the DOS line end sequences ("CR-LF", i.e \r\n) with Unix line end sequences (i.e. \n). The ...
I wrote an PHP Autoloader to include it "easyer" to my projects. Here the folder structure: www ├───index.php ├───init.php └───Libarys └───bootstrap ├───index.php ├───bootstrap_loader.php └───bootstrap_core_files (Files and Directories (Abbreviated so it doesn't get too much)) www/index.php...
I created this blackjack program which I'm looking for feedback, both with the code and how the program itself works. I'm also looking to see if my code could be faster or cleaner before I compile it using Cython. I've used three files: main.py, class_handler.py and account_handler.py. For clarity, I've seperated them ...
I am completely new to object oriented programing (OOP). I have also never worked with C# before. The exercise from my book had some requirements that should be followed to complete the exercise. Use of at least two classes (not counting the main class), one of which should be a Tile class, representing the tiles No p...
Kattis problem - ("I've been everywhere") I would highly recommend looking at the problem through the link, however I will summarize it a bit here and explain the functionality of each part of my horrendous code. Example input: 2 7 saskatoon toronto winnipeg toronto vancouver saskatoon toronto 3 edmonton edmonton edmon...
I have decided on a preferred solution to my question A maybe type in Python. Which implementation is best?, and have expanded it to be more ergonomic. I have implemented a host of utility functions (largely borrowed combinators from Haskell) and I have implemented all dunder methods I feel can be reasonably interprete...
I have a repetitive data reduction where I have a list of ID's that I want to find in a longer list. I have a method, but it is slower than I'd like. How can can I speed this up? The process: After each contiguous section of ID's I want to insert a blank row (I'll do other things with the blank row but that's not impor...
Each of the lines in my CSV is a possibility of investment that I register on historic, but I would only make the investment if in the existing history (previous lines) the sum of the results is above zero because it is the sum of profitability or loss. At each line I need to analyze whether the sum of the previous lin...
I'm trying to optimize algorithm 1 in my following code. First double loop, I calculate points beforehand which will run only once. Then I have the first version of algorithm 1 which is another double loop with many branches. After that, I presented the optimized version which runs two times faster. The difference betw...
I'm working on a material/shader graph system. I came up with a simple solution, but nodes that weren't connected were used in some situations. So, I thought of using Kahn's algorithm to execute nodes' tasks. I'm not quite sure if it's a proper implementation. I've only played with it, so it's a single file to avoid ju...
Background I am working on a VBA paradigm for modifying the Excel environment from a UDF. I call this "sudo mode", and I leverage Application.Run() to invoke a delegate procedure, like RunSudo() in my example. ' Delegate to sudo mode. ... Application.Run GetSudoCall() ' ^^^^^^^^^^^^^ ' ".....
There are solutions e.g. list.OrderBy(item => Math.Abs(number - item)).First() or list.Aggregate((x,y) => Math.Abs(x-number) < Math.Abs(y-number) ? x : y); which are O(N) at best. The solution bellow should be faster than a sequential scan on a large list. It is more performant to sort the list first (O(NlogN)) and t...
When putting on a piece of clothing, we need to check for any clothing that is already on the relevant body parts(s). The possible plural means that we should use the Composite Pattern for the body parts, and then check if the existing clothes must be removed or not. Some clothes can go over other clothes, while some...
I would like to expand a library which converts a DEM (Digital elevation model) to values stored in a dictionary. This dictionary can be used to create a 3D terrain in Three.js. I made a Django template to illustrate the use of this library which I will share the link of at the end if interested. I would like to expand...
I have multiple E2E tests (written in Java) which share login details, each test during runtime will query the locker API for login details which is running on its own dedicated server. Below is my implementation of my locker API in Go, it was working for me but wanted to make sure there are no bugs. type service struc...
I trying to figure out the most effective way to accomplish this task: A function, check(), contains a list of strings. Calling the function with a string as argument, will return True if the argument string is part of any of the strings in the list. False if not. Here's my code: import string from tqdm import tqdm d...
I want to split a list (as if splitting a string by a delimiter), ideally in a functional style, and was surprised how hard it seems to be. Or maybe my code is just unnecessarily complicated? fun <ElemType : Comparable<ElemType>> Iterable<ElemType>.split(delim: ElemType): List<List<ElemType>> { return this.fold(em...
Usage: ./usort <options> <filename> Name: ./usort - sort lines of text. Description: Write sorted concatenation of FILE to standard output. In the absence of options,...
I want to extend generic iterators with a convenience function until() that works like an inversion of take_while(). Here is the code: Cargo.toml: [package] name = "until" version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies]...
This program uses webcam to track hand movements / gestures and sends corresponding mouse / keyboard events to the computer. I use it to switch spaces, move active window between desktops, scroll vertically and horizontally and control the cursor. My previous post here had some obvious improvements needed which a user ...
For educational purpose I am preprocessing multiple short texts containing the description of the symptoms of cars fault. The text is written by humans and is rich in misspelling, capital letters and other stuff. I wanted to write a short pre-processing function and I have three questions: Why I get two different resu...
#ifndef REGISTRY_REGISTRY_H #define REGISTRY_REGISTRY_H #include <vector> #include "patient.h" #include "doctor.h" #include "appointment.h" class Registry { public: Registry(); ~Registry(); std::vector<std::pair<std::string, Patient>> GetPatients() const; std::vector<std::pair<std::string, Doctor...
I'm learning Lua for about a week now and I've built (I hope) a function to print any type in Lua. As I'm new to Lua I don't quite understand: if there is a more succinct way to achieve this if there is a standard way to print nested tables if there are any cases the function doesn't cover function printAnyLuaType(A...
I've written a pretty basic algorithm to convert a string to a binary hash tree of its characters, where each character represents a leaf node. The hash tree itself is being stored in a vector. If the number of leaf nodes is not a power of 2, I'm padding the number leaf nodes with empty substrings until the number of l...
I have the following dataframe: d_test = { 'name' : ['South Beach', 'Dog', 'Bird', 'Ant', 'Big Dog', 'Beach', 'Dear', 'Cat', 'Fish', 'Dry Fish'], 'cluster_number' : [1, 2, 3, 3, 2, 1, 4, 2, 2, 2] } df_test = pd.DataFrame(d_test) I want to identify similar names in name column if those names belong to one clust...
I need to parse JSON data that's got a... unique structure. It either looks like this: {"ok": true, "<key>": .... } or this {"ok": false, "error": "reason" } Where <key> and the shape of the data depends on the API call. The following code accomplishes this task, assuming that T derives Deserialize from serde. Howeve...
This is a simple inverted index I made. The goal is to: Read set of text files from a directory, docs Tokenize them Normalize the tokens by removing punctuation and lowercasing them create an index of words to doc name, count of docs that that word appears in Everything works as expected. I'm just curious what impro...
I am in a fantasy football league and each week I send out a power rankings poll through Microsoft Forms. People will send in their rankings poll and I will create a graphic based on responses. I was doing this manually and decided that a Python script could do this for me instead. Below is the code for my program (the...
Any comments / improvements welcome on this simple function. tests.py @pytest.mark.parametrize([ # path '/c/target-uri', '/c/uk/indiana/target-uri', '/c/uk/indiana/target-uri/persons', '/c/uk/florida/target-uri/persons', ]) def test_extract_uri(self, path): assert extract_uri(path) == 'target-ur...
I am a beginner in assembly and would like to know ways I could improve my code. I am talking more about assembly specific things and less the logic e.g. what I could've written better, like loops SECTION .data ; Section containing initialised data Base64Table: db "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn...
i have solved a question in codewars: https://www.codewars.com/kata/5254ca2719453dcc0b00027d/python , here's my solution is it unefficient to use itertools because people are blaming that is cheating using libraries should i try to solve it on other ways and is it this bad way to implement the question this is my first...
I'm writing a Resource Manager for my small but scalable future project. The main target of this is to get best speed of access, be flexible and avoid memory leaks. Enumerations enum class ResourceType { None = 0, Script, Texture, Mesh, Shader, Sound, }; enum ResourceDictionary : uint64_t { ...