instruction
stringlengths
71
95.1k
I am a beginner in python and I was wondering if the code for this program is nice and clean. The program works I was wondering how could i improve it. So this program asks for your 'username' and checks to see if your 'username' is in the 'banned users' list. If it is then it will 'log out' and won't let you comment. ...
Algorithm This is my code to convert a sorted vector of integers to a balanced binary tree of the same content. The binary tree is made of these nodes: struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; Here's my first attempt: clas...
This is a school project I have been working on. I have created a program utilizing Tkinter, and I was hoping to get some feedback on the way I have gone about things. I feel like it is pretty messy and there are several parts that could be reduced. The transfromation/snapping gui is something I threw together due to t...
The code below is functional and works as expected, but I imagine there is a better way to test for the error that I am testing for . The scenario is that data is transferred between two different servers throughout the year, so I built in an error handler that checks to see if the connection to that server is valid; i...
I have this very ugly piece of code which runs ethtool and then parses the output (Lilex is just a static class encapsulating subprocess and is not relevant to the question. I'm looking for someone to suggestions to shorten the string manipulation. bash_command = "/sbin/ethtool -P " + identifier output...
I'm using python 3 and I am creating an algorithm to find the sum square difference for the first 100 (or 1 to x) natural numbers. This happens to be project euler problem 6 if anyone is wondering. I've written it two ways and I am looking for criticism on my writing style to further guide me in how I code algorithms. ...
I've made a solution for a problem which involves changing order of objects having some mass, so it costs a mass of an object A and a mass of an object B to make a swap. The program needs to read a number of objects, their masses, their starting and ending order and calculate lowest cost of swapping objects to final or...
I have the following function that takes a string and returns a function pointer; currently its a long if-else block; thats continuing to grow this will make it difficult to maintain. The logic of this function is repeated but the return type has changed. typedef int (*FP)(char** params, int numberOfParams); typedef...
I have written a python script that requests information from several Sports Betting API's, processes and standardises the results into a dictionary, Matches items between dictionaries and then performs a calculation based on the results. The code works however I am facing two problems: The code is very slow taking up...
Inspired by a Numberphile video I made a little program that shows the principles of RSA encryption and decryption. To calculate the keys I used the explanation in this link: rsa public private key encryption explained. Fascinating what you can do in a few lines of code and how Python can handle to powering of large nu...
I have this code that is supposed to compare two Excel sheets. The code is working fine for small comparisons. I did a test run with 7 rows and 2 columns. The code itself works as follows: it compares the two sheets and copies the differences into a new workbook. However, the code should be applied to files that have a...
This program converts glob files' tabs to spaces. There is a special case to ignore content inside triple back ticks. Example usage is ./tab_2_spaces.py *.md Main Concern: Can I write the while loop better? #!/usr/bin/env python3 """ This program is used to convert markdown file's tab indentations to 2 spaces. """ im...
This script based on previous NRPE script for monitoring load average. Same purpouse - get NRPE friendly output with minimal usage of non built in commands. In this case wasn't need to count with floating point. So I could omit bc. Yes, I read Why is using a shell loop to process text considered bad practice. And there...
I have a place where i have to include a HTML template. The HTML is written by employees only but i dont wanna be an idiot and include it without masking|checks :) It should allow HTML tags only without any attributes. So no <a href... links and no <div style=... divs or w/e. My test script: $string = ' <p> <st...
I am a learner in Go and wrote example below in a day so I would like to get some suggestions to improve it. It is a simple rest api that currently just accepts request and returns a dummy message. My main aim here is to get comments and suggestions on how I structured the flow/logic. Although it currently works fine a...
I want to implement cycle crossover in python, and I want to do this in the easiest way. In cycle crossover, a vertex should be copied into the child from one parent, but its position should be inherited from the other parent. Here is a link to how it works: http://www.rubicite.com/Tutorials/GeneticAlgorithms/Crossove...
I am a self taught python beginner for about 3 months and recently I finished my own snake game project. As seen from the code, it is not very efficient nor tidy to look at so I want to know if there are any suggestions that can improve the reading of the code. I posted a similar topic on stackoverflow asking how to ti...
In an effort to explore how the default calendar app works and to experiment with container view controllers, I created the following mock app. See this post for more info about my motivation for this app. This app only explores basic calendar navigation and orientation changes. I've chosen a design that uses a UINavig...
Following the book "Structure and interpretation of computer programs" I have tried to implement a functional solution to the problem of N-queens (implemented by the function nQueens). However, I am not satisfied by the reliance on for loops and the general readability of the code. Could I get your opinion the code? im...
I use prepared statements often even when I only need to execute the statement once (for security), so I implemented a function to abstract away all the function calls on the mysqli_stmt object, as well as bind_param()'s first argument since as far as my tests show it works identically even when int parameters are mark...
After solving a problem, I came to this conclusion. let n = 10; let array = [ [1, 5, 3], [4, 8, 7], [6, 9, 1] ]; let answer = array.map((val) => new Float32Array(n).fill(val[2], val[0] - 1, val[1])); console.log(Math.max(...answer.reduce((r, a) => a.map((b, i) => (r[i] || 0) + b), []))) Okay, so what this d...
Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water. (LeetCode) This is my code int maxAreaOfIsland(vector<vector<int>>& grid) { int max_area = 0...
This is dijkstras shortest path algorithm implementation in c++ using priority_queue STL. Looking for two things: a) Correctness of algorithm itself and b) Any improvement suggestions. /* 3 -----> b ----------->d 10/ -1-- ^ | 1 ^/ | / / | | ------// 1| x v 2|11| / /-1...
I solved a problem where it was told to sort an array of numbers such that the even numbers are kept first and the odd numbers should follow. Moreover, the even numbers must be sorted in ascending order among them and the odd numbers as well. Only arrays can be used. My code is as follows , which works fine but it seem...
I tried to solve the following challenge and optimize the solution but my code still times out. My code is below. Problem statement Climbing the Leaderbord Alice is playing an arcade game and wants to climb to the top of the leaderboard and wants to track her ranking. The game uses Dense Ranking, so its leaderbo...
Below is some code for a basic command line utility to convert image formats of photos. I'm wondering how any part of it might be written with better style, i.e. how it could be neater, clearer and generally "better". import os import argparse from PIL import Image def get_arguments(): ''' Get command line argumen...
Please review my code and help on How can I make it better calculation in method and class definition with SOLID ruby principles?? The application has a static JSON file which contains: { "homes": { "person_a": "windows+tables", "person_b": "lights+tables", "person_c": "doors+curtains" } } The applicati...
I just "finished" a Udemy Java that involves building a banking application. Here is the problem definition: Scenario: You are a back-end developer and need to create an application to handle new customer bank requests. Your application should do the following: Read a .csv file of names, social security numbers, acco...
Goal I want to extract HTML tags and its content from a string. The content (input) is queried from WordPress database. Sample data (input) I extract this dummy data from my WordPress database: https://www.phpliveregex.com/p/tan I believe this should cover all the needed tags to parse. Expectation (output) Accepting a ...
I have different model in frontend and backend. When I submit form in frontend I need to transform that object to match backend model. Is there a better way than this one: submit(confirmed: boolean) { this.transformCreditCardModel(confirmed); this.dialogRef.close({ success: confirmed, productAdjustm...
I took on a for-fun task of creating a memory allocator which uses process memory rather than making a bunch of system calls to the operating system. The task was: implement my own malloc() and free() functions which are limited to a pool (stack array) of 20000 bytes. I already had my own malloc and free implementation...
Normally, when editing something, say when admin is approving a comment to a product, the id of the comment is stored in <input type="hidden"> to be included during form submission. But with this, just a change to the id may affect other pending comment, or those that are already approved. So instead I used password_ha...
There is a function that returns digits as vector of given number. Is it idiomatic way to solve this problem in Rust? Can you suggest more concise solution? #[allow(dead_code)] fn num_digits(num: i32) -> Vec<i32> { let mut x = num; let mut result: Vec<i32> = Vec::new(); loop { result.push(x % 10...
An algorithm to reverse characters of each word in a sentence. What would be your concerns regarding the following solution? Example input: "I love New York" output: "I evol weN kroY" public class Main { public static void main(String[] args) throws IOException { final BufferedReader bufferedReader = new Bu...
The problem is the one explained in Given an unsorted integer array, find the first missing positive integer Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2. Your algorithm should run in \$O(n)\$ time and use constant space. ...
I have a general question regarding DRY. As you can see there are several parts such as io.StringIO(), csv.writer, io.BytesIO which are repeated. I now wonder if there is a better way, where I don't seem to repeat myself. Or is the way how I use it here a fair approach and not considered as DRY? What does your code do?...
Problem: Which prime, below one-million, can be written as the sum of the most consecutive primes? At the moment my code runs for over 200 seconds and was wondering how I can find a way to bring that down by a large amount. I have tried optimising it as much as I can and added an extra if statement, if(subSum < 1000000...
I'm using this nice C++ wrapper to work with SQLite3 in my project. I wanted to handle errors gracefully and automatically rollback if piece of code fails, so wrote this simple helper class: class SqlTransaction { // RAII class to rollback on error public: SqlTransaction(std::shared_ptr<sqlite::database> db...
Print the number of common factors of a and b. input > 10, 15 Output > 2 The common factors of 10, 15 are 1 and 5 My code def print_factors(x,y): l = [] for i in range(1, x + 1): if x % i == 0: l.append(i) m = [] for i in range(1, y + 1): if y % i == 0: m.append(...
I am trying to achieve a getter/setter behaviour that will reduce code in C++. The interface I would like to achieve is for example: MyClass a; a.velocity = 15; // Will dispatch a member function of MyClass responsible for setting "velocity". someFloatFunc( a.velocity ); // Will implicitly convert to the argument type...
Currently I am trying to teach myself more about functions with parameters and return values that connects with one to another. In this code I created a square object with graphics.py that moves to a direction in loop whenever you press an arrow key. from graphics import * import keyboard, time width = 200 height = 20...
I wrote a functionality to read files and load them into the map m_fileParams. Then I am searching the specific keys in the map container using find. Here using find I am searching different keys. My code is working fine. But I wanted to know how best I can optimize the code? In several places I have used find to searc...
The cube, 41063625 (\$345^3\$), can be permuted to produce two other cubes: 56623104 (\$384^3\$) and 66430125 (\$405^3\$). In fact, 41063625 is the smallest cube which has exactly three permutations of its digits which are also cube. Find the smallest cube for which exactly five permutations of its digits are cube. fro...
I'm going through some code and trying to figure out how to get rid of duplicates from the following two methods. Both methods execute a simple login/register query to a local MySQL DB. I couldnt figure out a good design pattern to solve my problem, especially to get rid of the duplicate try-catch. Any advice? public c...
These are a few string routines (just the mem* ones). I've tried to optimize them the best I can without having them be too big, but I'm unsure if I've done a good job. I'd prefer size over speed unless it's just a few bytes, in which case that would be fine. I would also prefer not to sacrifice simplicity for speed. m...
I was looking for a in-memory cache class, but couldn't find any in the .Net Core framework; luckily I found one already implemented here. I made some minor modifications to it and tried to make it thread safe. I believe I succeeded; but boy, did I do a sloppy job? Just throwing locks around and whatnot. I'd like to re...
Write a program that should read a file formatted strictly like this below: $ cat sample bingo=2 bingo2=939 bingo3=text The left and right side of = are consecutively parameter name and its respective value. The values can be integer or strings. Each parameter is separated by a newline. The parameter name and...
I have been trying learn OOP lately, and have made a simple program that simulates some sort of drive thru experience using a 9 digit keypad to add, delete, and pay for items ordered from the menu. Everything works as intended, as far as I can tell. I feel like some of my classes may be doing too much, and that overall...
I'm looking for some feedback on a pomodoro clock that I recently wrote with React. I'm pretty new to React and coding in general. I followed a couple of online courses, but I'm mostly self-taught. My academic background and my actual job have nothing to do with programming, so I really don't know how to rate my work. ...
I've made a solution for a problem which involves changing order of objects having some mass, so it costs a mass of an object A and a mass of an object B to make a swap. The full description of the problem and the original source code is at Least cost swapping in C++ Please, review my code. #include <algorithm> #inclu...
Introduction I provide a regular 9x9 Sudoku solver, reducing the puzzle to an Exact Cover Problem. The algorithm used is Knuth's Algorithm X as implemented using Dancing Links (DLX). As I found no such solving technique on Code Review written in C#, I took up the challenge to have a go at it. The problem definitions ...
My code is functioning the way I'm expecting, with the if. However, it is not pythonic to me, and that bugs me. The multiple if in the code below are supposed to update a property_id field on a database when reading the csv files, properties.csv. if property_id in the file is equal to '2502', it should update the table...
Note: If you don't know much about Fourier transform algorithms, a simple review of whether I am doing anything inefficient with C++ in general would be appreciated. I've been working on implementing an efficient Radix2 Fast Fourier Transform in C++ and I seem to have hit a roadblock. I have optimized it in every pos...
I have an asp.net web api. I would like to log errors into a file. So I decided to use NLog. I already have UnhandledExceptionHandler so I added NLog as follows. I removed all the try/catch in order to log from a single point, just inside the handler. Would you please have a look at my code? Is it good enough? using S...
I am trying to solve the question at :https://leetcode.com/problems/rotate-list/ Question: Given a linked list, rotate the list to the right by k places, where k is non-negative. Example 1: Input: 1->2->3->4->5->NULL, k = 2 Output: 4->5->1->2->3->NULL Explanation: rotate 1 steps to the right: 5->1->2->3->4->NUL...
The requirement is to find the square root of a positive integer using binary search and the math property that square root of a number n is between 0 and n/2, and the required answer is "floored", meaning mySqrt(8) is to return 2. Please comment on the efficiency, and if possible, the loop invariants in terms of corre...
Here's my solution for Euler Problem 3: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? I'm using the Euler problems to learn some basics of C++. Are there any C++ "conventions" I'm missing, or any languages features I could use to get a better understandi...
This code is a result of a lot of help from this community. What does it do? It compares two excel sheets cell by cell and copies the differences into another excel file. I’m trying to modify the Code so it does the following: It goes to “Name” and then searches for that name is the other file. If it doesn’t find the ...
Problem statement is as follows Given an array of time intervals (start, end) for classroom lectures (possibly overlapping), find the minimum number of rooms required. For example, given [(30, 75), (0, 50), (60, 150)], you should return 2. This is supposed to be an easy challenge but it was not the case for me. Here...
This code snippet shows 2 common patterns I see a lot in Python that I don't really like: Arbitrarily-named, narrowly-scoped recursive function Inappropriate data type (in this case, an array ans to store 1 float) used purely for its mutability and scope, to store side-effects from some other scope # Definition for a...
Hi folks: I posted a SO (https://stackoverflow.com/questions/57541246/optimizing-vba-function-loop) and was told to ask here. I am starting to think that rather than relay on excel as my data repository, I should create a separate class that holds a variant array that I can then query must faster?? Anyway... here's my...
A simple interactive Python script for organizing messy folders on the computer, supports macOS and linux but not windows. The mini-program has the following features: Creation of Alpha-numeric (A-Z / 0-9) folders according to available set of letters present in the folder given in the path and move folders/files into...
Preliminary I need to read a binary file constructed by writing a Struct to it with Python. So I decided to write a simple wrapper using struct module. Code import struct class structure: def __init__ ( self, little_endian = True ): self._little_endian = little_endian self._table = dict() #store...
I want to implement a persistent queue for file system operations (copy, delete, move) that needs to be process and thread safe. The module will be used by a daemon (called qcp) which can accept Tasks from multiple clients. It must also be possible to process several queued elements in parallel. I am new to python and...
I am trying to improve my coding skills in Java by taking existing code, studying it, and adding on to it. In this code example, I took code from Connect Four game in Java and edited it. The most major edit I created for the game was that I created a GUI for this game. From looking at the code, are there any suggestion...
I am inserting elements into the map container. For this I am using the same statements multiple times in the below function. Is there any way I can write a generic function for this? So that even at the later point of time, when required, I can insert new elements. bool EMRMgr::GetParams() { EmIOStruct em...
Output should be an object ({cal: val}), with soonest possible time throughout all calendars recommended times from the data. My question is: is this approach over complicated and if so, what should be the proper way to solve that task? Incoming data is an object: let data = [ { name: "A", calendars: { ...
This was a part of one an assignment I found online and tried to solve it myself. The objective was to implement a Priority Queue using Min Heap and use Array as the underlying data structure to store the data. public class ArrayHeapMinPQ<T> { private PriorityNode<T>[] items; private int INITIALCAPACITY = 4; ...
This is from LeetCode: Missing Number Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1: Input: [3,0,1] Output: 2 Example 2: Input: [9,6,4,2,3,5,7,0,1] Output: 8 Note: Your algorithm should run in linear runtime complexity. Could y...
The codes below get the rows of data until it reaches the total running quantity limit. Notice that the SQL uses sub-query. select *, sum(Quantity) over (order by id) as RunningQty from #PurchaseOrderProducts. I'm worried that the sub-query would get all the data from the table. Is there a way to improve the performanc...
I'm attempting to write an animation system on top of SFML, and I've come up with a design where I can wrap sf::Drawable objects into a RenderComponent class, and the RenderComponent class can be given an Animation object at any time, which will overwrite a previous animation if one exists. Here is what I'm looking for...
I wrote a stack class in C++ using arrays of fixed width. Could anyone review my code ? I didn't comment on any of the functions, because I thought class itself is self explanatory. Is it a wrong approach or which kind of comments can I write? #include <stdlib.h> #include <iostream> template <class T> class Stack { ...
Here is my first attempt at creating a full Champions League Simulation, including drawing the groups and subsequent games and playing all matches. The code is very, very long and I am sure there must be a more concise way of writing it. One problem I could not get around was when drawing the groups not allowing a tea...
I have a code that calls many times a function returning a list of the dates between two dates formatted as ('0001-01-01 00:01:00'),('0001-01-02 00:01:00'), ... The current solution is: import numpy as np import time from datetime import datetime beg = datetime.strptime('01 01 0001', '%d %M %Y') #datetime end = da...
The question is: Write a program that prompts the user to input ten values between 80 and 85 and stores them in an array. Your program must be able to count the frequency of each value appears in the array. Is there any more efficient ways to present the count for frequency number between 80 to 85? Below is the sampl...
I'm new in oop programming pattern. I created this simple User Class and i'm wondering if it : Is following oop rules and logic ? Is maintaibable ? Is can be tested without any problems ? Can be expanded to a large user class (permissions,etc) ? Is secure ? this is my class <?php class User { private $data; privat...
So I've just written a framework that is supposed to make it easier to create a network-based application (client-server) using the native java.net package. I was wondering if the structure of my code is well understandable and if there are ways to improve my code (in both, readability and performance). I provided a UM...
Let's assume that you need to filter customers based on 3 criteria: name tags assigned to customer customer's location For some reasons you have to do it directly in your program code, without database queries or PL/SQL for that matter. Which of these two solutions do you find better in any terms? (e.g code readabili...
I have this function that takes a string which represents a html-color and returns the OLE value for it. If the string is null or empty or it can't be parsed, it uses a default value. However I have to write that one line containing the default value twice and I don't see how I could remove this redundancy in the best ...
I would like to make this code more efficient, I have isolated the problem as being these two for loops: for i, device in enumerate(list_devices): for data_type_attr_name in data_types: result_list_element = { "device_reference": device.name, "device_name": "REF -...
I recently solved the Knight Dialer problem but I'm not quite sure if I got the time complexity right; hence I'm requesting the following: 1) Time and space complexity review and explanation on why so. The question says: Imagine you place a knight chess piece on a phone dial pad. This chess piece moves in an uppercase...
I'm using the matomo reports api to pull out some data in js. For some charts, I'm in the need to sort the array data based on inner property value ("val"), further to get only the 3 highest (Hong Kooong, Munich, Tokyo). Finally, this data should be used for the creation of a new key/val object (newObj). This is what m...
Building upon a recent question I answered here Simple middleware pipeline builder (similar to asp.net-core) I came across a cross site question Stackoverflow: Adding middleware in Carter framework makes some URL to not trigger which looked like it could benefit from what I had learned from the previous question. It is...
I've decided to rebuild the code with advices from previous topic C++ Least cost swapping 2 I've also decided to change input from passing the file name to passing the content of a file, so i am wondering if the input checking is still correct as in previous version. Please review my code. #include <algorithm> #include...
I have implemented Token and FieldToken classes as part of my project and would like to hear some suggestions for improvement. First, Token class represents logical operators, relational operators, parentheses, etc. It does not hold a value, only type of the token (e.g. AND, OR, etc.). Here is its implementation: Token...
I have rewritten my python code in cython in order to speed up it quite a bit. However after checking the code in jupyter it seems that part of it is still compiled as python code, therefore its not being sped up enough. My function is pretty basic, it gets start date, end date and creates array of additional dates bas...
I recently reviewed a question here on Code Review. The problem statement is Write a program that prompts the user to input ten values between 80 and 85 and stores them in an array. Your program must be able to count the frequency of each value appears in the array. I coded my own solution for the problem statement. ...
I wrote a queue class in C++ using arrays of fixed width. Could anyone review my code ? I would appreciate any comment and recommendations. It works like a circular queue, so I handled back and front pointers in that manner. #include <stdlib.h> #include <iostream> template <class T> class Queue { public: Q...
I wrote a backtracking Sudoku solving algorithm in Python. It solves a 2D array like this (zero means "empty field"): [ [7, 0, 0, 0, 0, 9, 0, 0, 3], [0, 9, 0, 1, 0, 0, 8, 0, 0], [0, 1, 0, 0, 0, 7, 0, 0, 0], [0, 3, 0, 4, 0, 0, 0, 8, 0], [6, 0, 0, 0, 8, 0, 0, 0, 1], [0, 7, 0, 0, 0, 2, 0, 3, 0], [0, 0, 0, 5,...
This code adds the following functionality to the basic tkinter.Tk() class... settings-file interaction for persistent application settings fullscreen functionality using F11, can remember last configuration or be defaulted removes the need for multiple root.configure() statements removes the need for root.title() and...
The exercise description: Given a ‘words.txt’ file (attached) containing a newline-delimited list of dictionary words, please implement a small command line application capable to return all the anagrams from ‘words.txt’ for a given word. You can use any Scala library of your choice, no frameworks though. Not...
In recent months I have been trying to figure out how in the world one can mimic the functionality of Excel's New Dynamic Arrays exclusively in VBA. There are tricky ways to do this using the window's API, (see this link), and I have also found that one can utilize ADO with Querytables (see this link), which IMO, is a ...
Part 1: General Cleanup (Edit: Part 2 is here.) I have a script in a Work Order Management System (Maximo) that performs a spatial query. Details: Takes the X&Y coordinates of a work order in Maximo Generates a URL from the coordinates (including other spatial query information) Executes the URL via a separate script...
Here's a Quicksort I had fun writing and improving, so I thought I'd post it here. In my (brief) testing it's about 15% to 20% faster than Java's Arrays.sort(). The sort routine is a fairly vanilla Quicksort. The main improvements are to the pivot selection, and the Quicksort switches to an Insertion Sort for small s...
I initially started searching for a PHP script which would output PHP errors, to the JavaScript console. As the Default behaviour is just to spit them out anywhere and displace everything else. Although that was not successful, this is the code I have put together so far. Can anyone please review it and say if it can ...
I use this function to to do some calculations based on 4 select inputs and one number input, I don't have experience in Js, I did some research in w3schools then I ended up with the function below. The Js function is working exactly as I want, but I feel it is not the perfect syntax and it could be shorter and somehow...
I need to generate a lot of pseudo-random numbers in my software. I'm trying to create a elegant (syntax-wise) and performant class that would allow me to generate such numbers and perform other random-related stuff (like shuffling an array). I decided to "cache" a generator for each thread and expose the methods of th...
I am a beginner in C. My teacher gave me a homework problem in which a user would provide an array with its size. What we have to do is:- 1) Take out all the distinct elements from that array. 2) Compare all the subarrays which are possible in the main array with the "distinct array". 3) Tell the number of times we ...
This is my implementation of the famous Number Guessing Game. It is not object oriented, but the goal was to create a simple to read, procedural program. Have I accomplished this goal? import java.util.Random; import java.util.Scanner; class Main { private static int lowerRange = 1; private static int upperRange =...
I've written a helper for combining objects (deep merge). It works, and is flexible to add options (like uniq and replace). Replace should replaces the any matching properties on the object (but spread in any existing properties). The code below works, but I believe it could be optimized particularly as I could NOT fin...