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)
Looping in Ansible usually produces a neat output of one line per iteration (per host): ... ok: [Arch] => (item=something) ok: [Arch] => (item=something_else) ok: [Arch] => (item=yet_a...
I started adding types to my (working) solution to Exercism's "Kindergarten Garden" exercise, to learn how typing with python and Mypy (strict) works. While doing so, I ran into a Mypy error that I...
Functions in C have external linkage by default. In other words, the storage class specifier extern is applied to functions by default, with the effect that they are visible to all translation unit...
Let's analyze this code, assuming an architecture where the alignment of int64_t is the same as that of double: void bar(double *f, int64_t *j) { *(int64_t *)f = *j; } void foo(void) ...
I'd like to write a TCP client in Rust that can receive the entire message sent by a server, but I have no information about the length of a message. I'm aware that TCP doesn't preserve message bo...
When I run pip install foo, pip looks for foo in PyPi. I want it to look for it first in a private repo, let's say pypi.bar.com. Only if foo cannot be found in pypi.bar.com, should pip then look f...
For my company, I'm writing naming conventions for embedded code in C language. Function names must be named in lowerCamelCase() and start with a verb. Global variables are in Maj_started_lowe...
I have a Python program like this: done = False while u and not done: i = u.pop() print(f"Processing {i}") do_big_task(i) finish_up() Since this takes a long time, the user m...
Temporary notice: this is part of an ongoing project of transferring and splitting my canonical from Stack Overflow on common errors in Google Apps Script. As soon as the Q&As are finalized, ...
What does lifting state up in Flutter mean, and how does it work?
I am currently using this code to display a GUI counter: USING: accessors arrays fonts kernel math math.parser ui ui.gadgets ui.gadgets.buttons ui.gadgets.editors ui.gadgets.labels ui.gadgets.pa...
I'm currently writing an input and output handling library for the D language, and I'm not getting any kind of input language change messages when the language is being toggled with hotkeys, and on...
I'd like to assert that some code can be optimized out, and is not present in the final binary object. #define CONSTANT 0 #if (!CONSTANT) [[landmine_A]] #endif static int foo(void); void...
Credit for User:Meriton for developing the following code (first published here). function replaceIn(e) { if (e.nodeType == Node.TEXT_NODE) { e.nodeValue = e.nodeValue.replaceAll("a", "");...
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...
Context I am currently migrating a Web application from on-prem infrastructure to K8s. The legacy infrastructure relies on defining some tokens in the configuration files and these are replaced d...
I'm trying to make a UWP app in Visual studio, but the NuGet package files have been huge. They just don't fit on my SSD, but I do have an HDD I could theoretically use. After a bunch of tinkering...
I am migrating an application from Log4j1 to Log4j2 using the API bridge jar. All references to the log4j1.jar have already been removed. I set the system property in Websphere as a JVM argument -...
The Code using Microsoft.EntityFrameworkCore; public class BloggingContext : DbContext { public DbSet<Blog> Blogs { get; set; } public DbSet<Post> Posts { get; set; } ...
I have a very simple source file -- HelloWorld.java public class HelloWorld { public static void main(String[] args) { System.out.println("hello world"); } } I have th...
MWE import pandas as pd import numpy as np import matplotlib.pyplot as plt df = pd.DataFrame(np.random.rand(9, 4), columns=['a', 'b', 'c', 'd']) df.plot.bar() plt.show() Question Ho...
I learned about the ** operator for array-repeat, and I love it. I have a struct that contains a 2-d array of inner structs, like const D1 = 30; const D2 = 40; const Inner = struct { .a: u32, ....
The webpage example.com has an edit webpage (from which one can edit example.com itself). example.com/index.php?title=עמוד_ראשי&action=edit I want that after I click ALT+Shift+E, I would im...
I tried using query selector but it does not work heres my HTML code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>JS + CSS Clock<...
I am trying to create an application that takes a date as user input which is then passed as a parameter to an API call. The local date format is dd/MM/yyyy. I want the user to be able to enter t...
I'm trying to do some DOM manipulation in jQuery, but am having issues with creating wrapper elements. For some reason, prepending to the wrapper doesn't work after I call wrap. Code <html>...
I am working with PHP and RedBean PHP ORM. I have a table user like so: id | username ---|--------- 1 | Alice 2 | Bob I want Alice and Bob to become friends. So I want to create M-M juncti...
I have a query summarizing some transaction data that I'd like to summarize by day of week. For my use case, I need to return weekdays formatted according to ISO 8601, so Monday must be the first d...
The question is about libraries that extend the data type system to ensure physically realistic computations. Think std::chrono but for distance and mass and other things as well as for time. Inste...
Using parentheses in Javascript is always needed when you want to create functions, if/else statements and for/while loops. But in Python it has a function that is called tuples. When using an if s...
Suppose I have two variables that are called animal and age, and print them as a string in the console like so: animal = "giraffe" age = 25 print("A %s can live up to %d years" %(animal,age)) ...
A watertight mesh is one which does not have holes, and for which each face has a designated inside and outside. Such a mesh can be "tetrahedralized", has a defined volume, and can be an operand in...
Let's consider the following code: const char a[][4] = {"aa", "aaa"}; const char *b[] = {"bb", "bbb"}; const char *const c[] = {"cc", "ccc"}; For shared libraries, both b and c arrays require...
I was playing around with mapped tuples and came across an interesting case where TypeScript cannot infer the types used: interface Foo<A, B> { (a: A, b: B): any } function test<...
I've written a class object, QueueObject, but when I try to construct it inside of my main class, it says it cannot find the symbol on compilation. I've read lots of pages saying how misspellings o...
What is Backus–Naur form as applied in computer programming? From Wikipedia In computer science, Backus–Naur form (/ˌbækəs ˈnaʊər/) or Backus normal form (BNF) is a metasyntax notation for cont...
Note: I asked this question on TopAnswers a couple weeks ago, but didn't get any response, so I figured I'd ask it here. I am currently learning C++. I have a parent class (Vehicle) and two subc...
Context Using the lemmy API, I'm trying to get a list of sublemmies (lemmy communities) that a user is following. Reading the documentation, I using the /site endpoint, I should be able to get a ...
For some reason, I just wanted to undo a commit on my git repository, which I've done with the following command: git reset --soft HEAD~1 So far, so good. However, by mistake I issued the comma...
If my struct column has the data type of struct<string, integer> then what should be the equivalent java object that should be inserted into that struct column? I'm trying the following code...
Unable to boot from manjaro usb key it looks like it is due to secure boot how can I do it without disabling the secure boot
I have a page to change the user password in my website, this page can only be used if the user have a logged in! The change password page have 3 inputs: Old Password, New Password and Con...
The proposed library would sit alongside cross-platform libraries in Xamarin apps for iOS and Android. However, it would include files with names like MyLibraryFile.android.cs MyLibraryFile.ios...
I've been trying to get Amazon SQS working with the v3 JS client. I've gotten to the point where I can successfully create a queue using the frontend, but the issue starts when I try and send/recei...
I've turned the tables movies and scenes into media and now I don't know what to do with the movies_scenes relation. CREATE TABLE IF NOT EXISTS "movies_scenes" ( `movie_id` integer, `sce...
The answer for this question is that there is something wrong with the expression of the first guard of this function below: congratulations :: [(String, Int)] -> [String] congratulations [] =...
class ExtendUserSession(MiddlewareMixin): """ Extend authenticated user's sessions so they don't have to log back in following 15 minutes (set by Django's default `SESSION_COOKIE_A...
Is it undefined behaviour to cast an uninitialized variable to (void)? Example: int main() { int x; (void)x; return 0; }
This data tree is comprised of clickable buttons and I want to expose all branches, in a single action, instead of clicking each vertical arrow button anew. I have tried the following code which d...
For example: I have noticed that this does not work for any vocabulary's tests. What is the alternate way to USE: these test vocabularies? EDIT: The test word appears to run all tests alongside...