Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

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)
60%
+1 −0
Tidy Ansible assert module loop output

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...

1 answer  ·  posted 8mo ago by Iizuki‭  ·  edited 8mo ago by Iizuki‭

75%
+4 −0
What's causing mypy to give an `[assignment]` error in this nested for loop?

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...

2 answers  ·  posted 1y ago by true_blue‭  ·  last activity 1y ago by Moshi‭

83%
+8 −0
What are disadvantages of static functions (ie functions with internal linkage) in C?

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...

3 answers  ·  posted 10mo ago by Lover of Structure‭  ·  last activity 10mo ago by Dirk Herrmann‭

71%
+3 −0
Strict aliasing rules and function boundaries

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) ...

1 answer  ·  posted 1y ago by alx‭  ·  edited 1y ago by Lundin‭

70%
+5 −1
Read all data from TCP stream in Rust

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...

1 answer  ·  posted 12mo ago by Matthias Braun‭  ·  edited 12mo ago by Matthias Braun‭

77%
+5 −0
How to configure Python pip to look for packages in a private index first?

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...

1 answer  ·  posted 10mo ago by matthewsnyder‭  ·  last activity 10mo ago by tripleee‭

70%
+5 −1
C naming convention, module trigrams?

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...

3 answers  ·  posted 1y ago by AdriZ‭  ·  last activity 1y ago by Dirk Herrmann‭

42%
+1 −2
Listen for key events in a CLI app

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...

1 answer  ·  posted 8mo ago by matthewsnyder‭  ·  last activity 8mo ago by mr Tsjolder‭

71%
+3 −0
How to solve the "Cannot call from this context" error?

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, ...

1 answer  ·  posted 9mo ago by Oleg Valter‭  ·  last activity 9mo ago by Oleg Valter‭

60%
+1 −0
What is lifting state up in Flutter?

What does lifting state up in Flutter mean, and how does it work?

1 answer  ·  posted 10mo ago by tarhalda‭  ·  last activity 10mo ago by tarhalda‭

60%
+1 −0
Relayout call does not work on button click in Factor

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...

0 answers  ·  posted 1y ago by Razetime‭  ·  edited 1y ago by Razetime‭

60%
+1 −0
Issues with receiving WM_INPUTLANGCHANGE etc. messages when language is chosen using hotkeys

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...

1 answer  ·  posted 9mo ago by ZILtoid1991‭  ·  edited 9mo ago by Karl Knechtel‭

71%
+3 −0
Assert that some code is not present in the final binary, at compile or link time.

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...

1 answer  ·  posted 2y ago by alx‭  ·  last activity 2y ago by alx‭

28%
+0 −3
How to make this treewalker code having a regular for loop or a forEach() method?

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", "");...

1 answer  ·  posted 2y ago by deleted user  ·  edited 2y ago by Alexei‭

84%
+9 −0
grep AND search for multiple words in files

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...

5 answers  ·  posted 11mo ago by mcalex‭  ·  last activity 10mo ago by tripleee‭

71%
+3 −0
How to inject environment configuration values when deploying an Angular application in Kubernetes or similar infrastructure?

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...

2 answers  ·  posted 1y ago by Alexei‭  ·  last activity 1y ago by Derek Elkins‭

66%
+2 −0
Can UWPNuGetPackages be moved to another drive?

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...

1 answer  ·  posted 1y ago by Ullallulloo‭  ·  last activity 1y ago by Ullallulloo‭

66%
+2 −0
Log4j2 not looking for log4j.properties even with the system property set

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 -...

1 answer  ·  posted 9mo ago by tarhalda‭  ·  edited 9mo ago by Alexei‭

71%
+3 −0
Updating the database reverses previous changes

The Code using Microsoft.EntityFrameworkCore; public class BloggingContext : DbContext { public DbSet<Blog> Blogs { get; set; } public DbSet<Post> Posts { get; set; } ...

2 answers  ·  posted 1y ago by Moshi‭  ·  last activity 12mo ago by FoggyFinder‭

77%
+5 −0
How to trigger an error/warning immediately upon compile/run if an item on my class-path is missing

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...

0 answers  ·  posted 8mo ago by davidalayachew‭  ·  edited 8mo ago by davidalayachew‭

71%
+3 −0
How to add vertical lines for visual separation in pandas plot

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...

2 answers  ·  posted 2y ago by mcp‭  ·  last activity 2y ago by samcarter‭

66%
+2 −0
How do I (compactly) initialize a 2-d array of structs with the same value?

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, ....

0 answers  ·  posted 1y ago by aghast‭

75%
+4 −0
Move to the edit webpage of a webpage via the keyboard with vanilla JavaScript

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...

1 answer  ·  posted 2y ago by deleted user  ·  last activity 2y ago by hkotsubo‭

25%
+0 −4
queryselector for all does not select the specified css selectory [closed]

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&lt...

0 answers  ·  posted 1y ago by Ansh‭  ·  closed 1y ago by Alexei‭

66%
+2 −0
Input date in Angular Material date picker in dd/MM/yyyyy format

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...

1 answer  ·  posted 1y ago by mcalex‭  ·  last activity 1y ago by tmpod‭

71%
+3 −0
Adding elements to wrapper after calling wrap doesn't work

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>...

1 answer  ·  posted 1y ago by Moshi‭  ·  last activity 1y ago by Mithical‭

75%
+4 −0
How to use self referential N-M relationship to make 2 users friends using RedBean PHP ORM?

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...

0 answers  ·  posted 10mo ago by Vanity Slug ❤️‭

71%
+3 −0
How do I return ISO day of week in Redshift?

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...

1 answer  ·  posted 11mo ago by Sigma‭  ·  last activity 11mo ago by trichoplax‭

77%
+5 −0
Any testimonials for any C++ units of measure library?

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...

1 answer  ·  posted 1y ago by Fred Wamsley‭  ·  last activity 1y ago by Ben‭

57%
+6 −4
Why can parentheses cause exceptions in Python when using for loops?

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...

1 answer  ·  posted 1y ago by Bennshinpoes‭  ·  edited 1y ago by trichoplax‭

61%
+6 −3
Why are commas not needed for modulo string formatting when printing?

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)) ...

3 answers  ·  posted 1y ago by Bennshinpoes‭  ·  edited 9mo ago by Karl Knechtel‭

60%
+4 −2
Watertight Mesh Representation

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...

0 answers  ·  posted 2y ago by Josh Hyatt‭  ·  edited 2y ago by Josh Hyatt‭

80%
+6 −0
array of arrays vs array of pointers to store array of string literals

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...

0 answers  ·  posted 2y ago by alx‭  ·  edited 2y ago by alx‭

80%
+6 −0
TypeScript is unable to infer the correct type for a mapped tuple

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<...

0 answers  ·  posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

37%
+1 −3
Java cannot find class within same package

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...

1 answer  ·  posted 2y ago by cuzzo‭  ·  last activity 1y ago by cuzzo‭

62%
+3 −1
What is Backus–Naur form as applied in computer programming?

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...

1 answer  ·  posted 2y ago by deleted user  ·  last activity 2y ago by r~~‭

83%
+8 −0
How to define an object with different subclasses in an if-statement?

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...

1 answer  ·  posted 1y ago by Trevor‭  ·  edited 1y ago by Alexei‭

77%
+5 −0
Lemmy API: how to get list of followed/subscribed communities.

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 ...

1 answer  ·  posted 10mo ago by elvis_depresley‭  ·  last activity 10mo ago by tgxn‭

85%
+10 −0
Is it possible to undo a git reset?

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...

2 answers  ·  posted 2y ago by celtschk‭  ·  edited 2y ago by Alexei‭

71%
+3 −0
How do you insert a struct into a hive table column using HiveRunner?

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...

1 answer  ·  posted 1y ago by Abbas Gadhia‭  ·  last activity 1y ago by Abbas Gadhia‭

25%
+0 −4
Unable to boot from manjaro usb key [closed]

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

0 answers  ·  posted 2y ago by hedibensaid‭  ·  closed 2y ago by Alexei‭

40%
+0 −1
How To Verify Old Password in PHP? [closed]

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...

0 answers  ·  posted 2y ago by rrenildopereiraa‭  ·  closed 2y ago by Alexei‭

77%
+5 −0
Library that is platform-specific via selective compilation?

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...

1 answer  ·  posted 12mo ago by plod‭  ·  last activity 11mo ago by Olin Lathrop‭

66%
+2 −0
Access denied to read SQS queue just created

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...

1 answer  ·  posted 2y ago by Darvids0n‭  ·  last activity 2y ago by Darvids0n‭

25%
+0 −4
Create self-referencing many-to-many relation

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...

1 answer  ·  posted 1y ago by filosoful‭  ·  last activity 1y ago by jimbobmcgee‭

30%
+1 −5
Haskell revision question. [closed]

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 [] =...

0 answers  ·  posted 1y ago by Anonymous‭  ·  closed 1y ago by Alexei‭

28%
+0 −3
Need help in migrating a Python2 custom middleware to current Python3 version

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...

0 answers  ·  posted 2y ago by roronoa_zoroDR‭  ·  last activity 2y ago by Monica Cellio‭

71%
+3 −0
Cast uninitialized variable to (void)

Is it undefined behaviour to cast an uninitialized variable to (void)? Example: int main() { int x; (void)x; return 0; }

4 answers  ·  posted 1y ago by Estela‭  ·  last activity 1y ago by Ethan‭

50%
+0 −0
How to uncollapse an entire link tree with JavaScript?

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...

1 answer  ·  posted 2y ago by deleted user  ·  edited 2y ago by Alexei‭

60%
+1 −0
How to import a vocabulary's test file in factor.

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...

0 answers  ·  posted 1y ago by Razetime‭  ·  edited 1y ago by Razetime‭