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
The answer is "it depends". It depends on the language, how much buffering you're willing to allow, how much you're willing to accept some approximate/incorrect syntax highlighting, and whether you...
The auto feature was indeed mainly meant to solve long cumbersome template container declarations in C++. But when introduced to C23 - where there are no templates let alone template containers - i...
The answer by hkotsubo is correct. But just in case you're being very specific about fast-forwarding, it's worth stressing that you can use --ff-only as an option on the merge to abort if it requir...
C23 introduces the digit separator ' which can be placed anywhere inside an integer constant for the purpose of clarity and self-documenting code. These are otherwise ignored by the compiler when d...
Since this is all new, there might still be time to establish a consensus before this style feature too ends up "all over the place" (like upper/lower case hex, upper/lower case integer constant su...
How to verify if a year is leap? Given a numeric value (such as 2023) or some object that represents a date (such as Date, Calendar, LocalDate, etc), how can I do it?
Hi and welcome to the site. :) I think the idea of a canonical like the one you linked is great. A lot of newbies have too little understanding of their topic to identify common patterns. So they ...
You want git worktree: https://git-scm.com/docs/git-worktree. The idea is that you can have multiple branches of the same repository checked out to different directories, but they're still the "sa...
How do I add functionality to the back button in Android without reimplementing the back button entirely? Prior to last year, I would just call onBackPressed() and then simply override it: overri...
There is basically only one reason not to use static functions in C, as opposed to functions with global scope. That's if you want to access the function from outside the module. Otherwise, if th...
See this comment: https://forum.qt.io/topic/60546/qpushbutton-default-windows-style-sheet#3 Stylesheets are a totally different beasts. The default native drawing doesn't use stylesheets. They ...
fn x [] = [] means that if the second argument to fn is an empty list, return an empty list. fn x (True:ys) = x : fn x ys means that if the second argument to fn starts with True, return a list th...
I was chatting with somebody who's involved with a proposal on SE for a site about language design and who is interested in other options too. Some sample questions: What are the tradeoffs b...
Python documentation suggests that you can simply add other parameters when raising the Exception and retrieve them using args: Code try: raise Exception('spam', 'eggs') except Exception as in...
In a Qt application I have nothing more than a window with a button as its direct child. I set its background color and all is fine: Window::Window(QWidget *parent) : QWidget(parent) { but...
What is the purpose of grouping the tests in a tests module like this #[cfg(test)] mod tests { use super::*; #[test] fn test_function_1() { // test code for function 1 g...
I've heard that in modern C++, smart pointers are preferred to raw pointers for ownership (the so-called RAII principle, as I understand it). This makes sense, and since then I've always used them...
While I agree with Dirk Herrmann that basename is the right tool for the job, I think it is still worthwhile to know how to do it with grep, because you might one day encounter a sufficiently simil...
I have a variable that contains a string: $CCSR = "branches/features/arm_and_musl" I want to get only the part after the last /. In this case it's "arm_and_musl" but it can be anything. So som...
After spending my time on SO, I found that some of the FAQ style questions were VERY helpful, especially with things such as SQL injection in PHP/MySQL (for example How can I prevent SQL injection ...
Context We have recently received a suggestion to allow questions about recommending books directly connected to software development. The way I see this now (pros and cons) Pros: allow more ...
I agree with Dirk Herrmann's answer about this: What if a question is beginner level? I would say: Someone should answer it. Some of the beginner level questions on stackoverflow have rece...
Your grep invocation will first search for files which contain foo and print a list of the lines from each which contain the word foo; the second grep invocation will take this list and filter it d...
This is a self-answered Q&A meant as a C string handling FAQ. It will ask several questions at once which isn't ideal, but they are all closely related and I'd rather not fragment the post in...
For me the following reasons might lead to downvoting: Posts that are not related to a specific programming issue, but are rather meant to start a discussion. Example Asking for software ...