instruction
stringlengths
71
95.1k
I have an assignment to solve this problem. There are a total of 18 test case files, 5 of which I have failed due to exceeding some time limit on the script and I am unable to verify if there are any logic errors thereafter. Question Description Mr. Muffin is an orientation group leader and sets up a simple ice brea...
The task: Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example, given [100, 4, 200, 1, 3, 2], the longest consecutive element sequence is [1, 2, 3, 4]. Return its length: 4. Your algorithm should run in O(n) complexity. My solution: const sample = [1, 100,...
I have next method in client fun authUser(loginRequest: LoginRequest): String? I need to implement next logic: check if user already exists - nothing to do, if user isn't existed - register him. I wrote next fun initTechUser() { when { client.authUser(USER_CREDENTIALS) == null -> { ...
I am looking for input on my code for a Stopwatch utility written in Java. The stopwatch uses System.nanoTime as its time source. In general it works similarly to the standard .NET version and is, as far as my unit tests go, correct. You can query it whether or not it is running, and it will give the most recent recor...
I am recreating a game that I used to play on the Nintendo DSI, 'Dragon Quest IX'. I've made a player class, but have run into a code efficiency issue. When the Player object is first instantiated, it has a constructor parameter player_class that determines what class the user has chosen. In the method setAttributes, i...
I need to filter an array of form controls to check for duplicate values. I have written the following algorithm to identify and return an array of the controls which have are duplicates. I have not seen this indexOf based approach in any of the sample duplicate checkers one finds in Google. Can anyone here spot a flaw...
Given a List<int>, the problem I am trying to solve is: Find the number of unique pairs in List<int> such that their addition is exactly equal to the input value. The bottleneck is a nested for() loop that I have used to go through the list // *** OPTIMIZE THIS LOOP *** for (int i = 0; i < intList.Count - 1; i++) { ...
I am currently working on a problem to find the best matches of data in a List namely "ListA" from another List called "ListB". Whenever I find a match of an element for "ListA" with any element in "ListB" which has a confidence and accuracy with 70% or greater I add the matched string from List B and the string in Lis...
I have one machine, which produces parts. In machine_failure_rate% it produces faulty parts which need to be produced again. Thus, we end up with a simple queuing problem. Can the following code be futher functionalized? I have the feeling, I can get rid of time_parts, but all I have in mind deteriorates the code as I ...
My concern with this code is that I am forcing execution repeatedly through the same pathway for the sake of a readability that I'm not convinced by. It's a servlet filter which detects if the authenticated user is a service account (non-human) and then does some checks on them within the if clause. import org.springf...
This script is designed to be run via windows task scheduler once per day. All callables passed to this function should only return a bool. The callables are called until either the maximum number of call attempts is reached, or until they return True. If one or more callables returns False, the program will sleep for ...
How can I improve this code ? It was quite hard to implement AJAX comment system in Symfony 3, and result is a bit of mess: Controller: <?php declare(strict_types = 1); namespace AppBundle\Controller; use AppBundle\Entity\Article; use AppBundle\Entity\ArticleCategory; use AppBundle\Entity\Comment; use AppBundle\Entity...
I have the following php function, that reads and returns data from the active directory. It is part of a project which will be graded (I'm in an apprenticeship). It is very long and I think the code would be much more readable if I broke it down to several small functions. How could I do that? private function _search...
I need: Daily save new exchange rates from the REST API in the database. Return the current exchange rate for a given currency, the whole table for a given day, the exchange rate for a given currency depending on the given currency and convert currency. The code works, but I know it should not look that way. I do not...
This java answer made me wonder whether it would be possible to implement the builder pattern in C++ in a way that checks at compile-time whether all necessary members of the constructed object are actually set before the object is constructed. This is what I came up with: struct Foo { int x_; int y_; int z...
class HashTable: ''' Only supports integers as keys right now. Values cannot be None, obviously. Every operation is theoretically most efficient. Uses probing as collision resolution strategy. ''' def __init__(self, init_size=8, load_factor_max=0.75): # A hash table entry will b...
For practice, I solved Leetcode 139. worbreak question: Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequence of one or more dictionary words. I have the solution to use the recursive with in-memory hash table to redu...
I've written a function to split a list into several lists with consecutive integers, e.g.: extract_subsequences([1,2,3,7,8,9]) [[1, 2, 3], [7, 8, 9]] extract_subsequences([1,2,3]) [[1, 2, 3]] extract_subsequences([1,2,3, 10]) [[1, 2, 3], [10]] extract_subsequences([1,2, 4,5, 8,9]) [[1, 2], [4, 5], [8, 9]] ...
I have an array of ranges as you can see in the snippet. when user select certain number from dropdown I want to remove that number from the range and return new ranges, Everything is working as per my expectation but I think, I have over coded and used too many if else statements in my code. I was wondering if there i...
An Array of N words is given. Each word consists of small letters ('a'-'z'). Our goal is to concatenate the words in such a way as to obtain a single word with longest possible substring composed of one particular letter. Find the length of such substring. Example 1: words = ["aaba", "aaaa", "bbab"] -> maxSubstring=6 o...
There have been multiple discussions on caching http-requests with RXJS. In this question/proposal I want to propose a custom rxjs-operator (non-pure) to provide caching: const cacheHttp = (cacheKey: string, cacheStorage: any) => (source: Observable<any>) => { if (!cacheStorage[cacheKey]) { cacheStorage[cacheKey]...
Want to show you part of code that I wrote to process search request. User commit search by articles (codes) of products. The goal is to allow user write his search request to textarea element in any possible way: in a row, in a column or separated by any separator (comma, space, semicolon etc.). <?php include("db.php"...
I run this code on my Heroku Node.js server in order to get CSV for few hundred rows, but it fails with R14 - Memory Quota Exceeded. It worked fine when there were less rows in DB, even without writing to file, I was able to write CSV directly to HTTP response. What can I do to solve this? var mongoose = require("mongo...
For educational purposes I implemented standard library smart pointers like class templates. They are definitely not a full replacement for the library classes but I'd like to get some comments on the way I use templates and how I can do better. I'd especially like to get criticism about the code clarity and readabilit...
I've posted this to Stack Overflow, but someone voted to close as they felt it was opinion based, so I'm bringing it over to Code Review. I have some Linq fluent chains to shape an original IEnumerable of objects into the proper form. During this process, I'd like to capture and log the reason why some objects are "rej...
So I am writing an XML parser, and I'm using regexes to do some pattern matching during parsing. However, writing longer regexes quickly became a bit boring, annoying and just confusing. So I thought to myself: "Wouldn't it be a fun little project to make a small library that helps me build these regexes?" I decided to...
Here, I am reading in a newline delimited file that can be millions of repeating lines that looks like this: TGATAGTTAGTCATATGAAAGCATCATTAGTAAACCACATTGCTTATTATATTGAACAGT TACATCTGGCTTATTATACAAAGAGAAAACCATACTATTCATACTATTCTCTTTTTGATC TTCTCAATCTTCTGTTGTTAGATATTCTATTCCTTGCTCACCATATATACTACTTATGTC etc. The goal is to count t...
I have this array of objects: const array = [ {continent: 'Africa', country:'Algeria', year:'2018', value:10}, {continent: 'Africa', country:'Algeria', year:'2017', value:15}, {continent: 'Africa', country:'Algeria', year:'2016', value:2}, {continent: 'Africa', country:'Egypt', year:'2018', value:20}, {contin...
Inspired by a shell script I saw on Github, I put together a Python version to update the dynamic IP address for a subdomain I have that uses DigitalOcean's nameservers. I added a check to see if the IP address actually needs to be updated, and not do the update if the IP address hasn't changed. All of the user-configu...
I'm trying to write/come up with an algorithm for a phone keypad traversal. Let's say I have a rook on a keypad. The rook can traverse only horizontally and vertically. My code has to input a phone number and check whether the rook is able to dial it (shouldn't go diagonally) and return a boolean based on the result. ...
I was given this question during an interview. It is similar to binary search and I would like to ask for feedback for my solution. Array Index & Element Equality Given a sorted array arr of distinct integers, write a function indexEqualsValueSearch that returns the lowest index i for which arr[i] == i. Return -1 ...
This code uploads an entire directory and allows for its reparenting on a remote server (an artifact repository). Three concerns: Copying the files locally takes a lot of space. Ideally, I could use inotify and as soon as my wget -m had a file I could begin immediately uploading and then deleting. These repositories c...
Thanks for the enormous response on my last question! I've returned with another question, hoping for more insight. I'm developing an Item class and system, and I know it can be improved. I have a main Item class, with four subclasses (Weapon, Armor, Medical, Misc) . Code Redundancy The subclasses all have near identi...
Regarding an application written in C++ using the Windows API. I'd like to store a user setting like the window position on program exit, to the Windows registry and retrieve settings like these on the next start of the program. I currently have 3 settings to be stored/retrieved to/from the registry. typedef struct tag...
I have a repetitive set of instructions that I would like to optimize. Is there a better pattern to achieve the same goal but with less repetition ? var assigned = this.state.data ? this.state.data.assigned : 1, delivered = this.state.data ? this.state.data.delivered : 1, unassigned = this.state.data ? this.state.data....
Not a long time ago, I got into Rust and I made a simple Brainfuck Interpreter. Now I want to get back to Rust and I would like some comments on my code: Just in case it's hard to read code from post: https://github.com/DimChtz/brainfuck/tree/master/rust-brainpreter lib.rs mod core; use core::parser::Parser; use core:...
I would like to have my variadic template class reviewed. First some explanation what it should do: I'm writing an application where I read in blocks of data. I know before i read in the data which formats to expect. For example: ID123.EnableValve := FALSE; ID123.Position1 := 0; ID123.Position2 := 2; ID1...
I have a batch job that contains a lot of items. I need to split these items into 4 categories - 1,2 category should be moved to a separate jobs as is; 3,4 categories job be additionally checked on validness and split into separate jobs - invalid items should be moved to a separate jobs. Roughly diagram of the expected...
I am trying to implement and train an RNN variational auto-encoder as the one explained in "Generating Sentences from a Continuous Space". Although I apply their proposed techniques to mitigate posterior collapse (or at least I think I do), my model's posterior collapses. I will provide my model implementation in PyTor...
So, I've recently started working on CodeForces to practice from older contests (and maybe even start participating in current ones), but there is one problem that I can't seem to make an efficient enough program to pass all tests. Here is my code: #include <bits/stdc++.h> using namespace std; struct food { long lo...
I recently developed a tool which automaticaly generates VBA code in order to smoothly create class templates. I wanted to share this tool with the community, hopefully this is the right place. The idea is to put the definition of your class on "paper", via an excel spreadsheet: Create a new sheet or chose an empty sp...
This arose out of the incident where it was realized that WMI could not be expected to be reliable across all various computers. The next thing I looked at was API which was positively awful to work with. Based on a suggestion, I decided to try and use tasklist. Note that efforts was made to ensure there are no disk I/...
I have implemented a very basic TODO List with no database or backend support. Though I have coded in C++ and Python before, this is my first HTML and JavaScript code. Please review the code and let me know where it can be improved. var numericalID = 1 function addNewTask() { var container = document.getElementById("...
I am working on a project to get dice probability that requires 4 decimals places. My code works great, until the dice become huge (as I use in the example below). I am wondering if there is a way to make the process less laborious. I should specify that I do already know that the choices list ending up so large is the...
Background: I'm writing C++ code after a fairly long time, so I may not be up to date on the best practices, so please bear with me. I'm only trying to improve and learn. Problem I need to write a wrapper in C++/CLI for a C++ library so that I can use it in C#. The limitation that C++/CLI managed types can only contain...
In the following code I have created the something like the behavior of inheritance and methods in C99 (without vtable). The code compiles without any warnings even with pedantic and is also Valgrind Pristine. I would like to hear about design patterns and techniques to improve code quality, readability and portability...
Kata in question Given a list of integers, return the nth smallest integer in the list. Only distinct elements should be considered when calculating the answer. n will always be positive (n > 0) If the nth small integer doesn't exist, return -1 (C++) / None (Python) / nil (Ruby) / null (JavaScript). Notes: "indexing"...
The tokenise function below splits a given string at the indicated delimiters. As with strtok, it modifies the string by adding '\0's at the end of each token. A pointer to the start of each token string is placed into the output array. #include <string.h> /* * Wrapper around strtok * * Splits a string at charact...
I have to make this: Each set consists of a number of equal objects that generate numbers from a finite set with an arbitrary probability distribution. I did make it, but it feels so long. How can I refactor the code to something better and clean looking? Also, don't mind certain variable names and callbacks. I've done...
Currently, my code works perfectly well but i would like to make it cleaner for other users by removing the duplicate and similar lines of code into functions or for loops. Because I am still new learning Python, I still did not get a hang of functions and for loops. My data frame rfm includes 5 columns: Max Date (lat...
I've created a library providing a ThreadBlock that has the following features: Aggregates results of all actions executed Provides for non-threaded warm up to prepare data for processing Provides for per-thread continuation actions Provides for per-block continuation actions The code is located on GitHub. using Syst...
I know that OOP is ubiquitous nowadays. Nonetheless I still write procedural PHP. It now seems to me that I had fallen into a spaghetti code trap, because my code starts to seem meaningless even to me (it's author :) Can you please tell me how bad is this? <?php /** * Created by PhpStorm. * User: Taras * Date: 23.01...
I'm learning Django and making my (technically second) project. The project features several apps, including player_interface and manager_interface. Here's the player_interface/models.py: from django.db import models from django.contrib.auth.models import User class PlayerProfile(models.Model): user = models.OneT...
Currently I am working on some kind of mechanism which will be able to monitor directory and when file with extension .pdf appears I need to mock some kind of processing on this file. Let's say, renaming and creating log file with the information of this processing. And as I wrote it is some kind of mock. So informatio...
Suppose, I have a data access layer class, where I want to specify database connection parameters. Usually, I do it as static variables and initialize it right after definition, e.g. see DB_NAME variable case. Performing code review, I paid attention that sometimes such logic is implemented with a static block, e.g. se...
As part of a code review I came across this isDummy(a,b)-Method and the question, whether it is more readable as a conjunction, or a disjunction: Original snippet: public static boolean isDummy(TriState a, TriState b) { return (a.is(ZERO) || b.is(ZERO)) && (a.is(NULL) || b.is(NULL)); } Suggested change: public sta...
I made a server and client API for TCP connection. It is intended to shorten the work you need to do to prepare the server and client. It's separated into 3 projects - TCPServer, TCPClient, Common. I've made an extended tcpclient type IdentifiableTcpClient, allowing for various modifications, the base additions are a N...
I tried to implement a very simple color flood fill to experiment a bit with Javascript. All comments about the code are welcome but I am especially interested in performance as it seems to be a bit slow. The browser tools only tell me that there is apparently a bunch of minor garbage collecting going on. function se...
As I'm learning Rust using the second edition of the Rust book I solved the following exercise: Using a hash map and vectors, create a text interface to allow a user to add employee names to a department in a company. For example, “Add Sally to Engineering” or “Add Amir to Sales.” Then let the user retrieve a list of ...
I'm creating a Django project where users can decide to delete their account and everything we know about them (solved riddles, votes ...). I think you can compress this code but I don't know how. I have a User related to Comment, Report, Vote, .... And I've got a Userprofile with a user relation: class UserProfile(mod...
I would like to achieve something I believe is pretty standard: A) My VB.NET client (ideally targetting Framework 4.0) sends a text string to my Apache/PHP Server via an HTTPS POST request. B) My Server responds with a Signature of that text string. Private key used by the Server is always the same, and public key used...
I am participating in a funny crypto contest with my friends. This time, we raised the bar quite a bit. The code below is my take for the constraints we set. Note that on my machine, the code works perfectly. Constraints: The message M is made of random numbers M1 is 200 bytes at most. Packet P is 1024 bytes long. At ...
Just started using PDO for my newest project. I'd like to get input on how this login script looks and if I should alter it in any way. When the user clicks the link to the index.php page, a script immediately fires and checks if the windows username exists in the users table in the DB. <?php include("include/sessions...
For learning purpose I've started creating my implementation of Conway's Game of Life. I've used numpy to store big array, contating dead and alive cells, then I've apllied Conway's rules, to create mechanics of cells life. To manage grid, and graphics I used pygame module. After many reviews, and rewriting code in man...
I am writing a program to count the number of uppercase and lowercase letters in a string. I came up with something that works, but as I am still a beginner I have a feeling writing the code this way is probably considered "clumsy." Here is what I have: stri = input("Give me a phrase:") stri_up = 0 stri_lo = 0 for i i...
I've been building a two-sided (both clients and service providers would use the app) appointment booking app. This is a screen from which a service provider can confirm their profile after having completed the fields across multiple screens previously. I have a couple of React/React Native specific questions: Is it o...
This code is part of a larger mapping library I'm working on to address some business concerns of transforming data. I was inspired by mapstruct in Java, but opted for users to annotate / add attributes to a poco to control the mapping operation. Because reflection can be an expensive operation, I opted for scanning al...
Imagine the following situation: It is the year 20XX. You are a prodigious baker, capable of baking cookies at an astonishing rate of 1 cookie per second. Your archnemesis, an equally excellent baker, challenges you to a bake-off. In this bake-off, you will need to bake 1,000 cookies total as fast as you possibly can, ...
I am currently working on a project that uses many dataframe wrangling. The intention is to write test to check that the output functions are correct. I have written a test for a dataframe function that transforms a dataframe of operations into another dataframe that contains the volumen of the operations for each of ...
I want to be able to both provide options through command line and from a configuration file. A single option could be served either by the user or by the configuration. But if is provided by both, only user input is used. Such an option could be required and an error would be output if neither user nor configuration p...
Summary: a bunch of algorithms to find if particular substring exists in the string. Meanwhile there's a lot to learn and I am looking forward to implementing more complex ones, I suppose there's some crucial insight regarding style, syntax, or design, which I might be missing. I have also managed to implement the auxi...
I'm setting up a python mqtt client that is supposed to receive messages of specific topics, process the messages when all incoming messages from the clients are complete, output the new calculated data via http request, request new data via mqtt and start from the beginning. Are there any issues regarding receiving mu...
Consider the array: original_array1[17] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17} I want to sort it in such a way that: Sum of adjacent numbers should be a perfect square You cannot reuse a number So a possible solution is: 16 9 7 2 14 11 5 4 12 13 3 6 10 15 1 8 17 I write a C++ program to get this done using a...
This is a Find unimplemented tasks task from Rosetta Code: Given the name of a language on Rosetta Code, find all tasks which are not implemented in that language. There is already a solution that uses urllib, but I decided to add another one using Requests. I've never worked with this library before and would lik...
can you review the this code for the Monty Hall simulation, mainly on the aspects of OOP and CleanCode public static void main(String[] args) { final int iterations = 10000; System.out.println("chance with change = " + getChanceForPlay(iterations, true)); System.out.println("chance without change = " + g...
I'm developing a simple Snake game in Java using Swing. So far I made the snake animation which is troubling me: when the snakes moves it seems like it starts to lag for no reason, but when I move it around with the arrow keys it goes smooth. How could I make it move smooth also when it goes on a straight line? GameFra...
I have been studying Python for a few months and just recently decided to stop avoiding OOP and reworked a Pong game to a more object oriented style. Please tell me how I should improve my code. Some of the code is an adaptation from this Stack Overflow question about menu state. There is a known problem with the MenuS...
My intention is to have a component that serves as a textbox wrapper and able to set the error state, error message, and allow the parent to pass a function that sets its local error as I did not see a way to read from the child component's state. Current known limitations: Can only pass a single value to the validati...
I'm creating a website about an auto show that the user is going to. I'm collecting input from them via textboxes, check boxes, radio buttons, etc. I'm presenting them with a confirmation that the information they entered is correct. Is the way I'm doing this the most efficient, injecting the HTML into the website via ...
There were multiple times in different applications that I needed to accomplish the following behavior with C# Task and I did it in a certain way, and would like to receive an insight whether it's the best way to achieve the desired effect, or there are other better ways. The issue is that in certain circumstances I wo...
Edit: Following answers, I modified my code, and wrote an other question. History Recently, I (stupidly) tried to make a switch on myObj.GetType(). Of course, it didn't work. Then I made an ugly (this is subjective) if ... else if ... else if ... else ... list. I ask myself if I couldn't make something to keep the swi...
Here is my voxel engine. I want some review for performance on the renderer. What can be improved? What must change? Also I'm not sure it is efficient to use vkWaitQueueIdle for syncing. The end goal would be to reproduce a cube world like game. Code : Application.h #pragma once #include <memory> #include <chrono> #i...
This might appear to be a trivial task, but I think it's not the case. My code originally looked like this: class DataSetToPdf { static byte [] F1 = Util.GetFile( "C:\PdfFiles\FreeSans.ttf" ); public static void Go( Data.DataSet ds, int ix, System.IO.Stream output ) { // Code which uses F1 } } Util.GetFile...
I've developed a toy example to investigate how async works in C#. Though I've learned a lot this week, I'm still unsure of the finer details, as this is my first C# program. Compilation was done with .Net Core 2.2. Usage The program runs in an infinite loop. Press any key to stop the program. Goal Process stream da...
I have to weekly upload a csv file to sqlserver, and I do the job using python 3. The problem is that it takes too long for the file to be uploaded (around 30 minutes), and the table has 49000 rows and 80 columns. Here is a piece of the code, where I have to transform the date format and replace quotes as well. I have ...
I mostly develop AddIns for Office. In the example of MS Word, I have an AddIn which allows to review drafting style, another AddIn which allows to monitor cross-references, another Addin which allows to import graphics from the web, etc. What the AddIns do is irrelevant here, but you should now they all work independe...
I am trying to model the proof of Immerman–Szelepcsényi Theorem with Haskell since it heavily uses non-determinism. An explanation of what the point of this is can be found here. {-# LANGUAGE FlexibleContexts #-} import Control.Monad import Control.Monad.State type NonDet a = [a] type NonDetState s a = StateT s [] a...
There is a function to convert object to the GET parameters for the ASP.Net controller. Is it possible to minimize the redundancy of the code, but not to the detriment of its readability? function getUrlPairs(obj, prefix = "") { var getTypeOf = function (obj) { if (typeof obj == "undefined") { ...
We all face questions that forget to include their code. Sometimes all of it, sometimes only parts, that make the rest of the question unfortunately incomplete and therefore off-topic. What if it was possible to remedy that behavior with a simple script? What if said script fits in a single comment, at least in a less ...
I'm using JDK 11. This is my code: public class ReferenceService { private final transient Cache<String, Reference> cache; private final transient EntityManager entityManager; public ReferenceService( Cache<String,Reference> cache, EntityManager entityManager ) { this.cache = c...
I'm currently attending ERAU (online), and in my Computing for Engineers class we are learning C#. An ongoing project throughout the class is to build a "quiz" program that asks 10 questions, in order, and then repeats missed questions (in order) on a second iteration. There are 2 types: T/F and multiple choice. 4 T/F ...
Problem Statement Calculate the exact value of the n-th Fibonacci number, say the one-billionth. Algorithm The algorithm is based on the idea that Fibonacci numbers can be represented as 2x2 matrices, in particular as powers of the matrix [ 1 1; 1 0]. Matrices of this form can be represented implicitly without having ...
You can find the "part 1" here. 1. Objectives The main goal of this post is to build a switch-like structure, which allows to use non-constant Type (e.g. Type, Drawing.Point, or any custom type). This implementation should understand three different cases: Equality case (like a regular case statement) 'Predicate' cas...
I am writing a numerical analysis library in golang for which I need to implement a polynomial struct. Here is the source code: package numerical import ( "strconv" ) type Poly struct { Coeffs []float64 } func (p *Poly) Str() string { d := p.Deg() if d == -1 { return "0" } s := "" ...
I got a coding problem to solve and was wondering if I got a commonly acceptable and efficient/clean solution. If there is a better way I'd gladly hear it. given a list with numbers return if the sum of 2 elements in the list = k def is_sum_of_2nums_in_list_k(list, k): for i in list: if k - i in list: ...
I need your opinion about my practice. I want to improve it. The requirements are the following: RESTFUL + OWIN (SelfHosted) Endpoint - Upload a file asynchronously Make a request to the endpoint from Postman Well, This is what I got For the OWIN selfhosted I followed the Microsoft Documentation OWIN Self-host Endpo...
I am trying to make a router in Rust using Rocket.rs. I'd like to devise a way to use a default router for my more simple db tables that don't require different logic, to prevent rewriting the same functions over and over and only replacing just the type of output and input it takes. struct Router<T> { router_type:...
I am a beginner Python developer and I wrote a script in Python which fetches 50 latest jobs from jobs.af (a jobs portal) API, categories them based on jobs gender and write each to a separate CSV and Excel sheet files. I want my code cleaner and more readable, so I really like to get comments on code structure and how...
I'm reading "Code Complete" by McConnel and I'm practicing using object oriented programming to "reduce complexity". (By that McConnel means, among other things, that it should be very easy to read through any given tiny part of a project and know what is happening without thinking at all about the rest of the program)...
I have rolled a simple program for controlling a sliding tile puzzle via command line. I would like to hear comments on how to make it more idiomatic C++17 and efficient. Here is my code: SlidingTilePuzzleNode.hpp #pragma once #include <ostream> #include <stdexcept> #include <unordered_map> #include <vector> class Zer...