instruction
stringlengths
71
95.1k
My function is a solution to the Knight's Travails problem. It receives start and end point coordinates on a chess board, and must return the shortest path from start to end. class Node{ constructor(coordinates){ this.value=coordinates this.possibleMoves=[] } } class Tree{ constructor(star...
Problem statement: Write a program that converts all given temperatures from a given input temperature scale to a given output temperature scale. The temperature scales to be supported are Kelvin, Celsius, Fahrenheit, Rankine, Delisle, Newton, Rømer, Réaumur. Synopsis: tempconv INPUT_SCALE OUTPUT_SCALE [TEMPERATURE]......
I'd love to get feedback on how to write this in a more expressive way. It works, but style-wise it's not especially thrilling in my opinion. I'm inserting into three lists (all_results, all_titles and all_field_order). Seems kind of cumbersome, but I can't quite wrap my mind around how to write this piece cleaner. Con...
Problem statement: Write a program that converts all given temperatures from a given input temperature scale to a given output temperature scale. The temperature scales to be supported are Kelvin, Celsius, Fahrenheit, Rankine, Delisle, Newton, Rømer, Réaumur. Synopsis: tempconv INPUT_SCALE OUTPUT_SCALE [TEMPERATURE]......
Problem statement: Write a program that converts all given temperatures from a given input temperature scale to a given output temperature scale. The temperature scales to be supported are Kelvin, Celsius, Fahrenheit, Rankine, Delisle, Newton, Rømer, Réaumur. Synopsis: tempconv INPUT_SCALE OUTPUT_SCALE [TEMPERATURE]......
Problem statement: Write a program that converts all given temperatures from a given input temperature scale to a given output temperature scale. The temperature scales to be supported are Kelvin, Celsius, Fahrenheit, Rankine, Delisle, Newton, Rømer, Réaumur. Synopsis: tempconv INPUT_SCALE OUTPUT_SCALE [TEMPERATURE]......
Problem statement: Write a program that converts all given temperatures from a given input temperature scale to a given output temperature scale. The temperature scales to be supported are Kelvin, Celsius, Fahrenheit, Rankine, Delisle, Newton, Rømer, Réaumur. Synopsis: tempconv INPUT_SCALE OUTPUT_SCALE [TEMPERATURE]......
Problem statement: Write a program that converts all given temperatures from a given input temperature scale to a given output temperature scale. The temperature scales to be supported are Kelvin, Celsius, Fahrenheit, Rankine, Delisle, Newton, Rømer, Réaumur. Synopsis: tempconv INPUT_SCALE OUTPUT_SCALE [TEMPERATURE]......
Problem statement: Write a program that converts all given temperatures from a given input temperature scale to a given output temperature scale. The temperature scales to be supported are Kelvin, Celsius, Fahrenheit, Rankine, Delisle, Newton, Rømer, Réaumur. Synopsis: tempconv INPUT_SCALE OUTPUT_SCALE [TEMPERATURE]......
Problem statement: Write a program that converts all given temperatures from a given input temperature scale to a given output temperature scale. The temperature scales to be supported are Kelvin, Celsius, Fahrenheit, Rankine, Delisle, Newton, Rømer, Réaumur. Synopsis: tempconv INPUT_SCALE OUTPUT_SCALE [TEMPERATURE]......
It's a very simple class to get a different proxy each time it's called. I've done it because I was trying to use aiohttp_scraper and it didn't work so I have to make my own. This is just one of the pieces. class Proxies: def __init__(self): self.proxies = self.download_proxies() self.proxy_pool = i...
I have made a Java Swing application that detects and displays audio pitch and level from an input (e.g microphone). I would like feedback on the current structure of my project, I'm attempting to follow the modified MVC pattern found here, diagram of my project below: I'm seeking feedback on the structure and any oth...
Can I code this Simple Calculator in a more efficient way? I'm currently self-taught, one thing I notice is that I get an error if I don't press the space bar after each entry, is there a way to avoid that error? x,y,z = input(" Enter Your Math Problem ").split() x = int(x) y = str(y) z = int(z) if y == "+": answ...
SQL Server 2017 The table contains duplicate contracts per factory with different From and To dates. I'd like to select the correct row based on a declared YearMonth parameter. If this falls in the range between From and To date this row should be selected otherwise the fallback row with the default date 199401 should ...
When creating a new Blazor project, there is a page called FetchData which gives an example of a razor page using a service to pull data to a page. I set myself a challenge to improve on the service, so that instead of a random label being assigned to a temperature for a forecast, it separates the label categories even...
This is my first attempt at writing a "large program", and I think that I've got the foundations for the emulator down. However, as I'm still a beginner, I might have made some questionable design choices (too many functions/too verbose/inefficient and so on), so I'd like to know if I can make the code more readable a...
I am cleaning a dataset where columns lat and long are presenting some values multiplied by 10. Not only 10, but changing 10^n. I wrote the code below. I am not sure if it is the best way, but is working. May you help me? I will put this code inside a function, so do not bother you creating a function at all. I just ne...
I want to transform this dict to CSV: { "California": ["San Fransisco", "Los Angeles","Oakland"], "Texas": ["Dallas", "Houston", "Austin"], "Florida": ["Miami", "Tampa"], ... } I want the following output: California,San Fransisco California,Los Angeles California,Oakland Texas,Dallas Texas,Houston Texas,Austi...
I scripted a program in python to generate lottery numbers for user. There are two playing methods: Lotto6aus49: User can choose any 6 numbers out of 49. Eurojackpot: User can choose 5 numbers out of 50 and 2 numbers out of 12. The script will generate some random numbers with above condition and generate a text file...
This is a follow up to ReversibleList: a list that is "reversed" in O(1) time [1]. Thanks for the suggestions! Any suggestions for improvements are welcome! A ReversibleList, a, behaves like a normal list when a.reversed == False. a.reverse() "reverses" the list in O(1) -- the list is not actually reversed. What's actu...
I wrote a code to reset user password. I just want to ask if it is a good and secure way to do this? Can I make any improvements here? I use send_password_resetting_message function to send an email with a link to reset password and when I go on this page I use there set_new_password to set new password using uidb64, t...
This thread is a continue version of Find match words based on a list of words where I now have added Good word dictionary. What I am trying achieve here is that I want to check if a user has a given sentence of e.g. "hello world" - Then we want to see if the sentence contains good word and NOT any bad word. If that's ...
I am practicing designing OOP projects. And this is my first OOP design. I need some reviews for the code and the design please. Here is what they call UML. The code. import java.util.HashMap; public class Library { private static HashMap<Book, Boolean> store = new HashMap<Book, Boolean>(); public static Hash...
Question Link. Binary Search and Two Pointers related question. For the above-mentioned question, In other people's solutions, people get AC with a binary search solution. However, I get TLE with Binary Search Solution. There might be some error in implementation and there aren't any Wrong Answers, so I can't figure o...
Problem: Stacks can be used to check whether the given expression has balanced symbols. This algorithm is very useful in compilers. Each time the parser reads one character at a time. If the character is an opening delimiter such as (, {, or [- then it is written to the stack. When a closing delimiter is encountered li...
I just started learning Rust, and try to implement a function like Django's get_or_create. Now my implementation looks too verbose[ I hope that rust can be neater. Therefore, how can I implement this function in less verbose way? There is probably a way to shorten nested match constructions below? use log::warn; use d...
I have designed a class bunji::Tensor which is a multi-dimensional array. I have designed it to have a similar interface to a multi-dimensional std::vector, just that the bunji::Tensor constructor takes in an std::vector in its constructor which defines the dimensions, i.e. bunji::Tensor<double, 3> my_tensor({10, 4, 2}...
I made a simple Patience/Solitaire card game. The cards don't use images but JLabels and JPanels. The game is finished when all cards are on their suit piles. Card movement: mousePressed : card -> TOP (suit pile). mouseDragged : card(s) -> COLUMN. I would like some feedback on my code. package patience; import java....
Intro Having spent quite a bit of time learning Python, I thought it was time to work on something. However, an Google search for "python projects 2022" came up with projects I had already completed. Looking through my projects, however, I came across this. (link). I decided to test my abilities and rewrote the code. P...
For almost the past year, I have been working on a pixel art editor for Android. My pixel art editor was relying on an external library for its color picker. For 0.2.0, I wanted to change this by working on my own color picker. This was quite a challenging task, but I got it done in the end. Here were my objectives for...
Please look at the Java Stream methods in the for each loop. This method totals the score for when the your desired team is playing during the football season - input param teamKey - it is either team1 or team2 I extract score1 or score2, which I total from the Json. The Season object contains, collections of collectio...
MY CODE: import time import math import sys def sums(n): r = 0 while n: r, n = r + n % 10, n // 10 return r def f(n): r=0 s1=0 while n: r, n = n % 10, n // 10 s1=s1+math.factorial(int(r)) return s1 def sf(n): return sums(f(n)) def g(i): p=1 while True: ...
I have completed the Hangman game. Can somebody look at the code and see what I've done wrong? What should I add to improve it? Are there any bugs in it? import random word_list = ['sleep','window'] get_word = random.randint(0,len(word_list)-1) get_word = word_list[get_word] result = ["_"] * len(get_word) x = "_"...
I'm solving "Unknown amount of duplicates. One missing number.": In this kata, we have an unsorted sequence of consecutive numbers from a to b, such that a < b always (remember a, is the minimum, and b the maximum value). They were introduced an unknown amount of duplicates in this sequence and we know that there is a...
I've learned Python basics about two years ago and did a few personal projects, one big one that turned out to be useful in my line of work, a few small programs for my hobbies and I've also began working on this huge personal project that is currently in a state of crisis as it needs a complete reworking to fully supp...
I have a very simple API query (using GraphQL - URQL, but the client used doesn't matter) that just fetches data and displays it on the page, and I’m trying to figure out the most efficient way to make the query not re-run whenever the component re-renders (which I assume it possibly does). According to the URQL docs' ...
I am writing a function that takes an array and an integer number and returns an array of all the partitions into subarrays (so an array of arrays of subarrays). The number of subarrays is exact the integer number passed to the function. And the subarrays have to be continuous, meaning the original order of items in th...
The VisitedCollection is a collection wrapper for setting and tracking if elements were visited (removed in terms of the wrapper) I have concerns regarding: should equals and hashCode throw ConcurrentModificationException is underlying collection is changed is it ok that visiting is performed by Iterator.remove() meth...
My friend and I were trying to reproduce Figure 4(left), page 7, from the paper "Probing phase structure of black holes with Lyapunov exponents", Guo 2022. We succeeded in reproducing the result after writing a lengthy and complicated code. Here I dissect the code in steps: Step 1: Find the parametric plot for Free Ene...
Here is the plan: a slab takes up 1 page and it has PGSIZE / blocksize amount of blocks the minimum blocksize is 8 bytes, otherwise the pointer to the next block will get overwritten when a block is allocated, the free block is removed from the linked list when a block is freed, it is added back to the slab's free blo...
I want to remove leading zeroes (for a big integer library I'm currently making) in numbers represented as char arrays. I chose assembly for speed, but in order to simplify making the algorithm and all, I decided to write it in C first. Here's the algorithm, written in C. void remove_leading_zeroes(char *number) { ch...
Greeting to all senior devs here. I'm trying to create a project for my small business. There are not many tutorial on how to create Reactive JWT authentication with Spring webflux. So I'm a bit scared if I make any vulnerabilities. If you could help me review this project I would be grateful. So let's get started. Sec...
I have transaction tables called MaterialRequest and MaterialRequestDetails. What I want to check my query and review that it's correct way to do this. Below are tables CREATE TABLE [dbo].[Unit]( [UnitNo] [int] IDENTITY(1,1) NOT NULL, [Unit] [nvarchar](50) NULL, CONSTRAINT [PK_Unit] PRIMARY KEY CLUSTERED ( ...
I'm trying to build a function to return an Iterator with no duplicated float values, its working, but there is a better way of handling this duplicated values? from collections import deque from collections.abc import Iterator from locale import atof def get_non_repeated_numbers(n: int) -> Iterator[float]: """ ...
Let me start by stating that I am currently in the process of learning Go and AWS CDK. What better way to learn than building a Serverless Todo API!? Using the Go AWS CDK (v2) I have built my infrastructure using the following AWS components: API Gateway (HTTP) AWS Lambda (Go) DynamoDB All code is open-source. It is ...
What do you suggest to make this code faster? This code gets all possible combinations of actions for a certain number of stocks in pairs in the format [action, volume]. One action element would be something like [[action1,volume1],[action2,volume2],[action3,volume3]] where the actions are either 0 (i.e. Sell) or 1 (i....
I wrote a code to remove the background of 8000 images but that whole code is taking approximately 8 hours to give the result. How to improve its time complexity? As I have to work on a larger dataset in the future. from rembg import remove import cv2 import glob for img in glob.glob('../images/*.jpg'): a = img.spli...
I've been working on an intrusive linked list for the past few days for a personal project and I would like to have some feedback on it. :) Personally, I would have preferred to make List and ListNode opaque. However, (I may be wrong here) that means I can only use pointers to them which would mean I have to use ListNo...
I have a linked list code in C++: #include <string> #include <iostream> using namespace std; class Node { public: string name; int age; Node *next; Node(string name, int age) { this->name = name; this->age = age; this->next = nullptr; } }; class List { private: Nod...
I am solving this problem where the function returns the number of times a pattern is found in a said string word. It could be easily solved via std::find but I wanted to implement the logic myself and see if I bring in some improvements but turns out my solution fares worst than with std::find. The solution works but ...
I have a list of binary strings where each binary string max length is 15. I need to find list of integers which is count of similar (should differ by max 1 bit position) binary strings present in the list for each of the binary strings present in the list. This is current solution with time complexity of O(N²) but get...
I have a bunch of checkboxes with a data-amount attribute containing a value (positive or negative). My goal is to generate a running total as the user checks each box, and then output this later on. My code works - just curious for feedback as using filter, map and reduce seems overkill for something like this. Thanks...
This is a continuation of Goat racing up a hill (C++ hiring take-home) . This is an interview take-home challenge that has been translated to avoid compromising the company's question. Problem statement You are a goat that needs to race up a hill. Designated waypoint rocks on the hill must each be visited in sequence (...
I was trying to implement a boolean that can be atomically flipped. The suggestion on Stack Overflow is to use an integer. This would be my implementation. #include <atomic> #include <iostream> class flippable_atomic_bool { std::atomic<int> state; public: flippable_atomic_bool() : state(0){} explicit ...
I wrote some code that will get the name and data of a node or multiple of nodes and put them in an object (seriesData) so I can use said object for a chart (renderChart). I used setTimeout() so seriesData can populate before rendering the chart. Everything works as intended. Is there a better pattern to handle this? I...
Here is an input array that contains country name, year and value. I need to group values by country and years. I use this approach that works for me, but I wonder how to optimize it: export function collect( data: any[], years: string[] = ['2020', '2021', '2022', '2023', '2024'] ) { const countries = new Map<str...
I'm coding with c++. Basically the question is about to make calculation of any product and calculate with price and quantity with our name. Anyone can simplify this coding? #include <iostream> #include <string> using namespace std; int main() { string star = "******************************************************...
Recently I implemented a python code that predicts the next number of a sequence using a difference table (a little more on the subject here) def s(d,p=0): if (len(d) > 1): return s([i[0]-i[1] for i in zip(d[1:], d[:-1])],p+d[-1]) return p+d[-1] print(s(list(map(int, input().split(","))))) This code t...
Re-posting from StackOverflow as this is a place to review code that is already working. I would like to know if there is a better way to deal with nested forEach when it comes to dealing with objects with properties that are nested arrays themselves. My object (summarized): { ..., "tx_responses": [ { ... ...
I made classes to use in generating square/rectangular shapes on a texture. import numpy as np import random class Tex_SHR: def __init__(self, resolution: set, colorGrade:str, genNum: int, genOption: int): self.resolution = resolution self.colorGrade = colorGrade #Not yet in...
I've written a small script for Zabbix to check the status of our ESXi Hosts. The request needs to be authenticated, so I went for this process: Read auth token from file If file does not exist, authenticate and store token into file Run request to get the information If I get permission denied, authenticate, stor...
I'm building a game interface that has the following user flow: The user lands on one of the game's URLs (eg. www.name.com/game1), first gets an "intro" screen, then the game screen, and finally a fail or success screen. I'm trying to figure out the most optimal way to do this. Below is the code that works just fine, b...
I have the following which works but was wondering if there's a better way. Better meaning more efficient and or more compact. The function checks a trie to see if the word is in the trie. typedef struct nodeWords { char * word; int index; struct nodeWords *left; struct nodeWords *right; } nodeWords;...
I have a list and I need to get certain elements out of it. The way I did it was to compare the second list to the first list and then append to a third list. Here is my code: l1 = ["0 = 0","1 = 1","2 = 2", "And", "Something", "Wicked", "This", "Way", "Comes", f"zero.0 = 0", f"one.0 = 1", f"two.0 = 2", ...
I'm a student working as a research assistant and wrote this script to automate density functional theory HPC tasks with SLURM. When a calculation is complete the script checks the contents of a log file for the total force, and if it's above the desired threshold it generates a new input file, file.in.new, with relaxe...
I have an abstract Badge class, every class extending this class should always correctly set the incoming name (string) and achievedAt (date) fields. There might be other classes that extend the Badge class, which will get passed different types of values in their constructor (see examples below), the most important th...
I'm posting two similar solutions for LeetCode's "All Nodes Distance K in Binary Tree". If you'd like to review, please do so. Thank you! Problem We are given a binary tree (with root node root), a target node, and an integer value K. Return a list of the values of all nodes that have a distance K from the target node...
Currently trying to learn to add in some validations, but only run 2nd validation after the 1st one is fully done and has no errors. Just want to hear reviews regarding my current logic in my data validation. 1st Validation checks for empty fields 2nd Validation (only to work after 1st validation is done) checks if va...
As is known, the .container- class in Bootstrap 4.x.x and 5-alpha has an bug in intermediate classes. To give a little more detail, The container class of Bootstrap 5 .container, .container-fluid, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl { width: 100%; padding-right: 1rem; paddin...
Follow up to this question: 10 Kinds of People Open Kattis Problem Time Limit Exceeded C++ Solves the puzzle linked in that question. I use Dijkstra algorithm to find items. The only twist is that each time I do a search I save the boundary list of the search in a Zone. On a subsequent search if my current "Zone" bumps...
I wrote this code. But it works very slowly. I'm figuring out how many times I have to run the case generator to find numbers less than or equal to inv, in this case six. I count the number of attempts until a digit <= 6 is generated. I find inv equal to 1 and repeat the loop. Until inv is 0. I will keep trying to gene...
The following is the program 3.2.6. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne: // This data type is the basis for writing Java programs that manipulate complex numbers. public class Complex { private final double re; private final double im; public Complex(double...
I am very new to Python and I am trying to learn through personnal projects and today I needed to collect a lot of baksetball player names and decided this was a good time to learn and practice. The script is able to pull out all of the players names, height, nationality and DOB but I need to enter the link to the page...
I'm building a Mozilla Firefox extension to hide link's formatting and show them as regular text. It consists of a script that runs on web-pages (content.js) that's activated by clicking on the extension (handled with background.js). On activation, a CSS rule is injected to hide link's formatting. Activating it again w...
I created the following program which takes a molecular formula as an input, eg CH3COOH and returns the molar mass of the compound: #! /usr/bin/env python3 element_weights = { 'H': 1.00794, 'He': 4.002602, 'C': 12.011, 'O': 15.999, 'Ts': 294.0, 'Og': 294.0, } def tokenize(string): position ...
So I wrote a a RESTfull api for a mongodb with python3.7, fastapi and mongoengine and id love to get feedback on how I should make my code more readable, clean, and dry. basically there are 4 main routes : Route to get all objects from a collection. Route to get one object from a collection by a specific identifier (...
I'm currently going over Robert Sedgewick Algorithms book. Here I'm implementing a Symbol Table using a Linked List. The Sequential Search Symbol table is implemented in JavaScript. The book mentiones that this Abstract Data Structure is not a good solution when dealing with big amounts of data. I would like feedback o...
I'm new to socket programming and c++. I have a the following method that sends an array to server and receives sum of the array, I tried to make it async. std::future<void> AsyncClient::ReqSum(const std::vector<double>& numbers) { return std::async( std::launch::async, [&, numbers]() { ...
For an API I have defined a "Client" struct which contains all the fields the client has in the database. When a GET request is made with the client ID the whole struct(The struct contains about 60 fields of different types) is returned with all available data. The request can be customized with a querystring "fields" ...
Today I discovered that it is possible to dynamically load code at runtime via dlopen and dlsym (and similar utilities on Windows as well). So the obvious next step was to call the compiler through system to build a piece of code into a shared object, which is then loaded to obtain a function pointer. All wrapped in a ...
I'm trying to implment memory allocator guided by this tutorial. I used a mix of Next-fit search and Segregated-list search. There are multiple slabs of different sizes (a slab is contagious blocks of memory of the same size, plus a header). If a slab ran out of free blocks, it allocates a new slab of the same size and...
My program brute-forces a password. The password is a string composed of a key and a four digit numeric code. The key is known so we are basically brute-forcing between 0000 through to 9999 An example password is: UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ 4143 I updated that script I wrote to take advantage of multiprocessing i...
This is a follow-up to Bash script to automate dev environment setup. In that question I'd thrown together a (sloppy) shell script to automatically setup my development environment. One of the answers suggested using Ansible and after a bit of reading realized it would help me with some configuration of remote servers ...
The config file for my project takes many files and directories. It would be convenient if these files and directories could reference git repositories, zip archives, possibly over https. This function converts those URLs to paths on the disk, so the rest of the project still only deals with Paths on disk. Did I handle...
Ok, a struct would actually be most convenient, but it woudl be easier on teh system to have 2 seperate arrays rather than an array of structs. #define PAIR(Str) {(Str), sizeof(Str)-1} static const struct StrStruct { const char *Str; unsigned int Len; } Packed4 DefaultStr[] = { PAIR("Error"), PAIR("An u...
So I'm parsing an object using Typescript. I am pushing a value from within the object into an array of strings. Here's the code: if (data.InstanceStatuses != undefined) if (data.InstanceStatuses[0].InstanceId != undefined) instanceIds.push(data.InstanceStatuses[0].InstanceId as string) I f...
Problem Statement : Print the first non repeating character in a string. Example : In the string somecharsjustdon'tliketorepeat, m is the first non-repeating charecter. My attempt : New Code : Old one was not working as expected so I have updated the post. Old code can be found below new code public class FirstNonRep...
I am new to programming and need input on how I could've written something better. Not coding on daily basis. The task was to write a script in python, bash or anything. So I mixed python with bash commands using python module os.systems. Some friends recommended lists but I wanted the output to be similar as the examp...
I have this function that searches for stock moves that have the same product, and if it finds them then it searches for lots in those lines, and if it finds the same lots then UserError is raised. The thing is I think this method can be rewritten in a more elegant way. Maybe someone can help me with that. def check_fo...
I am quite new in django forms. I am woking on problem where in function name generate_outage_form passed two parameters name settings and segment Now I have to make function less verbose and more robust. def generate_outage_form(settings, segment=None): form = None     datacenters = settings.get('datacenters')    ...
So, I have been recently heavily focusing on Front-End, for data validation, showing errors etc. And a big thank you to CertainPerformance for many reviews hes done for me :) I have created a Report template using handlebars and a MySQL database to store the data, using Node JS to interact between the 2. I have now gai...
I'm making a function that adds a new object to an array and removes the oldest if it has reached a specific length. Click the button in the example below. All objects are drawn until its array reaches a length of 5 when the oldest is removed. Is there a better, more processor and memory efficient way to do this instea...
tl;dr: How could you rewrite the buf_get and buf_set functions below to be most optimal? It took me a long time and a lot of head banging on the wall to get these buf_* functions to work, but they are not very elegant and I'm sure many of you can easily spot how to do these "more correctly". Basically, the uint8_* func...
So currently I have this function: function loadPath(chunkSize, dataSize, depth, index) { let path = [] let i = 0 while (i < depth) { path.unshift(index % chunkSize) index = Math.floor(index / chunkSize) i++ } return path } I would now like to pass in path as a variable from an object pool of sho...
I am learning Python. I have a scenario in my current project to benchmark the following code snippet; by using refactoring to increase the performance. Upon deployment my code will be used on a larger scale. I'm trying from my side and am also looking for suggestions/guidance from you all. Is there a way to make this ...
I'm writing spring app for storing and manipulating recipes. I wrote ShoppingList service which generates, based on UUIDs of recipes, shopping list. This is my current model for which i wrote tests and works as intended. Service uses another service called IngredientConverter which converts to response models. Now i wa...
I writing this code to leverage the advantages of Completable future. My doubt is call cancel() method after get() is correct approach? private void combineFilters(JobFilter jobFilter, CompletableFuture<List<String>> measureCompletableFuture, CompletableFuture<Li...
I have written a (relatively) generic function for interpolating values in power query (also useful for power bi and m code). I am looking for any improvements or input, but especially: speed handle more inputs correctly (more generic) documentation / readability of code (Input as table, xColumn as text, yColumn as t...
I'm a teen developer who just does this as a hobby, but I still care about good practice even if I don't fully understand it. Two of the most used phrases when sharing the code of my C# MySQL library is bundling and abstraction, First of all... do I need to reduce said phrases? If so, how can I do that? Among any other...
In order to continue improving my Python knowledge, I have implemented a naïve Bayes classifier as described in "An introduction to Information Retrieval". I would be very interested which parts could be improved, be it e.g. coding style or use of data structures. """Implementation of a naive Bayes classifier based on ...