instruction
stringlengths
71
95.1k
I have this program that takes two strings from the user, stores them in mixArray, then "mixes" them with mixItUp() and outputs a bit of flavor text, depending on the combination. Duplicate combinations (red-blue, blue-red) also give the same outcome. I've gotten to a nested switch statement that's miles shorter than m...
I am new to stackoverflow and a newbie to VBA coding. At my work, we are supplied with shipment data in the form of Ms Word which is not very useful. I have found a way to transfer the data using VBA and have a code that is fully functional. However, the data set contains hundreds of thousands of records. I tried runni...
(I hope this isn't too general a question given I'm just pasting a bunch of code in, if that's the case then sorry) edited to remove the bit that wasn't working I've written a brute force implementation of the N-body simulation in Python with a leapfrog integration method (using numpy & numba's jit function to speed it...
I built a tree in Haskell where every node has a number that is unique in its path from root to leaf. Nodes have a dedicated list for children that are leaves. Because the tree is very large I want to unify (i.e. keep the right one, replace the left one with a link) sub trees that are equal by some metric. For this and...
I was playing the game Set online, and thought it would be a good exercise to write an F# script to find all of the sets for me. The rules of set are as follows: A SET is 3 cards for which each feature is either common across all 3 cards or is different on each card. The object is to find all the SETs among the cards....
I am generating co-occurrence matrix (2000X2000) in Python. Vocab is a list of the 2000 top words in corpus. It does not contain all words in corpus. Corpus is a Pandas dataframe of 30000 (rows) sentences. An example of a single row in the corpus: the energy classroom high the room filled scholars eager learn they em...
I wrote a simple wrapper for the <random> header, as follows: #include <random> namespace Random { static int getInt(int min, int max) { std::random_device rd; std::mt19937 gen(rd()); std::uniform_int_distribution<> distribution(min, max); int rnd = distribution(gen); ...
I have written the following code for doing a reverse dns lookup. I'm not sure if there are any errors in it. Please have a look: #include <stdio.h> //for printf() #include <stdlib.h> //for exit() #include <arpa/inet.h> //for inet_pton() #include <netdb.h> // for NI_MAXHOST, getnameinfo() and gai_strerror() #include <e...
I am trying to create a word-finder game. There will be an n-by-n Board filled with Tiles. class Tile: empty = None def __init__(self, letter): self.letter = letter #the dictionary tracks the Tiles that border a given Tile self.directionals = {'n':Tile.empty, 's':Tile.empty, 'w':Tile.e...
This is the backend code for the page where you upload a post. I have already tried to do a sql attack on this page, but it didn't work. <?php include_once 'includes1/dbh.inc.php'; session_start(); //*skåd ifall man är inloggad *// if (isset($_POST['topic_submit'])) { $newFileName = "annons"; //Här ska egentligen v...
There is no facility in TcpListener (or for that matter Socket) to close a listening socket that is waiting for a connection without throwing an exception. After running up a test bench with 8 threads opening/closing/connecting thousands of times and reviewing the .Net source I found three different exceptions out of ...
I'm in the process of learning both Rust and algorithms after primarily focusing on web development. As such I've had a go at implementing merge sort both iteratively and recursively. I've looked for various implementations in Rust online and found them either to be quite complex, quite specific (for types/use-cases) o...
EDID: Thank you very much for your feedback. I updated the code and opened a new post for the updated version. See here. This post is loosely based on A multi-threaded Producer Consumer with C++11. I would like to implement producer consumer pattern, where a consumer consumes data from multiple producers. The idea is t...
I have a small WPF program built using Caliburn.Micro which checks Active Directory for a user with the current username of the logged-on user. I have a Bootstrapper method: protected async override void OnStartup(object sender, StartupEventArgs e) { await ShellViewModel.CollectFullnameAsync(); DisplayRootViewF...
I am writing a finance library with the intention to have the best of Golang's performance. The function Re calculates the returns of a float list, and function Sum calculates the sum of float list. //Calculate returns func Re(data []float64) []float64 { re_ := make([]float64, len(data)) for i := 1; i < len(d...
The task is to store the newest ~100 numbers and calculate their sum. I would like to optimize for time-performance. Usage: In the context of sequence alignment, after creating a 2D scoring-matrix between 2 sequences, starting at the bottom right corner, I want to search for the optimal alignment path. Here I adapt pre...
I am trying to improve working code seeing if there was any potential issues or performance problems. This code will connect to an ftp server and upload a file. public SendFiles(string demoFileLocation, string liveFileLocation, string fileName, string username, string password) { ResultStatus resul...
I have a lot of compressed csv files in a directory. I want to read all those files in a single dataframe. This is what I have done till now: df = pd.DataFrame(columns=col_names) for filename in os.listdir(path): with gzip.open(path+"/"+filename, 'rb') as f: temp = pd.read_csv(f, names=col_names) df = d...
I had an exercise to solve, written in German. I try to translate it: Write a program that takes an amount of seconds. The program than has to output the number of years, days, hours and seconds. My Solution public class Main { public static void main(String[] args) { final int HOUR_IN_SECONDS = 60 * 60; fi...
I had a test for a Java-position where they asked me to manipulate JSON-data from an API. Once my overall parsing of the data into Maps were done. The test required me among other things to implement: Parameter for sorting the data (ASC, DESC) in Maps. Parameter for filtering the selection of names in Maps. Parameter...
I am writing a program for vacation in a company and the time that is allowed to be in a specific holiday I used an Abstract class with an abstract method: public abstract class Abstract : TimeLength { public AbstractTest(string employeeCode, string employee, string typeOfHoliday, DateTime startDate, DateTime endDa...
I have joined the Facebook interview recently. And the following question has been asked on the coding interview. Given a sequence of numbers and a total target, return whether there exists a continuous sub-sequence that sums up to target. [1, 3, 1, 4, 23], 8 : True (because 3 + 1 + 4 = 8) [1, 3, 1, 4, 23], 7 : False ...
I've created a basic implementation of ECIES (Elliptic Curve Integrated Encryption Scheme) based on http://www.secg.org/sec1-v2.pdf section 5.1. /// <summary> /// Simple implementation of ECIES (Elliptic Curve Integrated Encryption Scheme) based on http://www.secg.org/sec1-v2.pdf, section 5.1 /// The KDF, cipher and HM...
I would like to build a common helper for my application that will manage all the amqplib calls from all of my nodeJS microservices. I would like to import my amqplibHelper to every microservice and use only my helper commands that they will call internally to the amqplib node.js library so I will be able to use differ...
I am using the TPL library to parallelize a 2D grid operation. I have extracted a simple example from my actual code to illustrate what I am doing. I am getting the desired results I want and my computation times are sped up by the number of processors on my laptop (12). I would love to get some advice or opinions on m...
Yes, I know we have a lot of these. I'm new to Clojure, but not to lisps. After the recent (javascript?) parentheses-balancing Q, I decided to do an implementation in Clojure for practice with the language. (It also happened to make a nice accompaniment to my rant about students learning what is and isn't possible with...
Folding in vim has bugged me for a while. What I intuitively want is for the details to be folded, but the overall structure of a file to remain unfolded. This way I can navigate around a file to see the structure quickly, and open folded sections when I need to dive into the details. What I have been doing before toda...
I have solved the MinRouterPeripherality task in codility using javascript using Breadth First Search(BFS) approach. However time complexity is O(N^2). I am really struggling to make performance improvement necessary so I can get the time complexity to possibly O(N) or close to it Task: https://app.codility.com/progra...
I'm very new to Rust and as I've been going through the book I became very interested in its macros. To better understand them I tried to write something of a usable list comprehension like those in Haskell and Python. I've asked and had answered a question on SO in the process: Rust macro error: local ambiguity: multi...
Is it possible to automate the array inside the while loop and automatically assign the key name based on the row so I don't have to spell out each one? $stmt = $conn->prepare("SELECT * FROM tickets_info WHERE ticket = ?"); $stmt->execute(array($_POST['ticket'])); if ($stmt->rowCount()) { while ($row = $stmt->fet...
Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list. Example: given words = ["practice","makes","perfect","coding","makes"] Input: word1 = "coding", word2 = "practice" Output: 3 We assume word1 does not equal to word2, and both are in the list. Lis...
Mainly used Stack Overflow, so first time over here for a code review. I am trying to make some enhancements to a legacy application. I have some minor experience using Laravel, but this application is using quite a heavy procedural approach, and I am struggling to work out the best way to structure thing in an OO sens...
My custom Logger class works just fine. However, the class is not intended for making instances of. Because there is really no reason to make instances of my class, or so I think. Any constructive criticism? Is this considered good "design"? I have a feeling that I shouldn't open and close my file for each method call...
I have recently finished a "django for beginners" book that ended with creating a small articles site. The last chapter adds a Comment model which is linked to Article model. However the comments are just created in the admin page. As a continuation of the book I wanted to test what I have learned and add the ability t...
I have this code that works, but I'm sure that it can be done better, any suggestions? Dictionary<string, StrainGroupings> GetOperationStrainGroupings(string locale) { var result = new Dictionary<string, StrainGroupings>(); try { Open(); setDatabaseTables(); ...
This is assignment from codesignal: Given a sequence of integers as an array, determine whether it is possible to obtain a strictly increasing sequence by removing no more than one element from the array. fn almostIncreasingSequence(sequence: Vec<i32>) -> bool { if sequence.len() == 2 || sequence.len() ==...
I have write a normal programm "Transpose the matrix" in go. Suppose input are always correct. I also read the article An Efficient Matrix Transpose in CUDA C/C++. So I keen to know how I can use Go-routines or another efficient way to problem in go way package main import ( "fmt" ) func main() { a := [][...
I am new to COM programming in C++ and while this code works welcome suggestions to improve readability/reliability. This creates a blank word document and adds the text Hello, World. // The Microsoft Office Object type library (mso.dll) #import "libid:2DF8D04C-5BFA-101B-BDE5-00AA0044DE52" raw_interfaces_only, name...
This time I wanted to make a board game that is very popular in Brazil, it's called 'resta um', it means 'there's only one left'. The idea of the game is that there are holes in which there are pieces inside, the player has to pick pieces and 'jump' one another until there is only one left on the board. For a move to b...
This object structure, that I think might be useful for a number of projects, attempts to: learn the use objects (classes are not available in Google Apps Script) and inheritance minimize calls to the Spreadsheet Service by summoning a data table once per sheet use the Named Ranges on the spreadsheet to access the dat...
I wrote the following class for a connect four game in C# using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConnectFour { class Board { private string _moves = ""; // stores the moves. This helps in...
My job for now is to teach a trainee how to program. I told him to solve the following task, given by a book (I try to translate it): Write a program for compound interest calculation. The user has to enter the amount of money, the years, and the interest rate. The program should look like this: Money in Euro: 100...
As it is now the end of my semester for my programming class, we had a final test were we were supposed to make a short hangman game. I have since added some small improvements, such as showing the word when you lose and dynamic difficulty. import random def word_loader(): """Loads a random word from the word lis...
I am working on a system and I can see myself using repetitive code that does not look right. I want to clean up my code but I don't really know many ways to do so. I have 2 methods (store and update). They both look like this store public function store(Request $request) { $user = Auth::user(); $v...
In a project, we have a file that contains something like a script which we need to parse. At the moment the validation is tough since we have an array of functions returing variable and taking variableList (basically std::variant<>and vector of variants, see definition below) I am trying to have function metadata avai...
This encryption class RSA encrypts an AES key and then when the encrypt method is called it decrypts the AES key and uses the key to encrypt the message and basically the same thing with the decryption. However I am very very new to cryptography so I do not know if this is considered "good" or if this could be improved...
I have a dictionary with author names as keys and values of None. I want to use fuzzywuzzy to compare these author names to see if there are similar ones that I can combine. So far I am using two dictionaries (they have the same data in both of them, and ideally I would just use one) and then using a double for loop. I...
I have written a function/script to simulate data for sample size estimation. The following code samples from a vector of generated values with varying numbers of sample sizes and then concatenates means and standard deviations for a number of simulations. I am using nested loops but would like to vectorize the code fo...
So I am working with Terraform and I feel like there must be a faster or, at the very least, a prettier way to perform the operation I'm attempting. For some boilerplate, I have a data block that looks like the following: data "aws_subnet_ids" "lambda_subnet_ids" { count = length(var.lambda_subnet_tags) vpc_id = ....
I have written a python 2 program for a school project to convert from hexadecimal to decimal without using built-in functions and vice versa in python. I would like to know how I can make my code more concise - specifically, the "d_func" function. d_dict = {"0" : 0, "1" : 1, "2" : 2, "3" : 3, "4" : 4, "5" : 5, "6" : ...
Normally I code in Java but have recently been trying to teach myself C for a university course I will be taking next semester. (I'm about to enter my third year). I wouldn't consider myself the best programmer, or even a good one. Now, I was just wondering if anyone would be able to take a quick look through my attem...
I'm new to C programming but this is my attempt at a Scene/State machine. I haven't had a code review before so I'm guessing this is gonna hurt :D § Preliminary SceneFSM manages Scenes, one Scene "active" at a time. A Scene is just a C file with method definitions; Each scene may (or may not) contain three methods; St...
I am trying to sort vectors based on a reference vector. First I am getting the indexes for the reference vector and then using that I am doing inplace sorting for the rest of the vectors. #include <vector> #include <cassert> #include <iostream> #include <algorithm> using iter = std::vector<int>::iterator; using order...
This query executes very slowly and I wonder if it can be improved? We have an Access database split to front end / back end with around 50 users. BE is in a network folder and FE is on users' hard drives. Data entered into the FE is stored in FE tables until the user has finished inputting all the required data for ...
I'm the creator of the plugin Prettier Pug Plugin. Everything works fine and I have a lot of tests because I used TDD I currently have a large index.ts (permalink). In this file mainly an array of tokens is iterated in the parse function and each token is specifically treated in a huge switch case. Please report anythi...
I have this code working but its using IndexOf I am not sure if that is the best or only option for search for a string value. What I have is a list that will need to remove a world from the child name if it is the same as the name. Is this the best way to complete this task? namespace DupName { public class Prog...
I wrote the following snipet code within Cumulocity platform. runForTenant must be in a separate thread. What is your an opinion about my code. is there any need for optimization? Thanks LinkedList<CompletableFuture<Void>> asyncThreads = new LinkedList<CompletableFuture<Void>>(); CompletableFuture<Iterable<M...
I tried to write a small header-only library that provides a type similar to iterators for std::tuple as well as some STL-like algorithms. I would be grateful for your comments and suggestions. Code on GitHub: https://github.com/Nicholas42/Cpp-Bits-and-Pieces/tree/master/tup_iter // tup_iter.hpp #ifndef TUP_ITER_HPP #d...
I've made a HTTP client and would like some tips to improve my code, it's supposed to be built for xamarin forms but should work with any implementation. My goal of this project was to learn more about HTTP client and also create a project that I can just copy the class into any new project where I need web access, eve...
Write a program that creates a linked list of bunny objects. Each bunny object must have Sex: Male, Female (random at creation 50/50) color: white, brown, black, spotted age : 0-10 (years old) Name : randomly chosen at creation from a list of bunny names. radioactive_mutant_vampire_bunny: true/false (decid...
I'm learning algorithm and this is my implementation of quick sort, please guide how can i improve it further and what are other more optimal ways to implement quick sort? def quick_sort(arr): length = len(arr) if length <= 1: return arr else: pivot = arr.pop() items_greater = [] i...
How can I vectorize this function? It takes an array of array of tuples as input and computes the distance between elements using Levenshtein's method. I found some simpler examples but they weren't of much use for me since I couldn't apply the same logic for my problem. Any help with making this code more efficient wi...
I am trying to improve my skills and I'd like to work on avoiding bad practices and mistakes. Can anyone skim over my code and point out what should have been implemented more efficiently or in a more compact way? I am a newbie to RXJS and I would appreciate if you give some hint on organizing the code (pipes, eventL...
I have created a wrapper for Fetch to send requests to my API. The module exports api, and requests can be made with: api.get({ url: '/users' }) or api.post({ url: '/users', data: {id: 1, name: myName} }) After receiving the HTTP response from fetch I do some additional tasks, like update a token, then extract the J...
I build a C# Rest Client library / framework. I noticed that it seemed to be significantly faster than RestSharp for GET at least. So, I decided to put together some benchmarks comparing it to other clients. I'm a bit new to bench-marking, but I don't want to get hung up on best practice. I'd just like to know, Have...
I’m using Python IDE 3. My goal is this: If I have a string of text, ‘ABCDEFGHIJKL’, I want to sort it into groups, like three groups (‘ADGJ’,’BEHK’,’CFIL’). I require input for this, but the prompts aren’t showing up and I can’t type in input. Here’s my code: #data code_text = input('Text: ').lower() code_skip = int(i...
So I have a view which shows recent 5 staff users and 5 customers for a restaurant app. I am storing this in user default. I am also managing the currently selected object. Here is my class. //---------------------------------------------------------------------------------------- //------------------------------------...
I want to be able to log the time spent by a certain Web API action in an ASP.NET Core 3.x application. This is a very old question from ASP.NET which relies on global action filters, but in ASP.NET Core, I think middlewares are more appropriate. From a client's perspective I want to measure as accurately as possible ...
Looking for code review, suggestions for improvement, best practices etc. Given N leaves numbered from 1 to N . A caterpillar at leaf 1, jumps from leaf to leaf in multiples of Aj (Aj, 2Aj, 3Aj). j is specific to the caterpillar. Whenever a caterpillar reaches a leaf, it eats it a little bit.. You have to find out h...
This post is based on A multi-thread Producer Consumer, where a Consumer has multiple Producers (C++17). I am trying to build a Consumer that consumes data from multiple Producers in a thread-safe manner. I extended the code in such a way that it is now possible to have an n:m relationship (many Producers and many Cons...
For my package dealing with pptx-files I need to create a temporary *.pptx file, to open in PowerPoint (e.g. to export as PDF). After some research I found that tempfile.NamedTemporaryFile is broken on Windows (you could have a temporary file, or you could get a filename - but you cannot have both). So I tried to build...
I'm trying to parse a char* into an int without using atoi(). I walk through the string, check if it's a valid digit, then add that digit to my integer by multiplying by 10 and adding the digit. I am not accepting negative integers. Here's the code I'm using: #include <stdio.h> #include <stdlib.h> #include <string.h> ...
I've written a service for firebase that handles all my Firestore calls. The goal is to only read the database once on app init( load() function) and then keep a copy of the database inside local storage so that we won't be charged for unnecessary database reads every time we write to the database, this code works and ...
I have built this very simple Connection Pool in Java Using Factory pattern. My thought here was to try on 2 connection Types e.g. SQL and NoSQL. Please review and suggest if my approach is fine. I am trying my hands on Java design patterns, so your review will help me to see where I need to improve in my design proces...
Background If you buy something from our facility, you will get a box with a shipping label on it. The two main numbers it will have are a FedEx tracking number and a carton number. For cartons that are not already in a manifested or invoiced status within our warehouse management system, it is necessary to check the F...
So, as an exercise I wanted to write a dynamic array, like std::vector. I wanted to know if there are any things that could be done better or anything I did wrong. Thank you! template<typename T> class myVector { using size_type = size_t; public: void pop(void) { changeSize(--m_Used); } ...
I am currently learning Rust. To allow myself to practice, I created the following program that helps the user to practice hamming codes (the goal is for the user to use this program to be able to write the hamming code for a particular code word). I am aware of a very small algorithmic error in the program that appear...
Let's say I have 2 repository classes: public class XRepository { private XDao xDao; private LiveData<List<X>> allXs; public XRepository(Application application) { AppDatabase database = AppDatabase.getInstance(application); xDao = database.xDao(); allXs = xDao.getAllXs(); } ...
I have finished a school project recently which was a recipe manager to be implemented in C. Coming from C# I am really struggling on getting used to the programming style of C. I feel like the code is super clumsy and not really neat. They've taught us that potential errors should always be caught. This is why I came ...
I am doing a pre-cohort coursework for General Assembly and I am somewhat stuck. I have tried making several changes, but it never seems to work right. I am trying to use Career Karma to get assistance, but if you've ever worked with them, it is all dependent on how many people are online and who actually knows what th...
I do not program PHP too often. I wanted to write a dice-roller bbc code parser for my forums. What do you see that can be improved? You can see the code running live here: https://joshuad.net/misc/dice-test.php <html> <body> <p> <h2>Syntax</h2> <ul> <li><strong>Basic Rolls:</strong> NdM: Roll N dice with M sides. i.e...
I wrote a code for one of the leetcode problems but I am not satisfied. I believe I could improve it. Here is my code: class MovingAverage { Queue<Integer> myQueue; int size; /** Initialize your data structure here. */ public MovingAverage(int size) { myQueue = new LinkedList<Integer>(); ...
I need some help to understand if the code below could be refactored to something less straightforward, less repetitive and more towards any appropriate pattern. What I feel uncomfortable with in the code is the flow of repetitive tasks with the same pattern like: // Get the result from some operation (API call / or a...
I am trying to pass 2 values from a function to the class and get a result from the class. For example, if I send value "dog" I should get the result as "dog runs" as a returned result. Need help with the code. class secrets: def __init__(self,which,why): self.which=which self.why=why def mixe...
I'm toggling a state when the browser is resized: const [expanded, setExpanded] = useState(true) useEffect(() => { const listener = () => { if (document.documentElement.clientWidth > 1024) return setExpanded(false) } window.addEventListener('resize', listener) return () => window.removeEventListener('re...
I have implemented a very simple idea of HashMap, I tried to cover cases like "get, put, delete, containsKey, resize," etc in the following implementation. Please take a look and suggest improvements to my coding styles and thought processes. Interface public interface Map<K, V> { boolean isEmpty(); int size()...
this week I learned about QuickSort and used the technique to solve the Dutch National Flag problem. I would appreciate it if someone would review my code and give feedback. The Dutch national flag problem is a computer science programming problem proposed by Edsger Dijkstra. The flag of the Netherlands consists of th...
Consider my simple business requirement as follows: There is a list of talks and they need to be scheduled in tracks. Each track has a morning session starting at 9am and an afternoon session starting at 1pm ending by 4pm and a lunch break from 12pm to 1pm. Given: A list of talks - Talk.txt Python session 90min Java s...
The following test demonstrates the functionality of Time class which is supposed to be used instead of DateTime.Now. You could just read the static Time.Now property to get current UTC time. In case of unit testing though you could wrap the code under test in a using statement in the form of using(new Time(2019, 12, ...
I'm learning Rust coming from an intermediate background in Python. I've completed the first 8 chapters of the book and I wanted a project that would solidify the concepts I learned, so I made a Brainf*** interpreter designed around the things I wanted to make sure I knew. This meant that I wanted it to use structs, en...
I wrote a code that requests user input and then converts binary to bcd then back to binary using bitwise operations. While I think my code is good I want to know if there is a better way to write the code. Is there also a way to keep the code mostly the same but getting rid of the arrays for printing out the bit posit...
I wrote a function that checks what's the ratio of the number of positive, negative and null values inside an array in relation to its length. The code I wrote is the following: function plusMinus(arr) { /**first I declare 3 variables to store the positive, negative and null elements inside them*/ let numPosi...
Sock Merchant John works at a clothing store. He has a large pile of socks that he must pair by color for sale. Given an array of integers representing the color of each sock, determine how many pairs of socks with matching colors there are. For example, there are \$ n = 7\$ socks with colors \$ar = [1,2,1,2,1,3,2]\$....
I am trying to show the following results to the user All:8000 enabled:8000 disabled:0 What can I do to improve this code? $Val = explode(",", urldecode($_POST['Val'])); $table = mysqliChkData($Val[0]); $addSQL = ''; if (!empty($Val[2])) { // parrent.guid $addSQL.= " and up_cls='".mysqliChkData($Val[2])."'"; } ...
I have a set of 2d vertices (x,y) and a set of triangles referring to the vertices' index (p1,p2,p3). The vertices represent a closed polygon shape, however those are not in order. When 'merging' all the triangles together, we get a the area of the desired polygon (from which we can conclude the contour). I've manage t...
Looking for some advice on whether or not this can be improved in terms of efficiency and speed, it would need to work on large data sets. public class Anagrams { public static boolean isAnagram(String str1, String str2) { String s1 = str1.replaceAll("\\s", ""); String s2 = str2.replaceAll("\\s", ""); ...
The algorithm: Place seed at the center of the canvas. Release a random walker from the edge. Random walker sticks to the neighboring sites of the seed/previous points. Repeat N(particles) times. For a 500x500 matrix with 50k iterations, it would easily take one full day to compute. How to reduce the computation time...
I have a method in Laravel controller. How can I improve this code? How can I implement single responsibilty here or maybe there are some other tips I can use in this code? I know that controller methods should be kept as small as possible,but I don't know if it's better idea to split this code in separate methods. pub...
I'm mainly working with Java and Gradle, but for my current project I have to use C++ with CMake and thus I would like to have some feedback on my current folder structure and project setup. root_project |─── .gitignore |─── CMakeLists.txt |─── build |─── src | | |─── [...].hpp | └─── [...].cpp ...
I cannot figure out how I am supposed to unit test the implementation of GetFilteredEntites(IEnumerable<MyEntity> myEntities). public class MyEntity { public int Rank { get; set; } public int Points { get; set; } } public interface IMyMethodClass { ICollection<MyEntity> RemoveBadRanking(IEnumerable<MyEntit...