instruction
stringlengths
71
95.1k
I'm a developer who has completed almost one year of full-stack development & learning. I published my very first package lately, and I don't know is my code good or bad. So I jumped down here. EditorJS is block based medium-like rich text editor, so here's a link to it. The package gets the JSON input, passes to offic...
I have never tried this before. Just started with Kotlin and Android CameraX. Here is a fragment I would like some feedback on so I can writer safer and better Kotlin code. package com.name.app.maincontroller import android.Manifest import android.annotation.SuppressLint import android.content.Context import android.c...
I have implemented a simple pattern matching for the below algorithm in Java with time complexity of O(n)(n is the size of the input array). Any suggestions for optimization?? one of the most important aspects of accurately matching records to candidates is ensuring that the name in the record matches the name or a kno...
I have used the factory pattern for one of my projects. I want to know if this is a good design or if my code can be improved to make it as fast as possible. I am not an expert in C#. This is what I came up with after 2 days of research, with lots of rewrites. What I want to ask is: Is this the right approach? Can I im...
I am not sure how to accurately describe what this program does in just a few words, anyway this program is very simple and easy to use, what it does is very simple and it is good at it. Let me start from the beginning, I want to generate random pronounceable strings that closely resemble English text, and I want my pr...
So far I have made a class called Deck, to create and shuffle a deck of cards, and a class called Player, which I want to use to create the gambler and the dealer. My Player class inherits from the Deck class, so the players can access the created deck. My problem is that because I create 2 objects from Player class (g...
I want to start omxplayer, check if there is the process is up, check if there is internet connection start with play a streaming, if there is not play a local loop, meanwhile try to check if the internet connection is up, if there is internet connection stop local file and play streaming video. I write this... any sug...
I wrote a Lagrange polynomial interpolation class. It works fine. At the beginning some definitions: $$ \begin{align} &nodes:\qquad x_0, \dots, x_n \\ &values:\qquad f(x_0), \dots, f(x_n) \\ &weights:\qquad w_0, \dots, w_n\qquad\text{where}~~~ w_j = \prod_{k=0, k \neq j}^{n}(x_j-x_k)^{-1} \\ &coeff:\qquad f(x_0)w_0, \d...
Rewrite of A simple counting loop class based on feedback: This version adds a step parameter and better iterator concept support. Counting is always done in a signed integral, and only integers and floats are supported. #include <cmath> #include <ranges> #include <bit> #include <algorithm> #include <iostream> #include...
In my python-based project I have the following problem: I have a list with many entries, with each entry being an object of the same class. This is demonstrated in the code below: #!/usr/bin/env python3 class demo_class: """Example class for demonstration""" def __init__(self, val_a, val_b, val_c): se...
I coded a little loop that reduces a dataset by computing the mean of X rows every X rows. I'm working with a dataset of a certain size (8 Millions rows for 10 columns) and my code takes too long to compute the whole dataset. I am using Pandas. Is there a way to improve my loop to make it more efficient and faster ? #...
I use asyncio to speed up web scraping. I collect only title, author, tags, datetime, total comments from list view from specific website. Also, i collect these from all pages. I would like to improve my code, so any idea i would appreciate it. My code: from bs4 import BeautifulSoup, Tag from dataclasses import datacla...
I'm a computer science student, and in 2 of my courses this semester we are writing short C programs to demonstrate the things we are learning about. All of these programs require command-line flags & arguments, so I decided to write a short single-header library for myself to be able to add simple flags, integer, and ...
I've just started learning rust and have written a basic sudoku solver, however it seems to run much slower than I expected. So I'm looking for any possible performance improvements as well as any other general feedback. fn main() { let initial_grid: [[i8; 9]; 9] = [ [0, 4, 3, 0, 0, 0, 0, 0, 9], [0...
I did research because I want to learn Kruskal's and Prim's MSTs. I did research and after a solid understanding, I went to my textbook and got their libraries: https://algs4.cs.princeton.edu/code/edu/princeton/cs/algs4/Edge.java.html https://algs4.cs.princeton.edu/43mst/EdgeWeightedGraph.java.html Here is my code,...
I'm trying to learn and write best practice unittests and practice test driven design. Can you give me some tips and review my code? using System.Threading.Tasks; using Moq; using Xunit; namespace Blockchain.Unittests { public class AccountShould { private static string _webUrl = "https://test.test/tes...
I'm taking a course and I've just completed a challenge. The program runs well and it does everything I told it to, but I would like suggestions as to what can I implement to make it better (ex. pointers, move constructors etc.). #include <iostream> #include <vector> #include <string> using namespace std; class Movie...
I'm learning C++ by implementing a previous project I did in Python. This is a simple stack machine which evaluates mathematical expressions, e.g. pow(9, 12). The code to run this on the stack machine would be an ordered list of constants and instructions: 12 9 POW. In Python, preparing such a list is quite straightfo...
I am creating an alert system for a game/sim in C# that keeps track of negative actions performed by the user during a training exercise. There are preconfigured alerts that have data, such as UI text and how many times the alert may be triggered before the user fails the exercise. Whenever an alert is triggered, there...
I'm learning about OOP and putting my knowledge into practice. I created a login system in PHP, so I wish someone could tell me if I'm on the right track. I feel like I'm getting better at coding, but it's never good enough, so I want someone more experienced (especially in OOP) to look at my code and tell me if I'm do...
I have an Enum the encapsulates numeric primitives (u8, i8, u16, i16, u32, i32, u64, i64, f32, f64) into a common type called "Number". I want to implement a PartialOrd train for the enum based on the encapsulated data allowing different numbers to be compared. I have a solution that uses nested pattern matching and ...
In this program I've tried the insertion Sort method to execute #include<stdio.h> int main() { int numbers[25]={21,89,98,76,56,4,345,34,53,56,68,68,68,575,7,4,45,45,35,35,35,2,22,52,235}, temp_str, comp_count=0 ; while(comp_count<25) // To ensure sorting completion { for(int comp_loop=0; comp_loop<...
My solution for the leet code problem to search an array of ints for duplicate values and return a boolean seems quite efficient (< 90% of submissions runtime). However, I am currently reviewing Data Structures and Algorithms and I wonder if there is a more efficient approach to this, since if my counting is correct my...
I'm new to C#. I have created a form that has 5 text boxes and this function checks to see if every text box has text in the box. If not, then it displays a message box saying "Error (Add Text)". I wanted to see if there was a way to simplify this, or if this is the best way of completing this task :) private bo...
I'm working with an API that for some strange reason returns star ratings as words, like FIVE,FOUR,THREE,TWO,ONE. As far as I can see, there's no way to just get the numerical rating, so I have to locally convert these into numbers. I went with a switch statement, but honestly whenever I see myself using switch cases I...
What the program does: I have made a program that simulates a ball in an area made of triangles and many optimizations because it's for high-performance ball path simulation (technically ball path prediction). Vec3 and Ball definitions: #[derive(Clone, Copy, Debug)] pub struct Vec3 { pub x: f32, pub y: f32, ...
I got this HW question from my freshman year at college - "Create a python function to check whether a string containing only lowercase letters has any repetition in it". So, I did it a few ways: Brute forced it by checking if a character in the string was present in the substring to the right of it using a nested for...
In my .net core hosted service console application, I am reading a database table, retrieving some values, and based on a status, I am sending emails. It is working as it is expected, I wonder if there are any improvements to make it better. So I would be glad if you can share your comments. Thanks in advance. Program....
The problem: I am working with a set of objects in Blender with per-vertex colours. Each object has only two distinct colours. For all objects in a selection, I am choosing only the brighter of those two colours, and increasing its brightness by 10%. Language: Python 3.7 About me: I am new to coding in Python, having r...
I made a general smart pointer which fixes the problems of loops between std::shared_ptr's. While use is simple, I feel that my code is inefficient and clumsy. Here it is: /* * gc.hpp * * Created on: Nov 10, 2021 * Author: lambcoder */ #ifndef GC_HPP_ #define GC_HPP_ #include <any> namespace lambcoder{ tem...
I am currently working on a Connect 4 game for a project and it works. We added support so that it can be played by 3 players instead of 2. I know there is multiple instances of repeated code or un-optimized functions or code. I would appreciate any help on that front. Regarding the 3 player connect 4 we pretty much ha...
This is a C# program that is a reference implementation, it will be used to make a C version after it is stable and bug free. The programs are supposed to simulate sensor data collection and processing nodes. One node gathers data from a sensor, then distributes the data to all the connected clients. The data gather no...
This is my first project in C and I wanted a more experienced person's insight on how I made the whole program. Just looking for feedback it works how I want it to. The Github is here. Thank you so much for the feedback! #include <stdio.h> #include <stdlib.h> #include <dirent.h> #include <regex.h> #include <string.h> ...
I know the vectors that describe two perpendicular lines, $$\mathbf{a} + \lambda\mathbf{d}$$ and $$\mathbf{b} + \mu\mathbf{d'}$$ I've written a JavaScript function to get the coordinates of the point of intersection of two such lines. It is guaranteed that they will intersect, since in my case the lines are perpendicul...
In a previous question that I asked: Get image value total, I learned to use LockBits to speed up my code execution's time. Since then I have changed my code to Ham the distance instead of just getting the total value of the image. Here is my code: private double GetImageValue(Bitmap Image, Size ImageSize) { do...
I am currently working on a problem that involves multiple producers and a single consumer through a queue object. The following list is about a few things that's special about this problem: One producer is conditional, meaning that it only produces data to the queue under certain condition. I'd like the problem to be...
This is my solution for evaluating postfix expression using a stack. It does work on multidigit numbers, the problem I was struggling with last time. Now it works completely fine. This is the stack that I'm using: class Stack: def __init__(self): self.items = [] def isEmpty(self): return se...
I am trying to use Java8 for a piece of code which I had written in Java6 and am able to achieve the result using both the version of java but I am thinking there could be more better way to write the code which I written in Java8 // Find vowels count in each given country names // return map of country name and vowel ...
This was inspired by the question Passing Programs To A Stack Machine Implemented In C++. I wanted to make it a bit smarter by adding control functions: instruction op1 op2 op3 description jmp a unconditional jump to a jgt a b c jump to c if a > b jlt a b c jump to c if a < b get a push the element at...
In my .net core console application, I am reading a mail inbox and saving excel attachments from a specific sender that has a specific subject. It is working as is expected, I wonder if there are any improvements to make it better. So I would be glad if you can share your comments. Thanks in advance. class Program ...
Main Questions: Is my runtime analysis correct? Is my approach optimal or close to it? Is there a better way and/or improvements? Objective: Write an algorithm to assign n jobs to k entities (servers, cpus, whatever) in a round robin fashion. The job that takes longest will be assign first, the shortest last. In the...
I'm a Python newbie and I made this GUI dictionary using PyDictionary module, it took me long though, I can sense that the if conditions are really unpractical and ugly, but I couldn't find a way to shorten that part of the code, any recommendations will be highly appreciated. from tkinter import * from PyDictionary im...
I have a survey response dataframe for which each survey has a code: df code item_stamp question_name question_type scorable_question subquestion_name stage products_stamp product_ID answer_name respondent_id answers_identity answer Test Code 0 006032 '173303553131045' Age group ...
I've completed this as part of an online programming course (in which code review is supposed to be done by fellow learners, but it's been a very long time and none of them have reviewed this), and here are the specifics: Prompt Use a struct to define a card as an enumerated member that is its suit value and a short t...
I have this assignment with the goal of improving the performance and execution time of a FFT C++ code without the use of external libraries. The code is as following: void FftCalculator::ButterflyFFT(std::complex<double> *a, std::complex<double> *b, std::comple...
I use the below code to sort List<DataAccessViewModel> list. Here is the sort order : PriorityScore MName CName FName It works as expected. public int Compare(DataAccessViewModel x, DataAccessViewModel y) { if (x == null || y == null) { return 0; } return x.CompareTo(y); } public int Compare...
I know my code is ugly and unreadable. I originally had the game working without class functions but when I had to implement class function it all went downhill. TennisMaster.py import random import time import pygame import Menu from RunningGame import * class TennisMaster(RunningGame): def __init__(self): ...
This logic checks different method and adds links to response that is returned to a view. I there a better way to do this ? [HttpGet] [StandaloneResponseFilter] public JsonResult GetMenuLinkList() { List<FlyoutMenuLinkItem> response = new List<FlyoutMenuLinkItem>(); try ...
I have created a template class Gallery which is intended to be used as a container for objects. I used a private member of typestd::map to maintain the collection alongside other functions. This class was not intended to be used on production code but rather to help me practice design and coding skills. I tried to inc...
I finally got this working but I am concerned I am being 'too' specific in my tests, and also that I am repeating myself a significant amount. I could also combine all of the failures into a single test but that feels incorrect as I could change max to 500 and then the entire thing would fail. Namely, I am not happy wi...
I have some code that uses a lambda to enhance the functionality. For backward compatibility reasons, this lambda can take one or two arguments. To handle these cases, I now use except TypeError to differentiate in the calls: # This should work for both these cases: # l = lambda x: x+2 # l = lambda x,y: x+y try: va...
I'm experimenting with some variations of validation pattern. I've created Validator class: public class Validator<O> { private O toValidate; private ValidationResult error; private Validator(O object) { this(object, null); } private Validator(O object, ValidationResult existingError) { ...
A hiring company gave me the following challenge: We want a function which accepts a very large list of prices (pricesLst) and returns the largest possible loss a client could have made with only a buy transaction followed by a sell transaction. The largest loss is calculated as pricesLst[index2] - pricesLst[index1] w...
I have this JS ajax GET that returns menus to be used in a view. I wanted to see if there is any more way to write this method. Its a lot of code and just wanted to make sure there is no better way to do this? console.log('Processing Login ajax GetMenuLinkList') var url = "/login/GetMenuLinkList"; $.ajax({ type:...
I have to improve this code that searches for missing and duplicates values in a list: using System; using System.Collections.Generic; namespace Test { class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); int[] input = new int[] { 5, 2, 1...
I at one time used class forname newinstance but newinstance is deprecated. I wanted to be able to pass a class name as a string and be able to load a class, so I came up with: public static Object getClass(String myclass) throws ClassNotFoundException, NoSuchMethodException, InstantiationException,...
I am working with OpenSSL and writing an AES256 encryption module. My knowledge of cybersecurity is not vast and I would like to know whether there are any obvious holes I'm leaving. The intent is for the user to construct an instance of AESEncDec passing a key. With that instance, they may encrypt and decrypt files us...
I consume a RestApi with few Combine Publishers and want to visually represent ongoing progress with UIActivityIndicatorView. My current logic uses handleEvents->receiveSubscription closure to start an animation and handleEvents->receiveCancel and sink->completion to stop an animation of the activityIndicatorView. I as...
I have this code that writes the initial configuration of a simulator I'm writing to stdout. args is an instance of type struct Arguments, and all the members of said struct are used in the singular function below. I was hoping for some hints to simplify the code and get the alignment correct. I have considered using <...
Relatively new to the Design patterns, Generally my works are writing function for the needs. But now i need to implement a undo redo functionality, so i just read about the different patterns which i can use for that and found that, memento pattern is the one we can go for. So try to write the code to implement that, ...
The program is a Caesar's cipher decoder. It compiles and works ok, but in Valgrind, I receive a lot of errors and I have no idea how to solve them. I have tried with --track-origins=yes, but I still have no clue what's wrong. Example to test: xUbbemehbT, XYlloworld -> Helloworld. #include <stdio.h> #include <stdlib.h>...
I wanted to see how simple it would be to implement a stack-based interpreter in C# based on this question: Simple stack based interpreter The program works with the command line arguments which can either be a double or a function from the following table: instruction op1 op2 op3 abs a acos a acosh a ...
I'm just learning how to allow interconnected apps via Sockets, watched a tutorial last night and based on that this is what I've gotten: Server.cs Code: using System; using System.IO; using System.Net; using System.Net.Sockets; using System.Threading; namespace SocketsLiveTest { internal class Server { ...
The goal is to transpose the excel file that comes in the following form into this The code I created works properly, but I think it can be improved. I would also like to avoid using reduce to avoid importing functools. #importing the libraries import pandas as pd from functools import reduce #defining the mapping...
I have (for example) the following license plate image: And I want to segment the characters. The code I have so far consists of me using cv2.MSER to detect regions in the image. Afterwards I create bounding rectangles for each of the contours and create a dictionary according to height of the bounding boxes (characte...
I have this calculator. The user is asked to provide three numbers as well as the numeric operation they wish to perform. Based on this input, a certain case will be executed. The calculator is supposed to cover the basic arithmetic options such as + - * / as well as that "dividing or multiplying numbers are stronger a...
My assignment was to write a function that computes the value of an expression written in infix notation. We assume that we are using the four classical arithmetic operations +, -, * and / and that each binary operation is enclosed in parentheses. My stack: class Stack: def __init__(self): self._arr = list(...
I'm a Python novice. The system I'm using is called IBM Maximo Asset Management. In Maximo, we can write Python scripts that utilize Maximo's Java API/methods. So the script is technically a Jython script (Python + Java methods). I've written a scheduled Jython 2.7 script for checking an external system's web service ...
this is my first ansible playbook. it installs docker in swarm mode and automatically joins the cluster. could you guys please review my code and show me where it can be improved? - hosts: all tasks: - name: Add apt key apt_key: url: https://download.docker.com/linux/raspbian/gpg state: pres...
This code is Cholesky decomposition in numerical linear algebra. function LLT = Cholesky(A) if is_pos_def(A) == 1 disp('Cholesky Decomposition is used only for positive definite matrixes') else n = rank(A); L = zeros(rank(A)); L(1,1) = sqrt(A(1,1)); for i=2:n ...
This code converts a 3-letter English month abbreviation to its numeric equivalent (as a string). public static String numericMonth(String monthInFull) { monthInFull = monthInFull.toUpperCase(); if (monthInFull.equals("JAN")) { return "01"; } if (monthInFull.equals("FEB")) { return "02"; } if (monthInFull.equal...
After having a good experience with virtualenvwrapper built on top of the venv, I thought maybe it could be benefitial to have similar shortcuts for standard activities with git which could be time saving as opposite to typing many commands. I've given it a try like the following: Start session (sync current repository...
Hello I'm relatively new to VBA and I have this macro to VLookup information into corresponding cells in the sheet that works, the issue is that it depends on a For Loop to iterate through 10s of thousands of rows. This is taking a significant amount of time to iterate and I know I'm asking a good amount of it but I fe...
I have put together this complete runnable source code with an example set of test expressions which it parses and prints. The code requires acorn, which is a JS AST generator from a string, so it can't easily run in StackOverflow I don't think. But here is the main index.js which I would like to refactor: const acorn ...
Consider the following piece of code I wrote (a templated Linked List): package com.data_structures; public class LinkedList<NodeDataType> { public LinkedList() { super(); } class LinkedListNode<DataType> { private DataType data; LinkedListNode<DataType> nextNode; pub...
Front Matter I'm learning Scala and have not gotten used to functional programming and the language. I'm hoping a review of my naively implemented code can help me bridge my object-oriented ways to something more functional and Scala-prescribed. I've uploaded all of my code here: https://gitlab.com/-/snippets/2209023/...
I'm testing to use a fluent builder pattern for generating a pdf file using AbcPDF. I've looked at several methods of accomplishing this and I'd be very glad to get some input on what I've written so far to see if I'm going in the right direction or if there's some criticism. The idea is that I have a builder for each ...
I have to write a program in python that will take a number and print a right triangle attempting to use all numbers from 1 to that number. For example: Enter number: 10 Output: 7 8 9 10 4 5 6 2 3 1 Enter number: 6 Output: 4 5 6 2 3 1 Enter number: 20 Output: 11 12 13 14 15 7 8 9 10 4 5 6 2 3 1 For which I have writ...
JSFiddle: https://jsfiddle.net/EddTally/jsa69f7r/3/#&togetherjs=zMFpAQcRTt Those who cannot access JSFiddle: /** * Utilizes recursion to search through an item of any type (currently accepted types are object, array and string) * to find if it contains such a value. * * @param item * @param value */ functio...
I have a class Scholar which is basically a teacher in a university. I have to calculate the yearly salary of a scholar instance where the formula is 12-month salary + bonus the bonus is determined by the academic_position if the teacher is: a Professor --> bonus = 70000 an Associate Professor --> bonus = 50000 an As...
I decided to implement a solver for linear systems of equations based on the gaussian elimination and reduction to upper triangular form. The gaussian elimination is quite simple to implement but the function to go from a "gauss-eliminated" matrix (upper triangular form) to a solution is excessively complicated in my o...
I've implemented a thread pool using C++20. I'm fairly new to concurrently/multi-threaded programming and wanted to work on a project that I could learn from while also getting to know some of the new features available in C++20. To that end I've specifically made use of: std::binary_semaphore concepts std::jthread I...
Intro This is a spiritual successor to the question Stop cheating on home exams using python The details are not important, but I decided to reimplement everything using dataclasses. My script is now working, but is a bit big (around 1200 lines). So in order to ease the burden I will split my codereview into a few ques...
This is my code to extract data from the DOL website for a project I'm doing for my portfolio. The code does extract all of the data that I need, however it runs really slowly. I think it took like 15 minutes for it to finish extracting everything. I would really appreciate if someone could just point me in the right d...
Although I have long experience of other languages, I've not used C until playing around with microcontrollers using the Arduino IDE. I'm a bit uncomfortable with my use of pointers in conjunction with C strings. Since this is a microcontroller project, I want to avoid the String class and try to write code that will b...
I wrote the code below as a Kata to practice the Integration Operation Segregation Principle (IOSP, clean-code-developers.com). I would like to have some feedback on the code wrt. IOSP. I know that the code is not as efficient as it could be (mostly due to the fact that I am generating some copies of Lists), but as I s...
While playing with a VBA project involving Windows APIs, I have noticed some odd behavior: API calls under Excel 2016/VBA7/x64 appeared to be much slower than under Excel 2002/VBA6/x32. Since I wanted to follow the recipe described in the Weak Reference post, I decided to look into this performance matter more closely...
I just joined here. I have been doing python for a couple of weeks and I would like for some experienced programmers to review my code. I made this for a school project and I am proud of it. The code below works well but I would like to know what things I can improve on. Thank you for taking the time to review this. ma...
I have implemented generic doubly linked list in C language in which you can store any data type you want. Just like in C++ and Java, where a list can store any data type, like - string, int, long, structure, etc., you can do the same using this program. Can someone please review the code. The code is below: generic_d...
I have a simple project that I built that protects the routes/pages of the website by using the if and else statement and putting each page with a function withAuth(), but I'm not sure if that is the best way to protect routes with nextjs, and I noticed that there is a delay in protecting the route or pages, like 2-3 s...
I'm currently learning C/C++ and I saw this question on Reddit on how to create a linked from an array and decided that would make a good exercise for learning the absolute basics of C, so without looking at the answers I wrote this. Anyways, preamble aside, here's the code: #include <stdio.h> #include <stdlib.h> #incl...
Could you please have a look at our naive bayes model. We look at a corpus of emails where an email is either spam or not. To classifiy we naively assume a bag of words and estimate prior probabilities through maximum likelihood. The model defintion can be found here: Specifically we are interested to understand if: U...
Edit: A new and improved version can be found in this question, based on the feedback! I needed to pass a const reference to part of a std::vector without copy. Some research, particularly this SO question, suggested that it is not something supported by default, so I created my own code for it: #include <iterator> #i...
Given 2 values and an array, I must return the minimal distance between the indices of both values, as efficiently as I can in terms of run time and space. This is my solution: public static int minDist (int[] a, int x, int y) { int index_one = a[0]; int index_two = a[0]; for(int i = 0 ; i < a.length ; i++) ...
There are many template engines but my question is: Why do they still exist? Can we not achieve the same job with readily available JavaScript Template Literals? So influenced from this blogpost, I have come up with something as follows. Do you think this is reasonable in daily JavaScript? The following code is pure Ja...
/// #include <stdio.h> void ConvertNumberToBinary(int Number, int *Array) { for(int I = 0; I < 32; ++I) { int ZeroOrOne = Number%2; if(ZeroOrOne < 0) { ZeroOrOne = 1; } *(Array + I) = ZeroOrOne; Number = (Number >> 1); } } int ma...
The feature Here is a Grid class representing a 2d grid. The class will get templated once it reach a satisfactory state. At this time the cells are int values. This Grid class allow for iteration by rows using simple range-for syntax. Grid grid(8, 8); for (auto&& row_it : grid.Rows()) { for (auto&...
At the moment, it is simply massive. I already reduced the size by about a hundred lines but it still seems way too big... Would appreciate some help :) using System; class Program { static int turns = 1; static int player = 2; static char[] board = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }; stat...
I need to handle different states of a complex GUI control (such as NORMAL, DRAGGING, MARKING, ...). I came upon this idea: void dispatch(auto const i, auto&& ...f) noexcept(noexcept((f(), ...))) { std::underlying_type<std::remove_const_t<decltype(i)>> j{}; ((j++ == i ? (f(), 0) : 0), ...); } There would be an ...
This is a simple Python 3 program that verifies whether a string is a valid IPv6 address or not, parses IPv6 address to its hexadecimal and decimal values, and converts an integer to IPv6 format. I am writing a webscraper, and to reduce network IO bound time complexity I need to programmatically lookup DNS records of t...