Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Search
This can be done using conditional types. I defined these helper types: enum Role { server, client }; type PossiblyHiddenFromClients<R extends Role, T> = T | (R extends Role.client ? un...
Simply put: parenthesis are used whenever we suspect that there may be operator precedence issues. Either because the user passed an expression containing several operands and operators to the...
I've been thinking about how the community might bring more contributors to software.codidact. One of the ways is to simply pitch codidact in questions, answers, and comments in stackoverflow. I'm ...
Note: this is mostly a personal preference that I use when moderating the posts Generally, no While "Hello" and "Thank you" are noise (overhead) for the questions and answers, they are also part ...
tl;dr The purpose of addEventListener is to define what happens when an event is triggered at some element. But it also allows us to implement event delegation, due to the bubbling/propagation beh...
The question https://software.codidact.com/posts/281517 is currently voted at -3. I wrote several comments to explain why, so the author can hopefully ask better questions in the future. This morn...
This is usually handled by the shell, so it depends on the shell. That said, the relevant command is named the same across many different shells. Namely, the disown command. You can probably enter ...
I want to run a program, e.g. Firefox, from terminal, but whenever I close the terminal, program closes too. How to detach my terminal window from a program ran from it?
I am looking copy files platform-dependently on Linux, Oracle Solaris, MacOS, BSDs, and Windows. I have found some system calls for each platform, namely sendfile(), copy_file_range(), fcopyfile()...
There are many ways to get the previous states of HEAD, and which one to use will depend on each situation. Git keeps reference logs (also called "reflogs"), that "record when the tips of branch...
Let's say I have this class: class myService { private boolean foo(T arg) { return arg == 42; } public Response bar(U arg) { if(foo(U.field)) { return Response.st...
void (*ptr)() defines a function pointer. It says that ptr is a pointer to a function. But that function must have a void return type, and take an arbitrary number of parameters (that's what the em...
I am developing a web app that is tied to a database. My codebase is stored on a private GitLab instance. I would like to set up a workflow that would look something like this: I have a developm...
I have a PHP script that uses CURL to return a JSON result that looks //Curl set up code $result = curl_exec($ch); //Error checking code $json = json_decode($result, true); //Code to process r...
These are fine, IMO: Here is my specification of what the program should do /--/. I'm stuck at x, (optionally: here is my code), where do I go from here? Is this implementation of x (code follows)...
Which concept is best for managed background services? 1. RunAsync(CancellationToken): interface IWorker { Task RunAsync(CancellationToken cancellationToken = default); } ... IWorker worker =...
The site is called Software Development, not "Applications". Meaning programming. On-topic: Questions about different behavior of web browsers in the context of web application programming. Questi...
I've been doing a lot of reading on implementing the repository pattern in C# projects and found controversy, or shall I say some strong criticism, made by seemingly very smart people with previous...
An example for a current problem; the file downloaded can have a trivial name such as install.sh and collide with similar files (the rm is especially problematic here I think). This is why tem...
After I wrote this answer, I could notice that, when there's inline code in the last line of a paragraph, sometimes the border-bottom of the inline code text is not displayed. One case is when the...
Some thoughts: Consider using Github (or something like that, but I suggest Github due to its popularity) to share the project. It allows us not only to write some code but open PR with sugges...
I have tried many different ways to do this with apache but the server seems to not be receiving the data. Stacktraces are not being printed so I can only assume I have the request set up wrong for...
Something like this query should work for you: MATCH (a:Person)-[:IS_SON]->()-[:WAS_BORN]->(b:Country) WITH a, count(DISTINCT b) AS birthplaces WHERE birthplaces = 1 RETURN a Note that...
Summary I've fixed the issue and what follows is the best explanation I have so far. What I had described in the OP were some of the observations, but I'll be including more detail so that it's (h...
TL;DR The initialization of the variables a and b in your question are indeterminately sequenced in relation to each other. The initialization order is not guaranteed between them. The initiali...