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 trying to work with a Go project that I'm taking over from another developer. The go.mod file says I need at least version 1.13, and I have 1.22.3 installed according to go version. However, wh...
A pitfall in C++ that I didn't see mentioned in the other answer is that it might give unexpected results with libraries using expression templates. What are expression templates? In a nutshell, ...
I'm trying to containerize a SvelteKit application that uses the @sveltejs/adapter-node. The Build and Deploy section from the documentation recommends to build the application, and then run the a...
I don't think there exists a straightforward solution. Likely you can achieve this with rules but you'll have to define and finetune them on each of the jobs. (template jobs may help a bit here.) ...
Suppose I have the following directory structure: folder/ aaa/ f.txt bbb/ f.txt I want to compare the file f.txt as it is common to both directories. So in zsh I type this: % d...
The explanation is that human languages are fundamentally confusing on this, but, because humans tend to be somewhat blind to complexities in systems that they've literally been the only thing they...
I see on https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct/tree/main/onnx: File Name Size model.onnx 654 MB model_fp16.onnx 327 MB model_q4.onnx 200 MB m...
The C23 example as well as clang are correct. This is apparently a gcc bug in the latest 14.2 release, fixed in the "gcc (trunk)" unreleased version. The relevant part of the C23 standard here is ...
Pointer conversions and aliasing First of all, C historically allows all manner of crazy pointer conversions (whereas C++ is more restrictive) between compatible and non-compatible pointed-at type...
I'm building a Flask application with user login functionality using Flask-WTF for form handling and Flask-Login for user authentication. However, I am unable to log in successfully. The page does ...
If you want a best practice, I'm pretty sure the best practice is to do the straightforward and "naive" thing. From the perspective of OOP, your complaints are misguided. The unit of coherence isn'...
You're right about the recalculation, as you can see from some easy experimentation by rigging two (dynamic) properties and logging what each one gives you. public long TimeStamp1 { get; } = DateT...
I want to make multiple comparisons at once, of the same type, in a Python program. For example, to check whether all of a certain group of strings are in a longer test string; or whether a specifi...
Setup I have a database table with field of JSONB type. I access said database using Hibernate. In hibernate I have entity mapped on said table. Entity contains field marked with @JdbcTypeCode(...
Is this for purely technical reasons as there would have to be at least 2 Semigroup instances (for addition and multiplication), but type classes cannot be implemented multiple times for the same...
r~~'s answer is good, and I absolutely agree that the condition provided in the question is ridiculous and I've never seen anyone suggest it as a generic replacement for if(var). But I think the ac...
Recently I had to push a new Docker image to our GitLab registry. I have the Maintainer role on that project. I had created a new token and used it to log in to Docker. However, when trying ...
The library module itertools provides a function called dropwhile(). The example they give is: dropwhile(lambda x: x<5, [1,4,6,3,8]) → 6 3 8 So, to get a list of numbers greater than 4, d...
Is there some sane way to allow Python to import from subfolders in projects that don't have a package? I have many Python programs that I implemented as Python files inside a directory, without a...
There are many reasons why this error may occur. In my case, my new token had the read_registry scope but not the write_registry scope. I created a new token that had the read_registry and write_...
The first line of a file is head -1. But you probably also want the file name. So something like: for file in glob do first_line="$(head -1 "$file")" printf "%s: %s\n" "$file" "$first_l...
Context Our team is developing a solution mainly composed of several microservices relying on ASP.NET Core. We have decided that the simplest and most cost-effective solution would be for service...
The existing answer is fine, but you can achieve similar results in many ways using some of TypeScript's utility types. Required<T> While you cannot use (only) Partial to do this, TypeScrip...
Understanding distutils and setuptools: the history The short version of "why does installing Setuptools fix the problem?" is that Setuptools provides its own distutils package, overriding anythin...