instruction
stringlengths
71
95.1k
I have a list and I want to made some manipulation on it. This my list : data_two = { '2021-12-05': [['Mesure 1', { 'valeur': 0, 'name': 'User 2' }, { 'valeur': 22.6, 'name': 'User 1' } ],['Mesure 2', { ...
Graph Interface: import java.util.*; public interface Graph<T> { boolean addEdge(T src, Edge edge); boolean removeEdge(T source, T destination); boolean addVertex(T vertex); boolean removeVertex(T vertex); void printAdjacencyList(); List<Edge> getNeighbours(T vertex); Map<T, List<E...
I've implemented the Nelder-Mead optimization algorithm in C++. I found this document to be a very good explanation of how the algorithm works, but I'll try my best to explain it (with an example) here so it's clear for everyone. The problem I'm trying to optimize is very simple : I'm trying to find the best a,b,c coef...
Background Some very good observations were made about my original code in the 2 answers to this question. In this version I have attempted to reduce cyclic complexity and class coupling even more as well as improve maintainability. The worst offenders of maintainability are now Visual Studio generated modules for the ...
This question provides the code behind the dialogs in the C# refactoring question. I'd like a review of this code as well. I'm not currently using databinding anywhere, and there is really only one place that it might help which is in the add or edit tenant form. This question is separate from the other question becaus...
I'm new to common lisp. I basically translated a procedural implementation of balanced parenthesis using a stack to common lisp. How can I make my implementation more lispy? (defvar str-1 "(this {is [it ()]})") (defvar str-2 "(this [is {it} )") (defun matchp (a b) "Check if brackets form the correct pair." (if...
My code works but I am looking for an efficient way to implement the idea with out having to repeat the same code block inside the function Recin() (record Input function is stated in the code) in order to assign a new key. I'm using windows for this project. here is the code: import playsound as ps import keyboard as ...
I have a working function with too many if/else statements (pylint). The code works but it's not good. I try to improve it but I have some tunnelvision. Can someone help me to improve the code? So depending on a list of stacks, an environment (prod, nonprod or all) and a list of account IDs there can be filtered on whi...
Context We are a multi-academy trust designing a database system (more of a warehousing solution) to aggregate educational data from our 13 schools into a single source. The data will be mostly consumed in BI applications for visualizing and performing analysis. One of the biggest hurdles we've had to overcome is retai...
I have the following code function x () { return a ? (b ? 'result2' : 'result1') : 'result1'; } Is there a better way to combine these two conditions into one?
I implemented the following code to calculate the YTD sum in Pandas: def calculateYTDSum(df:pd.DataFrame)->pd.DataFrame: '''Calculates the YTD sum of numeric values in a dataframe. This assumes the input dataframe contains a "quarter" column of type "Quarter" ''' ans = (df .sort_va...
The package is essentially a small wrapper around the stdlib logger that provides a very simple, easy to use logger that can toggle between different log levels (DEBUG, INFO, WARNING, ERROR). Log levels control which log messages actually get written to the io.Writer. Also adds the ability to get new references/pointer...
This is my second Django project for an actual client and I want some review on one of my important models. This model will be responsible for authenticating users using their E-Mail Addresses and Passwords. At the same time it will store all of the details for each specific user which later will be used to identify wh...
I have these game logs which I need to clean, process and find the frequency of game actions. These game actions should be a triplet. In the below given list, "1|123|/jump", "2|123|/flip", "3|123|/crouch" is a triplet and also "2|123|/flip", "3|123|/crouch", "8|123|/dance". Similarly, "4|999|/jump", "5|999|/flip", "6|...
I have an assignment where I write a Collatz Conjecture program for a series of starting values from 1 to N and make two plots: number of iterations vs starting value and computed numbers vs starting value. The assignment prompt is: Now modify your program so that it computes 3 vectors. The first vector s(k) is the st...
I wrote code to automate sending emails using smtp in Python. Below is my code I've written. However, I think there might be a simpler way (simplified code)....could you please review and give me feedback? In the email list csv file, the first column contains full names (e.g. Joe.Bloke) and the second column contains f...
I need a graph for multiple pathfinding algorithms,so I wanted to ask whether my new graph implementation is ok. Would someone who works as a developer in related fields(Graphs, Pathfinding, Algorithms) do things similarly. Node class: #include "Coordinates.hpp" #include <stdint.h> namespace Pathfinding::Datastructur...
This is a code that generates the periodic table where each element is represented as a button and info about the element is produced when that specific button is pressed. I wanted to make this code shorter by changing the way the buttons (elements) for each column of the periodic table are generated. Plus, how to add ...
I'm new to assembly and I'm learning on my own, so I'd appreciate the feedback. My priorities are correctness (on all MIPS-32 with sllv) > speed > readability (including following idioms). I've only "manually" tested the code, but it seems correct for numbers 0-40, and on/around a selection of larger primes (including ...
I am beginner to Haskell. Here is my solution to Advent of Code 2021 Day 3. Let me know what you think. I was looking at the transpose function and decided not to use head & tail function. Given the data 00100 11110 10110 10111 10101 01111 00111 11100 10000 11001 00010 01010 Problem 1 create a new binary number with m...
My project creates a report based on test results which are stored in database table associated with a JobNumber. The test results for a particular JobNumber may be all be from the same date or from a range of dates. I create a report to display results for a single JobNumber and this report contains a string to displa...
So I found this funky programming challenge somewhere on Quora. The idea is to take the head of a singly-linked list, and reverse a specific sublist. The requirements are: runs in constant space, makes only one pass over the master list. After hours of hard work, I came with the following solution: com.quora.algo.lis...
I have the following solution to this problem. The idea is to compute the maximum width of a binary search tree. The width of a BST on a particular depth is defined as the distance from the leftmost non-null node to the rightmost non-null node at that depth. This implementation proceeds downwards from the root node in ...
The question is as follows: Rotate an NxN matrix clockwise by one element and display the new matrix. For example, if A = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10,11,12], [13,14,15,16]] Then the rotated matrix obtained from A will be [[5, 1, 2, 3], [9, 10, 6, 4], [13, 11, 7, 8], [14, 15, 16, 12]]...
This is a follow-up question for 3D Inverse Discrete Cosine Transformation Implementation in C++. After checking G. Sliepen's answer, I am trying to update the part of width and height checking of Image class. Instead using macros, there are several template functions is_width_same, is_height_same, is_size_same, assert...
I've been working on random forest algorithm for classification with roulette selection to find best splits. I came up with this homebrew based on this article https://machinelearningmastery.com/implement-random-forest-scratch-python/. It works well enough, but I have a major problem with execution time. It's reasonabl...
I wrote some code to make calls to a public API. The code is correct as required as usual. My goal is to make the code as self-explanatory, maintainable and robust as possible. I also tried to make the code extendable, such that it would be easy to add different API calls in the future. Execution speed or memory-effici...
I want to replace multiple matches of a Regex with different values from a map. I have for example the following string #id#_#date#_#value#_additional_text. I now want to replace the parts #xxx# with the corresponding values from a map. (The string could change so that I don't exactly know what kind of patterns are in ...
I am trying to create a basic money class that fits into a small console banking application I am making. Money.h #pragma once #include <string> class Money { private: long pounds; int pence; public: Money(); // Overloaded constructors explicit Money(long pounds); Money(long pounds, int pence)...
Hello I am an absolute beginner with Kotlin and Android Studio. I want to hear what I could do better for the next time or any flaws my code has. The code implements a four-function calculator (+ - ✕ ÷). The MainActivity file: import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.view...
I have very limited experience in Java and slightly more in C# (just doing Advent of Code problems last month), so I'm not familiar with how to write idiomatic Kotlin. This class implements an infinite generator for the Fibonacci sequence. import java.math.BigInteger class FibonacciGenerator { private var fibs = a...
I am learning basic data structures in Python. I'm not confident enough if my implementations are OK or I miss any corner cases. So please check my code for Singly Linked List and Let me know where I can improve. """ Singly Linked List Implementation """ class Node: """ Constructor for Node class takes ...
Below is a complete implementation of RC4 in ARM assembly. Unit tests pass, including comparison to C implementation and to published test vectors. I'm appreciative of all feedback, comments (things you like and things you don't), and suggestions, but particularly value your thoughts on: Performance. Could the code ...
my winform app contains a combo box, a button and two datagridview among other controls. Both DGV's have 3 columns. When I select an item/items from one or both of the DGV's and hit the button the app would create/open a word file(*.docx) and first add a header and a date on the top,then add a table with the selected D...
So I've been droodling on a blackjack project, and one of the issues we need to solve is how to shuffle the cards. I've implemented a method that simulates hand shuffling (E.g split the shoe (either 2, 4, 6, 8 decks) into two heaps, and then merge a handful of cards together alternating between overhand and riffle shuf...
The following code is a working solution for the balanced parentheses problem. I'm really just wondering about coding style here when it comes to separating out related if-statements. When there are two related if-statements, and where the second is run if the first is run, should I merge all checks into one complete i...
I have some parallel.for one inside another. the last parallel.for have a normal for that should Create images by combining other images. the images are generated but the memory consumed by the process slowly increases. I'm using net core 6, and as you can see I have dispatched all the Bitmaps and the Graphics objects....
I needed a method which would print a square with 4 values in each corner, my current "prototype" looks like this: void Renderer::drawNode(sf::RenderWindow &window, const Node &node) { float nodesHor = static_cast<float>(node.location.width); float nodesVert = static_cast<float>(node.location.height...
I want to implement my own Pair template class which will be used as the key in a HashMap or possibly other collections. What I have done so far is this: import java.util.Objects; public class Pair<T1, T2> { public T1 first; public T2 second; public Pair(T1 first, T2 second) { this.first = first;...
Some time ago, I implemented an emailing library to simplify sending emails for several web applications and daemons. As usual, I am interested in improving my code. """Library for e-mailing.""" from __future__ import annotations from configparser import ConfigParser, SectionProxy from email.charset import Charset, QP...
I have a for loop that contains multiple if -conditions. The speed of this function is not critical for my application at the moment but I'd like to learn and have a few tips how to optimize my code to make it run faster. In my loop, I get first 5 A's, 5 B's and first 2 C's of each type C_1 and C_2. The code is working...
I designed a class for debug builds which does not incur any overhead in release mode. A usecase is for example: I have a function and I want to count how often it is called. For this I could write the following function void f() { #ifndef NDEBUG static int i = 0; ++i; std::cout << "Counter:...
I am trying to write a PowerShell script that will check a folder for any files and then for every file it will grab part of the filename and check it against the SQL database. If it found a match, it will rename the file and move it to another location. If it did not find a match, then it will move the file to another...
I have created a script for parsing ADL and the code looks like below. Example ADL file I am looking for suggestions to divide the code in multiple methods and make it more readable. Thanks block_names = ("object", "region", "info", "table ") keywords = ("define", "select", "reject", "take", "using", "sort", "weight", ...
This is a simple rock, paper scissors game I attempted as part of the Automate the Boring Stuff with Python course on Udemy. The scope of the game is for the user to enter a valid input, the system then returns the result and the current score. If the user wishes to quit the game he/she enters 'q' So far I have covered...
This code counts the frequency of n-grams in a random Wikipedia corpus, as of now, it downloads everything, than performs all the counting. In your opinion is there a way to perform downloading and counting simultaneously while keeping the code reasonably simple to improve the performance? import wikipedia as wk import...
Is this a correct implementation in Haskell of a proof checker for first order logic with equality? I am most interested in if it is correct, and if the functions can be made clearer. I would like it to be useful for elucidating the definitions given in textbooks. {- Hilbert style first order mathematical logic with eq...
What can I do to reduce the number of steps until I get to the final code result? Is it possible or is this the way with the least number of lines of code? import requests headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" ...
I don't know exactly what to name this, but I was refactoring a code snippet and looking at this constant users I thought I'd do this destructuring: Before: async queryDBUsers({ commit }) { await getDocs(collection(db, "users")) .then((querySnapshot) => { const users = querySnapshot.docs.map((doc) => ({ ...
Consider the following def __genereate_initial_guess(dictonary) -> tuple[dict, dict]: joined_lst = [dictonary["main"], dictonary["background"]] config_input_params = {} config_input_params_limits = {} for key, kind in zip(dictonary,joined_lst): tmp_lst_2 = [] tmp...
I've created a basic client/server model using user defined signals (SIGUSR1 representing bit 1 and SIGUSR2 for bit 0). At a high level the algorithm looks something like: The server reveals its PID and starts listening. The client takes a string from standard input, encodes it to binary and starts streaming it to the...
I wrote an algorithm to build 1000 different random graphs given number of nodes and node degree. Node degree is maintained between the random graphs. I am building these random graphs to input to a statistical test which says given a certain graph what are the chances of finding certain edges by chance. My current alg...
I have several enums that all implement this interface: public interface SelectOption { String getId(); String getLabel(); } Here's an example: public enum AuthType implements SelectOption { BASIC("basic", "Basic Auth"), OAUTH("oauth", "OAuth"), TOKEN("token", "Bearer Token"); private final St...
I've written and used this code in my apps whenever needed to convert any Western Arabic numerals into Eastern Arabic (or better say, Persian/Farsi) numerals in any Persian text. It works fine as expected, but I'm having a look at it now to reuse it, and I'm wondering if I could optimize this to reduced the repeated li...
I have a buffer that contains the HTTP header, which contains the Content-Length string indicating how big the file is that needs to be downloaded. I am looking to write a generic function for parsing a substring and eventually a value that needs to be converted to an int from a string. The following approach seems to ...
I have multiple pre-compiled dynamic libraries that use the same extern "C" function names. The functions can behave differently for each dynamic library. Ultimately these methods will be accessed in a SystemVerilog simulation via DPI (Direct Program Interface). When trying to link all the libraries to my simulator, I ...
Tic-Tac-Toe from scratch. Code Ugliness check before I implement the win-condition and maybe get set in to bad habits. Questions: As implemented: Better to pass board between functions or set as a global variable? OK to use same variable name within different functions? OOP: Would you recommend using Object Orientated ...
Context Postgresql has an INHERITS keyword which lets you inherit one table from another, but it is known to have several caveats, mainly because it is not a true column-based inheritance. The main problem I encountered with the provided INHERITS feature is that other tables cannot reference the parent_id field in the ...
A few days ago I requested a review of my functools extension library. Since I did not have any unit tests for it, I started writing some for the revised version of this library. I'd like some feedback on whether these tests are sensible and how they may be improved upon. Revised library (test subject) functoolsplus.py...
I have this tool for permuting bits in BitSets: com.stackexchange.codereview.util.BitPermutation.java: package com.stackexchange.codereview.util; import java.util.BitSet; import java.util.Objects; /** * This class is responsible for representing the bit permutations of * {@code long} values. It, however, supports ...
I'm relatively new to programming, as in my second semester of college. To practice C, I started work on a chess game. I'm wondering if there are ways I could improve my code, make it look more professional, or reduce some blocks of inefficient code. I have more ideas on things to add to the game to make it more user-f...
I decided to create a portable Emacs config and install packages I use if it's necessary on a fresh computer. Here is what I've done: ; loop through names of packages and install them if needed (let ((packages '('use-package 'yasnippet 'expand-region 'bm 'undo-tree)) (content-not-refreshed t) ) (mapc ...
Given a number as a string, no leading zeros, determine the sum of all integer values of substrings of the string. Given an integer as a string, sum all of its substrings cast as integers. As the number may become large, return the value modulo 10**9+7. Example: n='42' ans=4+2+42=48 Full problem: https://www.hackerra...
I've tried to write an event dispatcher for a GLFW/Glad library. However I am not very used to writing efficient code (spent the majority of my life writing in C# and performance was never really the focus of what I learnt in university). The code works but I'm unsure if its overcomplicated or simply plain stupid. I w...
I have a set of JSON files stored in a folder; the folder structure is as follows: Main_folder ----F1 -----I1 ------X.json -----I2 -------X.json . . . . . . In all, the main folder contains 36 subfolders which in turn contain 10 subfolders each having a JSON file. The JSON file is a dictionary of a lists X={'a':[conta...
This is a function that reads a setting data from DB. public function getSetting(Request $request) { $user = Auth::user(); $tableName = $request->name; $setting = \DB::table($tableName)->where('id', $user->id)->first(); return response()->json($setting, '200', ['Content-Type' => ...
Below is the code for a str_split() function; this function is not present in standard C library. Syntax: char **str_split(const char *str, const char *delim, long max_splits); Full documentation is in comments in the header file. Code is below: str_split.c #include "str_split.h" #include <stdio.h> #include <stdlib....
I wrote a tiny game using Phaser 3, here is the code. var total_attack = 0; var isMagicReady = false; class BootScene extends Phaser.Scene { constructor() { super({ key: 'BootScene' }); console.log(total_attack); } preload() { this.load.path = 'https://raw.githubusercontent.com/albert10jp/web_rpg/m...
I am new to programming and I've only learnt basics of C as far as functions. I decided to solve this problem given in Harvard CS50 course. Please review my code. We had to write a program which takes a height from the user and prints a pyramid of that height. How the program might work if the user inputs 8 when prompt...
Last time we posted here we were overwhelmed by the useful feedback. We've had another go at OOP/programming - this time in Java. Very different than Python! As before we have lots of concerns at the macro level (is our choice of objects any good?) and the micro level. We'd be grateful for any suggestions for improveme...
Question is: Write a program that asks the user if he or she wants to convert lengths or weights. If the user chooses lengths, then the program asks the user if he or she wants to convert from feet and inches to meters and centimeters or from meters and centimeters to feet and inches. If the user chooses weights, a sim...
For work, I extract information from HTML and XML sources to save in databases. The objective is to generate JSON representing the source document's information and its relationships in order to 1) extract key information for database columns, like the title of a court case, and 2) to save the whole resulting JSON stru...
I have realized that all the digital filters of the IIR type have the same structure. They are described by difference equation in following form: $$ y(k) = b_0\cdot x(k) + b_1\cdot x(k-1) + \ldots + b_M\cdot x(k-M) -a_1\cdot y(k-1) - a_2\cdot y(k-2) - \ldots - a_N\cdot y(k-N) $$ Based on that I have attempte...
Or in other words, a student database program. What does the code do? Checks if there is a text file - if not, creates one with table such as: student's name student's surname student's id and so on. If the file exists, creates a student from the struct, takes data and prints one student's info to a line, other stud...
Was trying to create a password generator like the one Bitwarden has... Curious if anyone sees any issues with this? (wordlist shortened for readability) There perhaps there's a more efficient way I've over looked? Code $wl = @("abacus","abdomen","abdominal","abide","abiding","ability","ablaze","able","abnormal","abras...
I have been unable to find a Python function for performing beta-binomial test. There is, however, a binomial test function in the scipy.stats.binomtest and I have used it to get ideas for the implementation of the beta-binomial test. As I am not very confident of my statistical knowledge, it would be great if someone ...
This code works but is cluttered and I think could be improved in terms of how it is implemented. Basically my code works - what it does is from the start location, it chooses a random direction and then moves in that direction, stores the location and repeats until there are no more directions to move. Then it works b...
As a challenge/fun activity/task, I have implemented my version of std::is_constructible. Here is the source code: #include <cbrainx/cbrainx.hpp> #include <iostream> template <typename T, typename ...V> auto aux(long) -> cbx::false_type; template <typename T, typename ...V> static auto aux(int) -> cbx::type_switch_t<...
I have to find an algorithm to solve this question : You have an array with n integers in it. Make an algorithm that changes array so that there are no consecutive expressions in it and returns the amount of changes to be made. For example in array [1,1,2,2,2] the smallest amount of changes is 2 to get it to [1,3,2,1...
I'd like to hear your constructive criticisms about my first OOP project. I explain more what I actually do in the code's comments, and I tried to be quite explanatory with names etc. import math as m class projectileMotion(): """ This class calculate the movement of a projectile using its initial velocity ...
I wrote this first function that use a JSON datafile as an input def jsonfile_loader_work_rate(filename): '''Load the json file, to retrieve the interventions id and the cars id ''' try: with open(filename, "r") as jsonfile: json_data = json.load(jsonfile) cars = [ js...
I have a few lines where I am trying to get a list of the 25 most popular Items sold on an E-Commerce web site. The code works but I would like hints on how to optimize it. var ecommerceItems = await _context.BmaEcItems .Select(e => e.Itemnmbr) .ToListAsync(); IList<PopularItem>...
I am re-implementing a web-application, partially as a learning exercise to learn nim as well as multi-threaded programming. As part of that learning exercise, I want to implement connection pooling as there is no library or package in nim that I am aware of that implements it for me, while also allowing me to use the ...
I've tried to make a custom file upload input. The goal was to just have a nicer looking file input compared to its unaltered version. One thing I don't like is the CSS. I don't like altering the position, but maybe that is just how it has to be? (Since the input and input button are hidden from view. It was a bit diff...
I've made a 2 player game in c# console that is a ping pong game. I've made it in more or less 4 hours and in my opinion it is the best performing game I've made so far. Just to let you know, I am a new programmer and I've started with C# coding, as I believe it's a good beginner language. I've made a few C# console pr...
I am building a website template and I wrote this code to pass a variable from a class list. So, in this example, if you have div with a class of modal as well as a class with a prefix of delay- that will be able to set the delay of the modal, directly from the class. Example: <div class="modal delay-10 hidden"> Will ...
I've written a program to convert a hex-encoded string to base64, and here is my code. My main concerns are: Optimizations - Is my code sufficiently optimized and if any more optimization is possible. Memory leaks - Is there any scope for memory leaks. Readability #include <stdio.h> #include <stdlib.h> #include <stdi...
I'm making a project that will scrape some online store for an item, gets the data and stores it in a remote database that I have, and also able to read the database and display the data on a dashboard that uses Flask. It roughly works now, but I'd appreciate some inputs on how to make the design better, since I'm a be...
I am trying to learn UI design so I threw together a Bayes Calculator (i.e. calculate the posterior probability of being sick given a positive/negative test result using the specificity, sensitivity of the test and current incidence rate). Since I already wrote markdown for a static site generator (hugo) I similarly cr...
For a project, I'm using 3 columns to define teeth positions in a database. For these positions, I want to generate numbers according to this link. Currently, I'm using a Teeth and Section enum, which has the numbers according to the link. The Section defines which range, and the Teeth defines the number. class Sectio...
An app has a feature that's much like any calendar application (like the Outlook calendar for example). Consequently, I need to do a lot of date logic. I wrote a class with date calculation methods that are useful in any scenario. You can choose in what resolution of time you want to view the calendar, like a whole mon...
I have tried my hand at the abstract factory pattern in C++: #include <iostream> class AbstractFactory; class AbstractDoor; class AbstractWindow; class AbstractDoor; class AbstractFactory { public: virtual AbstractWindow* buildWindow() = 0; virtual AbstractDoor* buildDoor() = 0; }; class AbstractDoor { publi...
recently solving a data structure question and counter below question Given an integer array, find the largest subarray formed by consecutive integers. The subarray should contain all distinct values. 2 set of examples as below input = [2, 0, 2, 1, 4, 3, 0, 0]; // Output: The largest subarray is [ 0, 2, 1, 4, 3 ] ...
I have the below code that takes a sequence file and another file with a list of contigs and extracts the sequences and writes them to a file, specifically based on the file with the contig list. The code works great.. However, I'm having to do SeqIO.parse('SAMPLE.fasta', 'fasta') inside the for-loop every time making ...
I am developing a scala function called TennisGameStatus which returns the state of tennis games between two players. To remind, here are the rules of tennis games : - 1st gain: 15 pts - 2nd gain: 30 pts - 3rd gain: 40 pts if both players get 40 scores, then, there are many states : - "DEUCE" if both are equal to ...
Problem: https://codeforces.com/problemset/problem/230/A Kirito is stuck on a level of the MMORPG he is playing now. To move on in the game, he's got to defeat all \$n\$ dragons that live on this level. Kirito and the dragons have strength, which is represented by an integer. In the duel between two opponents the duel...
I wrote a simple algorithm to generate 1000 random graphs given total nodes and associated node degree. Graph is undirected with multiple edges and no self-loops. My current algorithm is very slow: Graph properties: no self-loops, undirected, multiple edges (i.e. many edges b/w same pair of vertices) Pick 2 random nod...
I've been designing a React component to select countries that a user has visited, grouped by continent. This component is a part of larger project but is relatively self contained. This is my first time using React (and JS really!) and I feel like passing props from the top level component down through other component...
I've revised the code in the light of comments (the initial post was here). I've initially just redone the logic to get a random word for the category chosen by the player. I'd appreciate any feedback on that, then I'll revise the rest of it. Main points addressed: separate out GUI code and use streams. I'm sure there'...
So I'm trying to understand the concept of descriptors and gathered some code together and made an exampel out of different sources. Like the offical documentation and StackOverflow answers. I'd hope someone can me tell some tricks about this concept or how to make this code better in general. Thanks in advanced. PS: I...