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.
General Q&A about programming, scripting, software design & architecture, process, tools, testing, and more.
Filters (None)
I have an "tensorflow.python.framework.ops.Graph" object loaded from a .pb file. def load_pb(path_to_pb): with tf.compat.v1.gfile.GFile(path_to_pb, "rb") as f: graph_def = tf.compat....
Should I use the data-* attributes for this or is there a more idiomatic way? For context, I'm trying to convert annotated legal PDF documents to HTML. Certain parts of these documents are cross...
Usually a random IV is used for encryption with AES in CBC mode, so that key/IV pairs are not reused, which would be a vulnerability. During decryption, the IV of the encryption is required. If de...
How can I have a mutable object (for example a vector) that is created inside a loop iteration and needs to be updated in later iterations of said loop? As a concrete example, consider parsing som...
At this time I am trying to manually install doxygen into msys64 but the computer I am using does not have access to the internet. When I try to start doxywizard.exe, I am receiving this error. ...
I'm working on a Svelte web application. The issue I'm having is when I'm trying to integrate the Carbon Web Components module. I installed the module using npm install --save @carbon/web-component...
I had understood that Python is supposed to come "batteries included", and that the "batteries" specifically include: the tkinter standard library, a simple GUI framework a simple IDE cal...
What are the differences between git apply and git am commands? Both seem to be used for applying patches to repositories. When should one be used over the other?
Whenever registering to diverse sites on the net, you are often forced to enter a so called "strong password", which would ideally contain both upper case letters, lower case letters, digits, and s...
How can I verify that an extension method was called when using NSubstitute for unit testing? For a normal method I'd do something like: substitutedClass.Recieved().CheckedMethod(...) But exten...
I have a SPARQL query to Wikidata that returns the names and handles and parties of politicians for whom a Mastodon address is stored at Wikidata. Filtered by nationality and with an output of the ...
Suppose you have a situation where text is coming 1 word at a time, and you want to quickly show it to the user. "Quickly" is not in the sense of a performance constraint, but rather we don't want ...
What are some legitimate use cases for raising a NotImplementedError exception in Python? How can it help express a code author's intentions to aid code maintenance and/or further development of co...
One of my applications has a dependency on a stb-library. Now I am publishing this application to Github. Should I: Include the header that was used during development with the code? Have an in...
My annotation processor "cannot be found" but everything ~looks okay. In Eclipse IDE, I created a new Maven project with the "quickstart-architype" resulting in a project with this structure: ___...
There's not always a Spark cluster on hand to test Spark code. Is there some simple program that you can install locally, which has the same behavior as Spark (can run normal Spark scripts) withou...
How do I perform a running cumulative sum that is based on a condition involving the current row and previous rows? Given the following table: acc | value | threshold 3 | 1 | 1 1 | 2 ...
My (non-Windows) operating system came with Python, but that Python didn't include Pip. I followed instructions to install Pip for the included Python, using my system's package manager. But now w...
In setting android:configChanges in AndroidManifest.xml, what is the difference between colorMode and uiMode? I hear uiMode is for changes between light/dark modes, which sounds exactly what colorM...
When enabling access logging for an AWS load balancer, I get the following error: Access Denied for bucket: test-bucket-access-logs. Please check S3bucket permission test-bucket-access-logs is ...
Say I have two functions: FILE* get_input(const char fname[static 1]); FILE* get_output(const char fname[static 1]); And I wish to declare a function pointer and assign it the result of some p...
I have already learned how to tell the Python interpreter to run my code, but the standard approach feels a little unsatisfactory. I want the user experience to be that my program starts with the a...
Hello, I am trying to build a docker image for contributing to the devdocs repository, however I am failing to get past the thor docs:download --all command. It fails with the below error: . is w...
I am looking copy files platform-dependently on Linux, Oracle Solaris, MacOS, BSDs, and Windows. I have found some system calls for each platform, namely sendfile(), copy_file_range(), fcopyfile()...
I am trying to join some video files and have an issue. I have boiled down the problem to the following minimal working example. I create a 2-second mp4 with a silent audio stream: $ ffmpeg -f l...
I have seen others allude to include_directories as disfavored: Having trouble adding include directories Summaries from CMake's documentation: target_include_directories include_directori...
I tried installing Python on an old computer running Windows 8[1]. I know for a fact that there was never any previous installation of Python on the machine. The installation appeared to be success...
In Python 3.12, I noticed that some libraries seem to be missing or "deprecated": >>> import asynchat Traceback (most recent call last): File "<stdin>", line 1, in <module>...
I installed Matplotlib and tried a simple demo, but I got a warning message and no plot showed up: >>> import matplotlib.pyplot as plt >>> plt.plot([1,2,3],[4,5,6]) [<matplo...
I understand the benefits of virtual environments in general, and specifically I want to use a virtual environment so that I'll have access to Pip without exposing the system Python (i.e., included...
I already know that the pip command might not correspond to the same Python that python runs. But in my case, it seems not to exist at all. I can't even run it as a Python module: $ python -m pip ...
Suppose I have some code in a file myscript.py like: def my_function(): print("Test") What steps do I need to take in order to make my_function run? That is to say: how do I get Python to ...
I tried installing package-installation-test[1] using Pip, and it appeared to be successful. But I can't use it as advertised, either by itself or by importing it from my code: Failed attempts ...
Recently, Python updated from 3.11 to 3.12 and now all my libraries are gone. Actually they're in the old 3.11 site-packages, but now that python points to 3.12 those are not active. Every time I r...
In many other programming languages, the execution of code starts in a specifically named function (such as main) which is expected to have a specific signature, which allows that function to recei...
I've seen many examples of Python scripts that include a line that says: if __name__ == '__main__': Sometimes the following block contains a bunch of code, but other times it just makes a singl...
I have multiple installations of Python on my machine. I already know how to choose one to use to run for my code - and therefore, I could also solve the problem for third-party application code. ...
Several times now, I've seen advice in tutorials, setup/install instructions for Python-based projects, etc. to use a virtual environment to keep things organized and make it simpler to manage the ...
I have multiple installations of Python on my machine. When I run Python, what determines which installation is used? How can I control this?
I know that I can make Python code run starting from the script, but this still requires the user to have Python installed (and will still rely on configuring the system so that it can find Python ...
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...
I've installed Android Studio Jellyfish (snap) on an Ubuntu Fossa VM and was finally able to generate an apk for my project after struggling with Gradle, Java, plugins, etc. The device is detected...
I found a strange expression in some Python code: from library import HOME_DIRECTORY file = HOME_DIRECTORY / "file.json" It seems to be dividing a string by another string in order to do som...
How do I trim a sorted list in Python, so that I only keep the elements greater than a certain value? For example, if I have this list: l = [1, 3, 5, 6, 7, 8] How can I efficiently get a list of...
From PureScript's Data.Functor.Invariant documentation (emphasis mine): A type of functor that can be used to adapt the type of a wrapped function where the parameterised type occurs in both the...
At this point in my learning journey, I simply accepted that this function is called pure (both in Haskell and in PureScript), but it would have helped a lot if I had known the reasoning behind thi...
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...
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 ...
First: What is an opaque pointer in C? Now when it comes to testing such a type, I know of 3 ways: Include the source file (the one containing the definition of the type and the functions tha...
Distroless images use a user called nonroot by convention. What's the UID (User ID) of this user? This is relevant in multi-stage image builds: FROM bash:latest as builder RUN adduser adduser ...