instruction
stringlengths
71
71.9k
I have this tiny library for implementing simple command line languages. It is not flexible enough for handling actual programming languages, but hopefully it may help implementing simpler REPL's faster/cleaner. CommandParser.java: package net.coderodde.commandparser; import java.util.ArrayList; import java.util.Colle...
This is a complete login activity class. What I need reviewed: I need simplify my code as much as possible. Is it wise to use the butterknife library, or is the normal way better? Hide keyboard when user touches out away from edit text, and when selecting "login." Best practise for volley library. Should I use it indi...
I am reading from a Networkstream, and the response code is: private async void GetResponse(NetworkStream stream) { while (true) { var readBuffer = new byte[4096]; var asyncReader = await stream.ReadAsync(readBuffer, 0, readBuffer.Length); var result = RemoveBytes(readBuffer, new byte[] { 130, 119, 126,...
Here is my program that calculates tuition cost for the next five years. I have had some review on it so far, but I am seeking more. Please keep in mind I am new to programming, so I may require a few extra steps to understand something. Thanks in advance! Version 1.0 is here RESIDENCY_COST = { "I":...
I have written code based on the Greedy Algorithm. The example can be found here. Problem: Make a change of a given amount using the smallest possible number of coins. Coins available are: dollars (100 cents) quarters (25 cents) dimes (10 cents) nickels (5 cents) pennies (1 cent) This outputs an array of coins: <?p...
I commented on a question and blindly asserted that a Stack based on a linked list was rather elegant (see here) I haven't ever written a Stack in C# so I thought I should back up my claim: public class Stack<T> : IEnumerable<T> { protected class StorageNode { public T Value { get; set; } publi...
I am finished with my implementation of PUB/SUB or Observer pattern, however I just want to see any ways that I may be able to improve this pattern. I wanted to be able to use the typical PubSub pattern except add performance enhancements by using the new key word to instantiate each new instance of a PubSub object, as...
I wrote a method called bringToFront, which moves an element a to the first position of a sequence seq if it exists; otherwise, seq is returned. If a appears in the sequence more than once, only the first occurrence is moved. Sample input/output: List(1, 2, 3, 4, 3).bringToFront(1) // List(1, 2, 3, 4, 3) List(1, 2,...
I have a var af_button which is a button on UI. It can be either selected or deselected, so in that case I have four possibilities, which I have implemented. I don't like this implementation, so what would be a more pythonic way of implementing this? af_button = squishtest.waitForObject("{text='AF' type='QPushButton' u...
See the previous iteration. What's new: endianness is now handled more gracefully (only one endianness check, and convertion if need be) and music is more funky. #include <stdbool.h> #include <stdint.h> #include <stdlib.h> #include <stdio.h> /**************************************************** * From http://stackove...
The following function takes an object of items in the format of { 'complex-key': 'value', // Repeat } where complex-key is a key delimited by dots, and returns an object in the form of a tree, where you can access the value by traversing the parts of the complex keys as keys in the object (see examples below). Th...
I'm trying to achieve a thin controller, and I started out with a thin controller but over time as the project has progressed the controller has got more complex. Could you please review the following code and let me know if the controller is still considered a thin controller or whether any of the code should be moved...
I often find myself writing LINQ queries like this. I end up testing for Null and zero-counts pretty often, and the code sprawls out to be something like the following: // GET: api/CustomBehaviours public IEnumerable<CustomBehaviour> Get(int? orgID = null, long? userID = null) { using (PAMDatabase db = new PAMData...
I have 2 values \$N\$ and \$K\$ (\$1 \le K \lt N \le 1.000\$), where \$N\$ indicates a number of values (\$0 \le \text{value}2 \le ... \le \text{value}N \le 1,000,000\$) to be read from input. The first value isn't on the input and will always be 0. All \$N\$ values need to be organized on at most \$K\$ groups where th...
I have a DataFrame of data from a survey that was repeated over several years, asking people about their income and how much money they had in savings. For simplicity, let's pretend it looks like this: In [1]: nominal.head() Out[1]: year1 ... year11 income1 ... income11 savings1 ... savings11 0 1992 ... NaN...
When answering python tuition calculator v2, I got a little carried away, and started building a print_table() function which I don't like the resulting code for, and I would love guidance into improving (and/or enhancing) my code. My ambitions were as follows: Have a print_table() with as little formatting as possibl...
I am writing a CAD program plug-in which is used to batch translate a list of CAD files stored in a text file. After each individual CAD file is successfully processed I want to remove the CAD file from the list. The reason for doing this is because the CAD program may crash while translating the file, and I want to be...
Project Euler #19 asks: How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)? I'm hoping I wasn't too off course from the spirit of the exercise by making use of my favorite libraries: pandas. import pandas as pd rng = pd.date_range(start='1/1/1901', end='12/31/200...
I created a function to get the hash value of a file. Normally the output is 3 lines. My function does 3 things: extracts the hash value removes the spaces in between the hash value prints hash value Here is the output when using CertUtil -hashfile FILENAME.EXE SHA1 SHA1 hash of file FILENAME.EXE: XX XX XX XX XX XX ...
Originally, I was going to post a question about how to condense four repetitive functions into a single function, but I wound up figuring it out myself before I could even post it. However, the original idea that I had was to break down some of the repetitive sections into their own function and use those new sub-func...
I wrote a program that records how many times 2 fair dice need to be rolled to match the probabilities for each result that we should expect. I think it works but I'm wondering if there's a more resource-friendly way to solve this problem. import random expected = [0.0, 0.0, 0.028, 0.056, 0.083, 0.111, 0.139...
This is a follow-up of Comparing random number of bits. I have a function that compares bits from a binary representation string and a chunk of memory and returns true if they are equal. This is the function (which works as expected): I'll explain with comments what some external methods are supposed to do, accept that...
I need to check if there are any abbreviation of New Brunswick province in the address. Acceptable abbreviations are: "NB", "N.B.", "N-B", "N.-B." and any combination of upper-lower cases. It shouldn't be a part of another word, hence the "\b" separators. The hardest part was checking the dot in the end, because of the...
This code is for dispatching and handling certain events from GitHub (and also Bitbucket). Things like pushes, issues, etc. can be handled by this system, and strongly-typed objects will be returned. I left the XML docs out of all these, as somewhere from 2/3 to 3/4 of the files were XML docs. (We all know how much I l...
I recently read a really interesting post on adding functional pattern matching to C#. Here's a quick and dirty implementation using delegates and dictionaries. Right now, I require that Match return an object of type TReturn. Is there any way I can easily extend my current implementation to be void (i.e. Match is not...
I've implemented a functional-style list structure in C++. It seems okay so far, and doing custom allocation for list nodes improves performance greatly. I omitted that part here for simplicity. The mutability of the list is intentional, as the application I'm thinking of requires a lot of state updates. I wrote this c...
I've been working on a small game as a hobby, and I've been having trouble finding a good way to control the state of the game that could scale easily. I couldn't find a solution that I felt was correct, so I wrote my own. I created an abstract base class State that has an abstract function update that takes and retur...
I need to query MongoDB and check if an item exists or not: class MongoDBPipeline(object): def __init__(self): connection = pymongo.MongoClient( settings['MONGODB_SERVER'], settings['MONGODB_PORT'] ) db = connection[settings['MONGODB_DB']] self.collection = d...
This is notepad that works with list of files (pages w/e) that can be edited (list). You can access each file separately and edit/view it too (rewrite, append, read). Here's my implementation of it. I have 2 classes that resemble menus (list of files, and file itself) both are inherited from interface and 1 class that ...
This is a TCP server I am currently working on. It is accessed through telnet (I know it isn't secure, its just a project for uni). The server is programmed in Python 3. I am currently trying to figure out how to implement thread locking in my program, how to create user sessions, and the best way to implement a set of...
When building a working example of a class, I ended up with the following statements which is violating the 80 character rule of PEP8. The code was inside a method inside a class. Code excerpt is from PrettyTable.__init__() and PrettyTable.add_column() in my answer to Using changeable column formatting to display table...
I have a simple socket.io server written in node. Everything is working just fine, however I am curious whether what I am doing is acceptable. I am especially interested in this line listOfMessages = listOfMessages.slice(-1000); Essentially what I am doing is each time a new user connects, I resize the array and send ...
I just wrote a simple B-Tree insertion implementation, and was wondering if anyone can comment / critique on code style, readability, maintainability etc. I tested it with a few small test cases and as far as I know, there are no obvious bugs in this. I'm making extensive use of shared_ptr. I contemplated using unique_...
This is a simple web form handler in PHP that sends a completely filled web form to a email. I see lots of repeating code. What is the best way to reduce repetition? Is my way of checking for fields being empty good? The "empty()" method seems to also treat "0", "0.0" and similar values as empty. Am I doing something ...
Revision 1. This revision on GitHub In addition to the solution itself, I wrote tests for all the possible cases. It seems you have verified all execution paths are covered. You are right. I only covered all execution paths in the class AvlTree In this revision: No Android code style. In fact, it's much easier to...
To make a long story short, I must revive my Forth. It is rusty; last time I did anything serious in Forth was 30 years ago (man, I am old). As an exercise, I translated an STL-like implementation of qsort. It works (if you want to test it, install gforth). It performs well comparing to SDCC-compiled native C (I don't ...
I recently wrote a code in online recruitment test. It was very good. With each question, there were associated space and time limits check. If our code executed correctly within both limits, only then we were given full marks otherwise 0. Input: String consisting of ASCII characters. Output: True if the string is bala...
I'm calculating all possible solutions for a given Sudoku board with at least 17 values. My approach is a basic backtracking approach and it works. protected void calculateSolutions(final SudokuBoard input) { if (input.getFilledCells() == 81) { addSolution(input); return; } for (int grid =...
The code works but with an increase in data it's now slower so needs a tweak so looking for pointers. 'To import into Module Dim sConnString As String = System.Web.Configuration.WebConfigurationManager.ConnectionStrings("SQL").ConnectionString Dim vDateNow As Date = Now() vDateNow = vDateNow.ToString(...
I am new to Python. I have built a model with randomforest in python. But I think my code is not optimized. Please look into my code and suggest if I have deviated from best practices. Overview about the data I have: The data has response columns and predictor columns. Also there is a column 'TestOrTrainingDataRandom' ...
For legacy reason (guys here LOVE immutable object), I need a struct that contain an IpV4. I can't use System.Net.IPAddress because it's not a struct. So far here what I got: public struct IpV4Address { readonly byte[] address; public IpV4Address(byte[] address) { Throw.IfArgumentIsNull("address", ...
I have a large application that focuses on using dependency injection. I've made a small (as I possibly could) piece of sample code to make this question more manageable. Essentially, I have a lot of boiler-plate code occurring for a number of commands that call stored procedures and return a response object back to th...
This is an implementation of the minion game, which takes in string input and declares a winner between two pre-determined players. The logic is player 1 gets all sequenced words not starting with a vowel and player 2 gets all sequenced words starting with vowel in the input string. Objective: performance optimisation....
I have a Java class which has to be generated only once for all the objects that I have - it is a small program. This singleton class holds a mapping of characters. I Googled stack overflow and found that using enum is the most safest way to create a singleton class as Josh Bloch explained in his Java book. I also re...
I would like your opinion on my shell script that prints the Fibonacci sequence. #!/bin/bash first=0 second=1 third=1 echo -n "Term: " read term fub=$((second+third)) echo $second echo $third echo $fub for ((i=1; i<term; i++)) do third=$((fub+third)) echo $third fub=$((third+fub)) echo $fub done I tried to ...
I created two dropdowns, a dadand a son that are populated based on two arrays that, hypothetically, can't be changed. When you choose a dad with the code x it generates the son's drop-down with the options containing the code x. var dadArray = [ [1, 'Dad1'], [2, 'Dad2'], [3, 'Dad3'] ]; var sonArray = [ [1, ...
I have the following code and I'm trying to find a cleaner way to run the year functions. At the moment I have 5 years as divs with an onclick event to bring the appropriate year image into view. So if you click on 1950, the 1950 year image will appear. If you then click on 1960, the 1950 image will disappear and the 1...
I am implementing the algorithms of Course: Coursera Algorithm I. I implemented the Merge-Sort using recursion and although it sorts correctly I am not sure if it is a correct implementation of this algorithm. Could you guys take a look? How can I keep it more "readable"? ## # Implemetation of Merge Sort see: {https://...
I've implemented a two-step convolution in OpenCL running on GPUs. The convolution is applied to a series of 1480x1552 matrices. All matrices are pre-loaded and are stored in the input_image array. With my current implementation I'm able to achieve a processing rate of ~80 images per second. How, if possible, can I imp...
I have pasted a method I wrote, which is too slow to my liking (easily takes 60+ seconds to execute). The method loops through 12 different servers, checks if userX has access to any of the databases in this server and reports the result. I'm already using a table to save all of this information. That information is al...
In React, the render method must have one and exactly one child (although that child may have many more children). As a result, it becomes difficult to render elements that intrinsically need multiple elements as children without wrapping them in an unsemantic - and in the case of <dl>, forbidden - <div> element. As I ...
Although I've been programming a fair while I'm learning Python and would like to know how I can make my code more "Pythonic". I'm have a CSV file of eBay categories, containing the name and numeric code which I want to import in to my database. Unfortunately the file does not include a 'parent' category ID for each ro...
I've recently redone something I wrote around a year ago since I'd done it wrong (it required the original image to decode an imagine, which can be avoided), so I'm wondering if I could either get feedback on the style of writing, or on which bits can be broken, since I've tried to make it fairly robust. The idea is to...
The locks of the doors present in the maze are of 7 types: A, B, C, D, E, F and G. There are also some copies of keys around the maze, which can be of types a, b, c, d, e, f or g. A key of type a opens a door of type A, a key of type b opens a door of type B etc. Once a door is opened with a key, the door remains opene...
I've made a Sudoku generator. It works but it's clearly not very efficient. I'm looking for ways to optimize and speed it up a bit. You can check it out in this fiddle. The results are printed to the JS console with how many iterations it takes to find a working puzzle and the Sudoku array printed to console.table(). W...
For an assignment, I am told to write two methods: incrementDay() and incrementMonth(): incrementDay() This method takes no input and returns nothing. If the previous month's balance was not paid in full, the credit card charges interest on the current balance after each day. To do this, the class will need two ...
As I'm new to Redis, I would like to get a review / improvement suggestions from Redis / Lua experts on the following problem and the solution I have found so far. Problem The context is: an e-commerce system used by multiple users purchasing various items at different prices. Because of regulation, user purchases must...
I'm following this presentation. At the very end there's an exercise about solving Fibonacci and says that instead of addition, make the operation setteable by a function. Is the following is a good solution? How close might it be to what Rob Pike would have written? package main import "fmt" func add(a, b int) int {...
I've been learning Java for 4 weeks now twice a week and I wanted to test myself to see what I could do. I'd love to see what you think and how I can make it better. public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); char a1 = ' '; char a2 = ' '; char a3 = ' '; char...
My goal is to create a URL query params from std::map<std::string, std::string>. For example, we call to_query_params( {{"one","1"},{"two","2"}} ) and we get ?one=1&two=2. Is this a good way of doing it? std::string to_query_params(std::map<std::string, std::string> map) { if (map.empty()){ return ""; }...
I'm using an HTML editor to insert code into a website. When you embed media like an iframe element, it deletes the code. It's apparently a bug with TINYMce and grappelli, so as a workaround, I insert non-media content into the HTML editor: <div id=”youtube1”><p>width="854" height="480" src="https://www.youtube.com/emb...
I'm really just looking for some advice on my current code and with moving forward. As you can see, I have a pointer to my student list and data (which just haven't been made yet). #include<iostream> #include<cstdio> #include<cstdlib> using namespace std; class List{ //Building the base of the program, being the node...
I needed to address an issue that I met with quite a bit, which has sort of a bag of data that I can easily add items and remove them, and iterate over them at any point without an issue. First thing that came to mind was to use a linked list: easy to add, easy to remove, without having blank spaces in between, but the...
I made a program that prints out a diamond with n lines. n is equal to whatever the user inputted. I know I overuse the ternary or conditional operator, but in my opinion, it makes the code more compact, and since I am the only one reading my code, readability doesn't matter to me. My friend challenged me to write one ...
Leon asked a question which got closed both here and at Stack Overflow, but I kind of liked the idea, so I implemented a working version of his code, which I now want reviewed. With regards to Leon's original code I've done the following improvement (in case he reads this new post): Renamed variables so that they have...
Without any specific implementation details, how would you create a bitmask type that wraps binary arithmetic into something easy to read? Ideally, this would be used with an enum, which is why there are some generic methods. Some Questions Is the type a struct or class? Is the type generic or are certain methods gene...
I have a photo list page where each photo has multiple tags (as spaced words). I'm trying to display most of the tags on the page after: Removing duplicate tags Sorting tags by having most occurring tags first The code looks like this: $tags1 = "red blue green yellow colors"; $tags2 = "blue green grass tree garden";...
This class allows me to quote strings being sent to an output stream: class Quote{ public: friend std::ostream& operator<<(std::ostream& os, const Quote& obj){ obj.write(os); return os; } Quote() = delete; Quote(const string & text): text(text){} void write(ostream & os) const{ ...
I need to develop a dictionary program so I used a trie data structure to implement it. I have created a array of object with size of 26 - so each object of class Dict will have 26 sub objects like a child. This program takes no input from user for now. I gave my input in main function. but it will print all the words ...
I am using the following query to obtain a employee with his information, and get all his related roles. The query underneath works fine when we check only 1 location taking only about 0.002 seconds to process, but once we go over ~800 locations it sometimes takes up to 8 full seconds to process the request. In the act...
I have worked on the Ford-Fulkerson algorithm and have following code. The code works fine, but I fill I could do more code optimization, I have worked on it for few days. Question: Is there any remarks or comments for code improvement? /** * src = source * dst = destination */ public class MaxFlowAlgo { priv...
I have many repositories stored in a map. User chooses some of them and then a downloading begins. Repository may be one of 4 types (see code below). /** * Data class that stores settings of a connection to repository. * Lombok's annotations are used to generate some methods. */ @Getter @EqualsAndHashCode public cl...
I'm trying to do some util class to operate on enums - convert Enums to its special strings representation via interface method. String stored in enum constructors. public enum StatusEnum implements HumanReadableEnum { NOT_VERIFIED("Not verified message"), INVALID("Invalid message"), APPROVED("Approved mess...
I'm very new to python and only vaguely remember OOP from doing some Java a few years ago so I don't know what the best way to do this is. I've build a bunch of classes that represent a crawler that scrapes images from a specific website. e.g: for the website stocksnap I have a class StocksnapCrawler I have 9 of these ...
I translated the Wikipedia pseudo-code into Python code (little changes only were required), but I do not like the end result, as it looks like C with all those while loops and counters. The fact is that I cannot use a for loop as i is needed to preserve state between loops. I also added an inspect method to actually s...
I'm pretty new to Ruby, and working in the IT security field, I thought to make something useful to my work while I learn the language (even though I'm reinventing the wheel). The script is working fine and doing what I wanted it to, first checking connectivity thanks to ICMP and then bruteforcing through a wordlist to...
This is a follow up question for this question: Implementation of a dynamic list-like array This is an implementation of an array that behaves like a list, granting me an easy and quick way to: quickly add items iterate over them without caring for empty spots in the array quickly remove iterated items After follo...
I'm nearing the end of my first MVC project which uses VB.Net and MVC5. I've started writing all my view models in a very similar fashion. This has been working well for me, but being the first person on my team to use MVC, and fairly new to being a professional developer I'm curious if this is an acceptable way to w...
I have a GUI file which is currently being ran by VBS, but I have a few issues: PowerShell v2 is what is being run on every machine and I cant change that, runs very slow on first time launch. it takes about 10secs then my .ps1 will run, which can take another 10secs depending on the speed, but on second run it loads p...
Please can someone advise me, how I could use a loop for this code, in the interests of code reuse. My code is as follows public class Clubs{ public void printGreeting(int choice, String clubName[]) { System.out.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); if (choice==1){ System.out.prin...
I have a small node.js app (MY FIRST) I have models using mongoose, controllers for each and a seperate route, I feel like this is pretty good seperation but something about the number of route files i would have to create seems not route, basically every section of the restful api would have a route, model and control...
My project uses a Promise polyfill and the fetch polyfill, that I am only including if the browser does not yet support it // Browser doesn't have Promise if (!window.Promise) { require(['es6-promise'], function(promise) { promise.polyfill(); // Browser doesn't have Promise or fetch if (!window.fetch) { ...
I was going through this code for implementing Warshall's algorithm. I think the time complexity for this simple problem is huge because there are too many loops running here. The time complexity for this code should be \$O(n^3)\$. Is there a way to optimize this code so that the time complexity can be reduced a bit?...
In a previous post I asked for a review on some code I wrote for an open-source project of mine. After the review I made some changes and I wanted to ask you for another round. This time I'm not putting all the comments in the code because I'm still working on them. Other than that, I'd ask you guys to check and indic...
I am writing a CAN bus logger application and need to format messages as quick as possible in order to prevent buffer overflows on our device. In some cases I am quick enough, but under heavy loads it is still pretty slow. I believe the bulk of the problem happens in my formatting block (I am using TPL to separate the ...
I'm back with improved version of previous Deca dimensional array sort function. This one is not just 10 dimension limited. It could be extended to unlimited number of dimensions by simply adding rows using same logic under each Select case iteration. A limit still exists, which is it's the memory limit. Compared with ...
It is currently unfinished; only case 1 of the switch(hunt) is available for choosing. Please give detailed feedback and/or quality explanations on improvements or fixes; I'm brand new to C++ and don't know a lot. #include <iostream> #include <string> #include <time.h> #include <stdio.h> #include <stdlib.h> int main(...
Following this post and the one before that, here I am asking for a review on another piece of code: the connection among two pins. As usual, be merciless in your review. Here it goes: public class PinConnection : IObserver<Pin> { #region variables private Pin _from; private Pin _to; private IDisposable...
I have been learning C++ programming. What you see here is all that I know how to do at this point. I look forward to learning more and I know there are better ways to accomplish a task such as calculating, or a less verbose method for displaying information. I want to hear from more experienced developers and engineer...
Problem 22, here, asks the following: Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list ...
From time to time I translate some Android apps: the developer sends me an XML file, e.g. <string name="foo">Foo</string> <string name="baz">Baz</string> and I send him back an XML file where the content of each element has been translated, e.g. <string name="foo">Translated foo</string> <string name="baz">Translated ...
Sometimes I need to write a simple Java console applications and menu look: do { System.out.println("please select menu item"); System.out.println("1-create, 2-remove, 3 - rename"); int select; Scanner scanner = new Scanner(System.in); select = scanner.nextInt(); switch (select) { case ...
Please review and tell me what improvements can be made: package trees; import java.util.LinkedList; import java.util.Queue; public class PrintBSTLevelByLevel { public static class Node { int data; Node left; Node right; Node(int val){ this.data = val; ...
I need to rename a large list of csv files that are generated from 3 different servers. The files are produced with a date stamp as the extension, which I need to move in each file name to retain the date stamp. The file name format before editing is as: billing.pps-svr01.csv.2015-09-01 billing.pps-svr02.csv.2015-09-0...
I have written a change calculator using Ada. when the user inputs an amount of money it returns a list of the coins and bills needed to create that total. It starts off by trying to use the largest money types then tries smaller ones. I am still learning how to use Ada and would like to know how i can make better use ...
I've wanted to make a calculator for a long time now, so I wrote one of my first parsers, where the input is in reverse polish notation, \$1 \ 1 +\$ becomes \$2\$. It supports to following operators; +, -, *, /, // floor division, ^ or ** exponent, and % or mod modulo. While it's the best calculator I've written, the t...
This is a simple program to convert miles, yards, feet, and inches appropriately. Everything intended for works but I feel my program is very redundant. How can I make it more efficient and less lines of code? I tried % but failed to find way to increment next values. #include <iostream> using namespace std; //NO GLOB...
Seeing as it's October, I thought I'd do the community challenge. Due to my inexperience coding in Groovy, I decided to give Groovy a go. I'm not sure how well I followed Groovy conventions, and the rendering is quite slow. It seem that the slow rendering might have to do with locking when writing to the BufferredImage...
I have written a network chat program as my first major project in Perl. It makes simple use of REGEXP's, modules, sockets, command-line option parsing, and forking and uses these features to produce a fairly simple client-server chat program with a basic nickname system that is capable of handling as many clients at o...
Inspired by the recent Stack Overflow question “Safely release a resource on a different thread”, I wrote the following destruction_service<T>. Please refer to the class template's DocString for more information (and let me know in your review if it is insufficient). destruction_service.hxx /** * @file destruction_se...