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
I am wondering if it makes sense to define a template for questions. This would act as a guideline rather than a strict template to be followed. I have seen this being used for GitHub issues and I...
Generally speaking, the frequency of garbage collection is a space / time tradeoff: collection effort live object size GC overhead ~ ----------------- = ---------------- ...
I have recently blown off the dust off my LinkedIn profile and I have realized that I have hundreds of connections. An important fraction of all these connections are into software development and ...
How to clear the contents of a file using C?
There are two issues here. A performance problem and a correctness problem. The approach you suggest seems like it will help mitigate the performance problem while doing nothing for the correctness...
As you know, a max heap is a binary tree such that each parent is greater than its children. The most compact and efficient way to represent such a tree is an array, where each index corresponds t...
Besides the possible issues that Lundin told you, there is also the possibility that the current directory of the program is not what you think it is (note that the current directory is not necessa...
This revolves around images. I'm trying to write an HTML page of COVID-19 safety procedures, and here's what I've written so far: <!DOCTYPE html> <html> <head> <title&...
There is no resolution for this issue as the meth role is a syntax extension defined by Sphinx, in what it calls the Python "domain". The standard reStructuredText roles that Docutils supports do n...
At the documetation you linked, if you click on "which will clear the document", it'll go to the documentation for document.open, and that page says in the beginning: All existing nodes are remo...
The part after the hashtag is called a URI fragment. Unfortunately, Tampermonkey does not allow you to match hashtags. This is arguably for good reason. The hashtag can easily change (and for sing...
Having recently learned about protocols in Python, I now wonder if you can write a protocol for enumerations. That is, a protocol that says that you are supposed to pass an enum that has certain it...
I think you've got an architectural error. A state machine (SM) determines it's own actions based on it's state and the messages it may receive. The calling code may send messages (information) t...
Some thoughts about your design / code (not repeating what was already said by Derek): You have chosen member _observers of class State to be a list, and member function register to append to ...
I've written the following code implementing a state machine in Python, and I'd like some feedback on it. The basic idea is that each state has a set of corresponding actions that trigger a state ...
Browsing through the list of tags I saw two with the exact same name, [caching]: One is in https://software.codidact.com/categories/38/tags/4128 and the other in https://software.codidact.co...
How can we use git-send-email(1) to sign patches (emails) with the gpg(1) keyring? The git-send-email command does not have any CLI options to perform cryptographic operations, so, to the best...
I personally think its syntax is confusing. Well, it's just a matter of getting used to it, I guess :-) Anyway, this code is just looping through all childNodes and in each iteration it cal...
How this recursive treewalker works? To understand what the code does, we need to first see what problem it's trying to solve and why it needs to be solved this way. Let's consider this HTML:...
Dirk's answer provides a sound solution to the literal problem you describe. Nevertheless, I would encourage you to take a step back and consider whether you really want to be editing Makefiles in ...
One simple possibility to eliminate a set of lines with precisely known content is to use the patch tool. The below code shows an example shell script. The script calls patch on the file to be mo...
Since your code performs a data base operation, the cost of this operation is likely dominating the execution time. The cost of both a return or an exception may be negligible compared to that ope...
Overflow checking for integral-type arithmetic operations is disabled by default and it can be explicitly enabled by using using checked function or the -checked compiler switch. Since I mainly de...
The weakness of responding to idle state is that the app might be closed before the idle state is reached, and that a closing app might no longer be able to communicate with the outside world. Savi...
What type of questions can I ask here? has gotten rather cluttered since we have added/removed a lot of things along the way. In particular, I think it is hard to get an idea of what's on-topic by ...