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'm actually mainly interested in testing foo() Ok, so let's do that. I could make it public, but I really don't want to do that just so that the test class can access it Java has 4 diff...
Unfortunately I think the simple answer is that you cannot do what you want with standard Vim (or NeoVim, which I also tested — although NeoVim is slightly more convenient in that you don't need to...
Background This is kind of a subquestion to How to properly use malloc? When allocating, there are basically two common ways of using the sizeof operator: int *p; p = malloc(n * sizeof *p); /...
I've created a function that calls scanf passing a void pointer as argument: void read(const char *format, void *p) { scanf(format, p); } And tested it with different types: int n; read...
While writing the question I actually came up with something that seems to work fairly well, and it's very simple. Just add if(false) in front of the statement.
(This answer became more ORM v. "direct" SQL. If you're very narrowly focused on just stored procedures, then it's not super important to me that the logic be packaged up in stored procedures. That...
Actually, while REST mandates a great many things, it does not constrain the structure of URLs. To wit: The paper that coined the term "REST" describes resource identifiers as black boxes, and make...
A person I used to work with several years ago was hired to rewrite a product using a .NET-based modern tech stack. One of the aspects that stroke me was that he believes that the product should mo...
In Vim, it's possible to tell it to read from stdin instead of a file, by using vim -. This is so that you can pipe the output of one command into Vim, to view/edit it there. The problem I'm facin...
Why object-oriented instead of class-oriented? tl;dr Because you can "do OOP" without classes. Long answer A class is one possible way to implement object oriented programming. But it's n...
Something like automatically ignoring all .pdf files for which a .tex of the same name exists? We can do something close to that. We can reject the commit if your change list contains pdf and ...
I have an ASP.NET Core 5 web application that provides functionality that involves file upload + rather large processing (memory consumption mainly). After each processing (with success or not) the...
These questions are very helpful to the person asking, and great for driving activity. I think it is good to allow these questions to be asked and to answer them. At the same time, they are not go...
You can use pipreqs It will automate the generation of a requirements file. This can spare you the annoying dance without necessarily mixing environment setup and script execution.
I have a dataset of car bookings like this: car_id user_id 1 1 2 1 1 2 3 3 1 2 3 3 In this dataset, two separate groups/sets of cars and users...
The pip command accepts an option --index-url to specify the primary index (defaults to PyPI) and zero or more --extra-index-url options to specify secondary indices. So for your use case, try pip...
The problem is that you are using row twice with different types. for row in self.diagram: # row is str here for row in self.seed_diagram: # row is list[str] here Renaming one or the other m...
I can't speak for the people who designed it, but I guess it was made this way because you can merge multiple branches all at once. Let's say I've created multiple branches: C---D => ...
Why does git merge take the source branch rather than the destination branch as a parameter? The most common merge case by far for me is "Okay, this branch looks good, let's merge it into branch X...
The modulo operator is a binary (2 argument) operator which returns a single value, and can be used for both numeric calculations and strings: x = 5 % 2 print(x) # prints "1" y = "hello %s" % ...
Here's a JSON log formatter for Python. I want to be able to log details of exceptions (and have some capability to debug-by-logs). I want to be able to log extra data in JSON format (in addition...
Yes, it is safe unless the variable is volatile. The term used in the C99 standard for the value of an "uninitialized" variable is indeterminate. From C99 standard: Section 6.2.4 Storage duratio...
From the docs Example to exclude everything except a specific directory foo/bar (note the /* - without the slash, the wildcard would also exclude everything within foo/bar): $ cat .gitignore...
Why do we have the "Participate Everywhere" ability when we haven't yet done anything? Bootstrapping. Our communities are still small, so after we rolled out the abilities system we decided to p...
Can anyone explain to me why my Haskell function gives rise to a type-definition error? Originally, I wrote the following function to subtract one from the first n elements in a list: dec_first :...