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
Regarding undefined behavior/uninitialized variables of automatic storage duration First of all there's some misconceptions here. if (x == 0) is UB only because x was declared as a local variable...
Note: I asked this question on TopAnswers a couple weeks ago, but didn't get any response, so I figured I'd ask it here. I am currently learning C++. I have a parent class (Vehicle) and two subc...
Is it valid to partly allocate an object, as long as you only use the allocated part of it? #include <stdio.h> #include <stdlib.h> struct s { int i[100]; }; int main(void) {...
Functions in C have external linkage by default. In other words, the storage class specifier extern is applied to functions by default, with the effect that they are visible to all translation unit...
No. Software Development is about writing software. Yes, you can stretch almost anything that is an input to software to be "writing software". But arguably the closest analogue in actual Software ...
You want to scale from one linear range to another. That can always be done with y = mx + b where X is the input value and Y the output value. M is the scale factor, and B the offset. You ...
This isn't specific to git merge. The standard Git behaviour is that any content- or history-changing command operates on the current branch. For example, you cannot git commit to a branch other th...
Statements and expressions are two syntactic categories that are used by many programming languages. Since they are syntactic, they depend on the programming language's syntax. In a real sense, a s...
As a relative newcomer to Rust, I'm trying to understand the behaviour of lifetimes, but I am confused by the following code: let s: &str = "first"; let mut r: &str = s; println!("First ...
The Python Global Interpreter Lock (GIL) is a mutex in the primary Python implementation (CPython) that is acquired whenever Python (byte)code is executing. This means within a single (OS) process ...
tl;dr, the lifetime of "second" is static The heart of your confusion is this: Since we are taking a long-lived reference r to a string slice inner which is destroyed at the end of its scope, ...
As other answers have said, we have some of these, they're helpful, and they can be hard to write. On Codidact there's another option, should the community want to enable it: articles. An article...
For what it's worth, I have some 20 years of experience designing embedded C systems, with large and small code bases both. Code design is some of the hardest things to do, since books about object...
grep is not the right tool for your case. You can use basename: basename a/b/c --> c basename a/b/c/ --> c or, in your case basename branches/features/arm_and_musl --> arm_...
My actual motivation is to understand the semantics of the .gitignore file syntax in precise detail, for a program which is expected to emulate them as accurately as possible. However, while coming...
Git's interactive mode has a patch action. This is the shortcut for it: git add --patch <file> It will split the file into hunks and interactively ask which one's to add. It has a plethor...
These two uses of if are different The if at the end of a list comprehension syntax: [num for num in hand if num != 11] is a filter; its purpose is to decide whether or not the resulting list ...
RFC 3986 defines a suffix reference as follows (emphasis my own): 4.5. Suffix Reference The URI syntax is designed for unambiguous reference to resources and extensibility via the URI scheme. ...
I agree. Something that might be more useful is to allow the text boxes to be resizeable by the user. In most places, there's a small tab on the lower-right corner of a text box that allows the use...
When discussing best or safest C programming practices with various C gurus on the Internet, the "MISRA-C guidelines for the use of C language in critical systems" often pops up as a source. This ...
It is true that MISRA-C has a heavy focus on embedded system, though it has become somewhat more generic over time. The MISRA guidelines have been changed and improved several times over the years ...
The current two top questions at https://software.codidact.com/ ( https://software.codidact.com/q/279699 and https://software.codidact.com/q/278674) are marked as coming from luap42: However, wh...
I've got this sample regex: Pattern p = Pattern.compile("(?:([aeiou]+)[0-9]+|([123]+)[a-z]+)\\W+"); It basically has the following parts: one or more lowercase vowels ([aeiou]+), followed by one ...
Why would the second way be faster? Generally speaking, the first form will perform worse (as well as looking a lot worse) than the second. You are hitting an edge case where the opposite is true...
Context Over the years I had a hard time addressing questions about software architecture like these ones . Soon after posting them, they receive a couple of downvotes and close votes which set the...