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
What's going on is that the compiler is deciding on what function to call at compile time rather than runtime. Since the type of vh is Vehicle *, it is essentially creating this call: vh->Vehic...
It would be much better split into separate questions. Users have to scroll, ctrl-f search, or wade through a lot of info that irrelevant to their problem to get to the section that helps them. ...
Summary (TL;DR) Using strcpy directly on non-sanitized user input is bad, otherwise it's fine. strncpy is a dangerous function that should be avoided. Its presence in your source is a muc...
If you've poked around the mod tools here a bit, you may have noticed that QPixel has an impersonation feature, live on prod. It's there for much the same reasons: so that developers can test and i...
Yo. Me here. I used the code for the Codidactyl on the run as basis for the game, added a wrapper checking for the Konami-code by being a simple finite automaton and after that creating the canvas...
‘This language doesn't have types’ and ‘This language only has one type’ are English sentences that communicate the same underlying concept: a typeless language doesn't have a way to distinguish ca...
This is a rather vague question, but I'm trying to solve a specific problem and I'm inexperienced in most of the potential solutions, so please forgive the inherent ambiguity. I have access to a d...
Use a stack while just scanning your string once from left to right. No need for multiple (performance-wise) expensive string replacements. If implemented right, the stack will only ever contain at...
I think a branch is a set of commits and a commit is a set of deltas, so my concern is that merging feature-B to master would reflect only the work that is unique to feature-B Not quite: a bra...
You can, in a sense, do I believe even better than using Stack Overflow's hosted, proprietary service. You can run your very own instance of the Codidact software (that is, QPixel) locally, on a s...
A recent flag for this question suggested that it would be a better fit for the Linux community. There is no motivation provided, but I guess it is related to the fact that most of the question and...
It's because of this rule: *{ background: rgb(3, 28, 87); } That applies the darker blue background to every element individually, and that isn't overridden when you change the background o...
What does it mean that we can use memcmp(3) on invalid values? ISO C allows comparing an invalid value through memcmp(3), because it doesn't read the value, but rather its representation, and "rea...
There are many ways to do it, it depends on what data you already have and/or the Java version. I have only the year's numeric value If you already have a value as a number (int or long), and i...
It is, as you said, an operator so it doesn't make any sense to place a comma somewhere between the operator and the two operands. The first operand is the template string, and the second operand ...
I respect Alexei for opening a discussion on this, and Lundin for providing hard-won real world experience. I would like to put in a "pro", on the grounds that "I read this book and I'm a better p...
Grouping related items into modules is of course generally good practice, but it serves a practical purpose as well. The important part here is the #[cfg(test)] annotation. The #[cfg(test)] anno...
From simple subtyping concerns, you want the arguments of your methods to be as abstract/imprecise as possible while still allowing you to efficiently accomplish your goals. This allows your method...
Between-lines relations are not easy to look for with grep, which is a line filter. You could use a regex that spans lines, but I find this annoying because of all the flags you have to set. Grep ...
I have text (xml actually) files. Some files contain 'foo', some contain 'bar', some contain neither and some contain both. It's the both I'm interested in. How do I do an AND search on words in...
Never Too Late Due to, shall we say, recent AI-related hallucinations, pretty much everything that was possible PR-wise in 2019 is possible for this site again. People are leaving Stack Overflow a...
Would it discourage others from posting answers, if they saw that a question had an answer with a "works for me" indication applied immediately? (More so than just seeing an immediate, comprehensiv...
Before attempting this, make sure it makes sense in context. In a few particular situations, it would be better to take a different approach rather than using the normal tools for composing or f...
Consider this code example: def example(param=[]): param.append('value') print(param) When example is repeatedly called with an existing list, it repeatedly appends to the list, as ...
With the --delete option of git-push: $ git push <remote-name> --delete <branch-name> For example: $ git push origin --delete my-branch