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
C++ doesn't have error codes/exit codes other than return 0; / EXIT_SUCCESS / EXIT_FAILURE. The code you are getting is from the OS when your program crashes from a run-time error. -1073740940 is ...
List<T> is not observable. In other words, List<T> does not offer a mechanism through which it could signal that its content has changed. If it is possible/permissible to modify the De...
I like the idea, but more as an exercise or a demonstration what can be done with Python. I also like that the code comes with a set of test cases which are written in a way that they nicely serve...
I haven't worked in WPF for a long time, but you might try setting a new list (clone the old one and add the new element) instead of adding the element to the existing list: _demo.Value++; var ne...
I am trying to combine MVVM in WPF using Microsoft.Toolkit.MVVM. Somethings are working as expected. The text boxes bind to fields and update in both directions. The button command executes and cha...
Nothing. Or anything. Or whatever you want it to mean. As a general rule of thumb: If you explicitly exit from a program with a specific exit status, then you know the meaning, or set of mean...
From section 7.21.6.2 of this draft: [T]he result of the conversion is placed in the object pointed to by the first argument following the format argument that has not already received a conve...
In addition to all the examples I gave in my answer to the linked post, all scenarios where p is a pointer to incomplete type fails. Not just the void* scenario, but also when p is a pointer to an ...
It seems to me that you are hobbling yourself by making design constraints more absolute than they need to be. For instance: You don't want to change the code under test, not even a tiny little ...
Performance-wise, I'd benchmark this vs if(memchr(src,'\0',n)==src+n) memcpy(dst, src, n); because it isn't obvious at least to me if that's faster or slower than your custom function. Regarding...
To investigate such problems, open the developer tools of your browser, and use the inspect this element feature to inspect the bounding boxes of the various elements. in Chrome: press F12 to o...
I have a code block like this: try { ... x.foo(); // This is the line that forces us to have the try block ... } catch (ArrayIndexOutOfBoundsException e) { logger.error(e.getM...
Here is an animation of a cube with faces subdivided into two rectangles, morphing into a rhombic dodecahedron, with the Platonic dodecahedron as an intermediate state. This demonstrates that the e...
I want to add the ability to "Sign in with Google" into a Ruby on Rails web application, that is using Devise to handle authentication. How do I do that?
The Zip class from Data.Zip requires an implementation of Semialign: class Semialign f => Zip f In my mind: Zip takes the intersection of two shapes. Semialign takes the union of two sha...
The other answers are correct, but over complicate things. Suppose you have a database with 1,000,000 email addresses and password hashes, 20% of whom are idiots and have used "password123" as the...
You can separate the curly brackets with spaces, and instruct jinja to remove them afterwards: { {{- jinja_expression -}} }. That way the outer curly brackets are left untouched. The minus signs s...
What would be the simplest (and most lightweight) way of getting email notifications of failures in kubernetes clusters. Mostly interested in failing pods, so notifying on certain kubernetes event ...
When I do this in a shell: $ /bin/sh -c 'echo hello world' hello world it's my understanding that I'm running a process with argv = {"/bin/sh", "-c", "echo hello world"}. That is, the quotes c...
Because execl's first argument isn't argv[0]. execl("/bin/sh", "-c", ...) runs the executable /bin/sh, but sets its argv[0] to "-c", as if one had created a link called -c pointing at it and run t...
Code review part: Design (important!) Global variables/external linkage are to be avoided (Why is global evil?). You don't actually have private encapsulation in this code since the inte...
Many languages discourage global variables. Why is this?
I am working on a toy project where I have a container for which I would like to write an iterator that iterates over the values in the container. Because the values are stored in a (c-style) arra...
When I open VS Code inside a project dir, it reopens all the tabs that were open last time, and re-expands all the folders that were unfolded last time. I find this annoying. Usually, when I close...
They are not a part of git the way .gitignore files are. It's just a convention to add empty directories to git repositories. Normally git ignores empty directories altogether. Adding an empty fil...