instruction
stringlengths
71
95.1k
Want to level up my skills. It hits a php script that starts a long running export that can take few minutes to few hours. The export script outputs a progress file that this form's javascript uses for the progress bar. How maintainable is this? What can I do to improve? <link rel="stylesheet" href="/css/minified.css">...
I am planning to write a reasonably feature rich serial library but wanted to cut my teeth on something fairly basic. This serial library is fairly simple. It is a thin wrapper on the UNIX open, close, read and write functions. It is blocking for simplicity and on error the caller can use the errno procedure to get ...
This is a Leetcode problem - Given \$N\$ axis-aligned rectangles where \$N\$ \$>\$ 0, determine if they all together form an exact cover of a rectangular region. Each rectangle is represented as a bottom-left point and a top-right point. For example, a unit square is represented as [1, 1, 2, 2]. (coordinate of t...
I need to make a project related to a library catalog. It should have following methods relevant to these books: add delete list There are two types of books: novels and poetry. Both types have number of pages and names. Novels have categories (SF...) and poetry have themes. Need to be able to list the books in the lib...
I wrote a HttpClient instantiable class that will be used as reference to simplify API calls in other methods inside other classes, so the user could call it in a simple way when using my project as reference. I made both synchronous and asynchronous methods, as it was requested for me to made like this. The main class...
For the longest time I always felt lost designing a robust OOP program, especially in C++. I felt like I didn't know enough theory or algorithms so I would study and never write code, not to mention I was always afraid of criticism or looking amateurish. Recently I came to the realization that I been holding myself bac...
Problem Description: Given a 32-bit signed integer, reverse digits of an integer in JavaScript. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: -321 Example 3: Input: 120 Output: 21 Note: It should return zero when it reaches out of limit [−2 ^31, 2 ^31 − 1] My implementation var reverse =...
I want a rate-limiter that permits, at most, N operations over T seconds. I found a sample implementation here but it makes an assumption that operations complete in a predictable, consistent amount of time. I don't want to make that assumption. My attempt to solve this simplifies the approach in the linked article by ...
I am trying to learn Objective C and want to make sure I am following the proper practices/convention. I would very much appreciate advice on what to change/improve I also have some questions: when do I use entity.position vs [entity position]? when do I use NSNumber vs double when do I use int vs NSInteger vs NSNumbe...
I am looking for a way to transform JSON data into a flat "csv-like" data object. In some way, I am looking to "sqlirize" a mongodb collection. I have already check some json flat libraries in NPM but non of them quite solve my problem. I have solved it in my own way but wanted to know if there is a more efficient way...
I have modified a particle system to create an effect similar to the one that I want. However, with any substantial amount of particles it performs very slowly on my laptop (around 1.7 fps at the worst when I remove the if statement limiting the creation of new particles). I'm guessing that this is because all the work...
These are the first lines of code I've ever written. I've been interested in the idea of learning to program for quite a while, but never really pulled the trigger, and now I've been playing around with some HTML & CSS and thought this might be a good starter project. So after a couple of days of furious googling, I ma...
I have a malloc() implementation that relies purely on mmap. I'm fairly sure that it doesn't overwrite any of the internal structures or have any other breaking issues, but I'm not totally sure about that. Some details: __PTRx__ (where x is 16, 32, or 64) is defined when a pointer is x bits in size. I would appreciate...
Recently, I have been trying to improve my functional programming skills and understanding. While at work today, my coworkers and I were playing Hangman in a group chat. I thought of a program that would guess the likeliest letter in the word to guess. So I implemented it when I got home. Here is the repository if you ...
I did a script to extract information from the Egyptian national ID, e.g. national id is 14 digit ex(29501023201952). It could divide as described below: 2 - 990115 - 01 - 0192 - 1 x - yymmdd - ss - iiig - z x (2) is the birth century (2 represent 1900 to 1999, 3 represent 2000 to 2099 .. etc) yymmdd (200115) is th...
To work on my Java skills, I decided to create a structure for a pool that I work at. Lifeguards get shifted when their time at their position is up, and managers periodically check the pH level of the pool. I would like feedback on the following items please. Structure: Is how the current project is built acceptable?...
Is this the most efficient way to write this piece of code? Is there a better way of handling errors inside of a while/for loop, instead of calling back to the original function? I have tried using break or continue, but it breaks the functionality of my program. Any help would be awesome, thanks. ## calculate binary t...
So I have been programming in VB.net and want to learn C#. I "successfully" created a simple program that retrieves data from Sql Server during Form1_Load. The program also retrieves data from an MDB file and converts it into a connection string, which I can use throughout the system. I would like to ask for your comm...
I would like to know whether I could make my solution to this challenge shorter and more efficient. Below is the description of the challenge (this is a Leetcode problem) - In the video game Fallout 4, the quest "Road to Freedom" requires players to reach a metal dial called the "Freedom Trail Ring", and use the d...
I have C# ASP.Net Core Webapi application that makes some calculations for physical models. I have this project class: public class Project { public IEnumerable<GenericComponent> components; private ValueService valueService = new ValueService(); public Project(string norm) { components = FactoryGe...
Please can someone confirm if this code is the best way to build the following tree 0 / \ 1 1 / \ / \ 3 8 4 7 class Node(): def __init__(self, value, right = None, left= None): self.value = value self.right = right self.left = left ...
Some time ago I implemented dynamic_array and posted it on Code Review. It used std::function internally for type erasure. This inspired me to implement a standard-conforming std::function myself. This is just a showcase of how static polymorphism with templates can play well with dynamic polymorphism with inheritance ...
I am creating a logging library in C++, and I wanted your opinion on code quality and performance within some methods. You may ask why yet another logger - the answer is simple. This logging library that I am developing is not exclusively said to be released, it's purely for my own experience and fun. But if it turns o...
It's a simple bash script but I'm hoping for feedback, advice and examples on how to improve the script and code. Can you guide me how to put more checks in the code and more if possible? This code: Sets IFS variable and backs it up Sets a trap for signals that can kill the script and a trap for exit to do run a clean...
The task is taken from LeetCode Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of conference rooms required. Example 1: Input: [[0, 30],[5, 10],[15, 20]] Output: 2 Example 2: Input: [[7,10],[2,4]] Output: 1 NOTE: input types have ...
I am looking for some way to improve my code. It works but it doesn't look good and I am almost sure that lot of Best Practices rules are violated. The save_session() function, creates dictionary with other dictionaries nested in. At the end the dictionary is dump to .json file. I will appreciate any suggestions and ad...
I am currently learning Java Servlets and JSP at university. As a little practice I created a project where I want to be able to login into a protected area. Now, I got it working by using a RequestDispatcher. However, after I have been forwarded to the protected area, the URL in the browser shows http://localhost:8080...
Here is my solution to the following Daily Coding Problem challenge Given a string, find the palindrome that can be made by inserting the fewest number of characters as possible anywhere in the word. If there is more than one palindrome of minimum length that can be made, return the lexicographically earliest o...
I got a warning when I am returning "list" in the function createList "Address of stack memory associated with local variable 'list' returned" I am confused about pointers and memory allocation and not sure how to fix it. int* createList(int quantity) { int list[quantity]; printf("Please enter a list of number...
I'm learning myself C and to make sure that I learn to code C in a proper way I created tic tac toe and want to hear your opinion on what I should do and what I shouldn't do. One thing is sure is to divide the code up in several files maybe but outside of that. The code: #include <stdio.h> #include <stdlib.h> #define ...
I was messing around with GPU compute shaders the other day and created a Mandelbrot shader. Unfortunately, Metal doesn't support double-precision in compute shaders, so beyond a certain zoom level, I need to switch back to the CPU. In doing so, I decided to try writing SIMD code for the calculations to make it faster....
I am currently developing an e-commerce website where users can upload their photos to customise their products. The use case begins when the user selects a product from our website (e.g. shirt). After that, they will select the quantity and upload their photos. The client-side will then append the following fields to ...
I am trying to implement a hashtable that supports character keys and can return any type of value contained in a struct as long as it contains as long as it contains Bucket as one of its members. The user has to supply the size of the hashtable (preferrably a large enough prime number) in the calling function. It use...
The task is taken from LeetCode Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), determine if a person could attend all meetings. Example 1: Input: [[0,30],[5,10],[15,20]] Output: false Example 2: Input: [[7,10],[2,4]] Output: true My imperative solution:...
Here is my coded solution to the LeetCode zig-zag problem - The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this (you may want to display this pattern in a fixed font for better legibility) - P A H N A P L S I I G Y I R And then read line by line: "PAHNAPLSII...
I'm implementing the Probabilistic Exponentially Weighted Mean for real time prediction of sensor data in pandas but have issues with optimising the pandas notebook for quick iterations. Is there a more optimal way to completely remove the for loop as it currently runs longer than expected. How can I take advantage of ...
I'm a beginner programmer and i'm looking for interesting projects to improve my low skills. I decided to spend one evening on simple snake game in console. I made it with the help of YouTube tutorial. But then i have modified some parts of the code and commented it.It seems like it's still have a lot of problems. It w...
I have an implementation of an algorithm to return the in-order successor of a given node in a binary search tree. We are allowed to assume that each node in the BST has a reference to its parent node. The in-order successor of a node is the node with the next largest key. So, if we received a node with a value of 5, a...
I have written a simple pool allocator for C++ and I'm looking for ways to improve it, in speed, usability or safety. For example, I don't know how to allocate a buffer larger than the pool size. #pragma once #include <limits> #include <vector> template<class T, size_t poolObjectCount = 100> class PoolAllocator { pub...
I've created a small module with a function plog() that allows to easily print to both a log file and the console. It also creates a directory "log" at the location of the file that imports the module. Although I'm quite a beginner in terms of Python I'm not satisfied with my code since I'm using two global variables. ...
Inspired by the video from Scam Nation and James Grime from Numberphile, I tried to make a Razzle Dazzle simulator. Razzle Dazzle is a scam in the form of a game. Per turn, the player pays a fee and throws 8 marbles onto a board, so they land in holes in the board. Each hole has a score from 1 to 6. Throwing 8 dice ins...
The task is taken from LeetCode Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: [ "((()))", "(()())", "(())()", "()(())", "()()()" ] My solution is based on backtracking. Maybe there's a better approach tha...
I have an API that provides data that is updated on an infrequent schedule, about once every 2½ minutes on average. Assuming that it's okay to fetch only as often as every 2½ minutes or less often, I'd like to construct a saga (I use redux-saga) in a way that it does nothing if it's not yet time to do an API call. The ...
The task is taken from LeetCode Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters. Example: Input: "23" Output: ["a...
I have a number of custom events that a class might or might not subscribe to. Action<Game1, MoveEventArgs> MoveEvent; Action<Game1, InitializeEventArgs> InitializeEvent; Action<Game1, DrawEventArgs> DrawEvent; Action<Game1, LoadContentEventArgs> LoadContentEvent; Each event is currently very similar just containing ...
I have got a technical challenge from a company but they reject my code and I'm not sure how to do this challenge in a more efficient way so I'm here to get some guidance. The Technical challenge was: Manage a list of products that have prices. Enable the administrator to set concrete prices (such as 10EUR) and disco...
I have a Python code that deals with parsing xml-feeds of footwear online stores. I want to let the code look more professional for the sake of optimal reusability for other programmers. It includes more script files, but I'm more interested in utils.py import re from .setup_logger import * from .metadata import refere...
So I have a list of files which names are something like this long_boring_filename_del_1.tex long_boring_filename_del_2.tex long_boring_filename_del_3.sty long_boring_filename_del_4.tex I want to cycle through these filenames using some mapping defined in vim. Meaning if I have long_boring_filename_del_2.tex open and ...
I've just started practicing Functional Programming in Scala in some days. This is the code I used to perform KS-test on a random number generator. class RNG { def next(): Double; } import scala.math.sqrt; object main { val length: Int = 100000; def main(args: Array[String]) { // generate 100000 random num...
I'm creating a new website, so I am thinking about how to protect my email address and phone number against crawlers, I actually mean email harvesters (most of which I suppose don't have JavaScript enabled, but I don't have any proof of it). What I do now is definitely security by obscurity or obfuscation (I might be c...
I have written some code that prints out all unique pre-ordered binary search trees containing numbers 1 to n. It is not an especially efficient solution and has a time complexity (I believe) of O(n!) but hopefully it is fairly easy to understand. As I am using sets the output is not sorted. """Module constructs and ...
Intro -> I have to convert an excel file, which comes usually in this way: to a Json file that must looks like this: "DE": { "Title":"Title_DE", "Subtitle":"Subtitle_DE", "Title_2":"Title_2_DE", "Subtitle_2":"Subtitle_2_DE" } "GR": { "Title":"Title_GR", "Subtitle":"Subtitle_GR", "Title_2":"Title_...
I'm trying to make a timed background service in .NET Core (I found this approach in Microsoft Docs), that every 15 seconds it gets data from the database (1000 rows max, if something exists) then sends it to the API using a foreach loop. If a response status code is not 200 or 202, I change thr status column by id in ...
Can someone tell me if this code is safe? Can be sql-injected or something else hacked? Code get some rows from db and show in pages with pagination... if i can improve let me know and show me how, thanks. $conn = new PDO('mysql:host=localhost;dbname=admin_admin', 'admin_admin', 'password'); $conn->setAttribute(PD...
I've been working on a project to make myself more comfortable with NodeJS, especially Express and TypeScript. Searching and reviewing a lot of approaches of the people, providing bootstraps for it, I was merely satisfied with the results I've found (including the git repos from Microsoft). So I started with the Expres...
I need to read a range of bytes from a file and return it as a std::vector<std::byte>. My current code looks like this: #include <cstdint> #include <fstream> #include <string> #include <vector> using bytes = std::vector<std::byte>; using namespace std; bytes read_block(uint32_t offset, uint32_t lengt...
I was implementing a simple neural network, and I noticed that, if I ever wanted to change the layers' activation functions, i would have had to completely rewrite some parts of the code, so I tried adding some flexibility to the network, using template meta-programming, because I thought that having most things resolv...
I'm a newbie and I wrote code that gets a WAV file and exports a RAW (only PCM data) to *.raw file. But I am confused about the structure. The code is written as one procedure (LISP style) and there are no functions. Can I get some advice how to reorganize the code? main.c #include <stdio.h> #include <stdlib.h> #inclu...
My use case is this: RangeDemo.java: package net.coderodde.util; public class RangeDemo { public static void main(String[] args) { for (Integer i : new Ranges(new Range(-9, 0), new Range(3, 5), new Range(15, 10), ...
Every time I toggle active class in a list (to dynamically change DOM content) I find that I always go to this approach to check and clear which class is active. I'm still fairly new to using pure javascript so I'm wondering if there is a better, simpler approach? It feels like having to run a second function to clear ...
I am writing an event sourced system in which I need to have the state based on the events that already occurred for a given bank account. The events are defined such as: type AccountOpenedEvent = { AccountId: Guid Contact: Contact Timestamp: DateTimeOffset } type AccountClosedEvent = { AccountId: Guid...
Here is my coded solution for the N-queens challenge The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. The program outputs all valid chess boards, where the queen is represented by the digit 2. Are there any improvements that can be made to my code...
I need to create a circle with numbers from 1 to n , however it is necessary to respect some rules: All numbers from 1 to n are used in the circle only once. The sum of two consecutive numbers is a prime number The sum of a number with what is diametrically opposite it is also a prime number So I need to create an ...
I have this question asked as home assignment for an interview. I submitted my solution and did not get selected. Wanted to know your feedback for the solution. Question: Write a very simple event bus system in C++. You can use whatever version you are comfortable with. For this system to operate you will need two fu...
I have been struggling to make typescript happy about the types. I am pulling data from our backend API and I wanted to give context to the data. Basically it is a monad with 4 shapes: Initial (nothing) Loading (maybe with percent?) Failed (maybe with error?) Loaded(with the actual value). I want it to have the usua...
I've coded this function as a secure file upload function in PHP. Currently I'm woking on an academic grading system (PHP script) which's really sensitive, so tell me what you think, and if you have any comments or recommendations please share it with me. <?php function secureUpload($fileField = null, $uploadPath = 'up...
I would like to know whether I could make my solution to this Leetcode challenge much faster. There is a brick wall in front of you. The wall is rectangular and has several rows of bricks. The bricks have the same heights but different widths. You want to draw a vertical line from the top to the bottom and cros...
I asked this question over at stackoverflow but was told it may be better suited here. So I absolutely want to store DateTimeOffset objects in UTC format. To achieve the correct conversions, I've created my own methods to deal with the conversions. /// <summary>String representation of the specified time zone.</summary...
I have made some code that operates on multiple entities and creates 'time windows' for them. Basically, the entities will contain states, usually in boolean or int. They will be timestamped and in order to reduce the number of rows when creating a graph for a large date range, I am calculating time windows of 5 mins, ...
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. The above elevation map is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rain water (blue section) are being trapped. Example: Input: [0,1,0...
Please review performance https://leetcode.com/problems/transpose-matrix/ Given a matrix A, return the transpose of A. The transpose of a matrix is the matrix flipped over it's main diagonal, switching the row and column indices of the matrix. Example 1: Input: [[1,2,3],[4,5,6],[7,8,9]] Output: [[1,4,7],[2,5,8],[3,6,9...
In my effort to learn Rust I've tried implementing an Iterator that splits up a buffer in two halves, and correlates both halves by sliding them over each other with different positions (lags). You could use this e.g. to do autocorrelation, given a correlation function between two buffers (dot product for example). I'm...
I have a very simple component, which should be styled differently based on the passed condition. I wonder if there is a better approach to refactor this piece of code? function RandomComponent({ number, condition }) { let classNameToUse; switch (condition) { case 'high': classNameToUse = ...
I wrote a simple program, that will make a string 'noisy' if the clipboard contains one. What disappoints me, is that I should manually check what I got from getClipboardString — in the Nothing case, we simply return from program, otherwise we modify the string. Is there a better way to do this kind of check? import D...
I created a simple script that implements log rotation. It checks the log file size (say, out.log) if it exceeds 5MB limit. If it does then the script copies it to out1.log and clears out.log. But it also copies out1.log to out2.log, etc. So log files are kind of 'shifted' and contents of the last one is discarded. In ...
I'm looking to irreversibly hash valid email addresses which have been parsed from mail log data as part of a machine learning project. I need to ensure that the processed data has been scrubbed of personally identifiable information (specific users/client domain etc). A quick google-fu led me to pyffx and the inbuilt ...
The internet as a whole and Code Review in special already provide a decent amount of implementations of the Luhn check digit algorithm. They often follow a relatively "naive" strategy, in that they are mostly straightforward translations of the algorithm's pseudo-code (as found e.g. on Wikipedia), like below: class Lu...
I have coded a solution to build all valid permutations of parentheses. My code is below. I have a question on my code based on a comment by my PEP8 checker. It said that there was no need to include the line return anywhere in the code (initially I included one). The solution works but I have never had a case using ...
I'm writing a small almost one method Java class for a job application and the advice given was to write it as though it was a piece of commercial software. The processResult method needs two string arguments of equal length. I thought the best thing to do is check that the args has at least 2 items, then inside the pr...
I am running a simulation study where I am using two-part hurdle modeling on different effect sizes. I tried to stream-line my code for the best optimization including foreach loops and parallelization. I attempted to post here prematurely a few weeks ago and am now posting my updated code. I keep running into an error...
I'm trying to become better at javascript and have written a simple script that just creates some html from getting some details from some elements (e.g. the image alt text) and inserts it onto the page to create a caption. Hover over the top right of the image to see this caption. I was able to successfully achieve wh...
I have this code that I've made to parse a string of HTML and tell me if it is all enclosed within a specified tag: const textIsWrappedWithTag = (text, tag) => { const tempDocument = new DOMParser().parseFromString(text, "text/xml"); if (tempDocument.getElementsByTagName("parsererror").length) { return false; ...
I'm calling these two methods on a Worker that is executed every 24 hours at midnight in the background. The code seems to be a little bit difficult to read and I'm not sure if i'm iterating through the collections in the smartest way. Is there a more elegant or faster way to iterate on these methods? Would you suggest...
I am fairly new to React, but I have been reading a lot of the official documentation and trying to do things correctly. Background: I am building a simple lyrics application in ReactJS, it looks something like this: The application is deployed here and the code is open source. The bit to review The code for the searc...
Algorithm Let \$M_0\$ denote the null model which contains no predictors. This model simply predicts the sample mean of each observation. For \$k=1,2,\ldots,n\$: Fit all \$n \choose k\$ models that contain exactly \$k\$ predictors. Pick the best among these \$n \choose \$ models, and call it \$M_k\$. Here the best i...
This is my account table: CREATE TABLE mwUser ( username varchar2(20) primary key not null, salt varchar2(64) unique not null, hashedpw varchar2(64) not null, email varchar2(320) unique not null ); When I register a new user with my java webservice I automatically generate a random salt and store in the dat...
I have a procedure for looping through all files in folders and subfolders starting at a folder which the user can select. The user can select both the source and target folder. I'm using Excel VBA for this. The worksheets contain all the files names or part of it, to search for. It works like this. I have function Ge...
I have written a simple java.util.Properties wrapping class. Unfortunately, in my opinion, it isn't testable at the moment and I don't have any idea how to improve it. I could use PowerMockito to change properties after loading, or add a setter for them, or inject some class that provides properties, but I don't like a...
I have written code in the language Go. I wonder if anyone can do it in a very simple and effective way, because every language has its own way to solve this problem. My experience is in JavaScript. Please guide me how I can improve this solution. Thank you in advance. What I'm doing here: Input - "I love dogs" ...
I am using a Bash script to execute a Python script multiple times. In order to speed up the execution, I would like to execute these (independent) processes in parallel. The code below does so: #!/usr/bin/env bash script="path_to_python_script" N=16 # number of processors mkdir -p data/ for i in `seq 1 1 100`; do ...
For my game that I'm writing, I need, among other things, a data structure for storing best values. For this purpose, I tried to write a class that meets the most general needs, and yet does not seem overloaded. Can the class be further improved in terms of code quality or performance? Is the interface (not to be confu...
I am creating a Expense Tracking Application in C# and right now I am trying to build its building blocks in a console app. I Would like to know your feedback if it is in a Object Oriented Design/Structure. namespace ExpenseTrackerOOP { class ExpenseTracker { static void Main(string[] args) { ...
This method shows the list of manufacturers' offered products based on the slug and sidebar filters. Most of the time I have to write the same query with only some changes: you can say I am repeating myself. I want my code more readable and short. How can i refactor and reduce the lines of code? public function colabra...
this is my first time on this stack exchange :) I created a little script to check for the latest version of specified API version available, but I am wondering if I am using the best way possible for checking regex and includes? The var arr will be filled dynamically with version folders using fs.readdir, but for simp...
I'm working on a Django project and I'm wondering if there is any way to improve the process time to export my data to xls format. Actually, it takes between 43 seconds and 49 seconds to create the file and download it. I would like to know if my code could be improved in order to save time. This is my function: def ge...
I'm still new in web development and I am trying to develop a website with free access to doctors listing with option of booking. This is a personal project that my local community can benefit. I want to get an opinion or recommendation from you experts whether the logic for my register functionality is correct. Before...
I've attempted to make a small PHP library for styling terminal output using ANSI escape sequences. The repo is located here. To be honest, I am not really satisfied with the current structure of my code. It seems to be "not good". But I don't know any better ways to structure it. Chalk.php <?php namespace TdTrung\Chal...
My goal is to generate a large sparse matrix with majority (~99%) zeros and ones. Ideally, I would be working with 10,000 rows and 10,000,000 columns. Additionally, each column is generated as a sequence of Bernoulli samples with a column-specific probability. So far, I've implemented 3 ways to generate the data: Funct...
I'm making a program which fits a piecewise linear regression with up to 4-5 breakpoints in the data, and then deciding how many breakpoints is best to prevent over and underfitting. However, my code is extremely slow to run, due to how ungraceful and brute force it is. However, I'm not sure how to code it in any other...
I use this method to get either Customer or Account. The server will determine which type it is. The response will have a property "Type": "Customer" or "Type": "Account". I first deserialize to Client (supertype) to check the Type property. Then deserialize to either Customer or Account. public async Task<Models.Entit...