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)
80%
+6 −0
How do I find disjoint sets in a dataset

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

2 answers  ·  posted 10mo ago by andreas‭  ·  edited 10mo ago by matthewsnyder‭

66%
+2 −0
How to automatically add package reference into project file after installing .NET package?

Just getting into F#, finally figured out how to add .NET packages to projects, but the way I managed to get it to work doesn't make sense. Once the package is installed (either with nuget or paket...

2 answers  ·  posted 6mo ago by toraritte‭  ·  last activity 5mo ago by toraritte‭

66%
+2 −0
Pipeline for zipping multiple file chanel into a single output channel

I am in need of downloading some files (from dynamic list of URLs) and archive them into a single zip file. Since these files can be arbitrarily sized (totaling hundreds of MB), I want to avoid dow...

1 answer  ·  posted 8mo ago by tmpod‭  ·  last activity 8mo ago by tmpod‭

75%
+4 −0
What determines where the focus goes back to when clicking on a browser's back button?

As far as I can tell, it is in part determined by the HTML spec's History API1, specifically the value of history.scrollRestoration. Quoting the HTML spec's scroll restoration mode paragraph: ...

1 answer  ·  posted 14d ago by toraritte‭  ·  last activity 5d ago by toraritte‭

57%
+2 −1
What is the difference between hashing and encryption?

According to this article: Since encryption is two-way, the data can be decrypted so it is readable again. Hashing, on the other hand, is one-way, meaning the plaintext is scrambled into a uniqu...

3 answers  ·  posted 2mo ago by Julius H.‭  ·  last activity 2mo ago by matthewsnyder‭

50%
+3 −3
Regex for simplifying Amazon product URLs

Amazon product URLs are often very long, but on experimentation it is revealed that the following pattern is sufficient: https://www.amazon.com/{dp|gp}/$ID ID is a 10-char string, which I'm gue...

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

57%
+2 −1
How to write a bash function to sanitize filenames for Linux and Windows

I'm trying to write a bash function that can sanitize filenames to make them compatible with both Linux and Windows file systems. The function should perform the following operations: Replace in...

0 answers  ·  posted 19d ago by ShadowsRanger‭

66%
+2 −0
Remove entries by two-column ID everywhere, that meet a condition somewhere

MWE import random import pandas as pd from itertools import product random.seed(12345) dies = [1, 2] cells = list(range(10)) currents = [100, 200, 300] dcc = list(product(dies, ce...

3 answers  ·  posted 1y ago by mcp‭  ·  edited 7mo ago by mcp‭

75%
+4 −0
Replace leaf arrays with joined strings in a nested structure in jq

Consider the following arbitrarily-nested JSON as input to a jq filter: echo '[{"foo": [1, 2]}, {"bar": [{"baz": ["foo", "baz"]}]}]' | jq '.' My goal is to join leaf arrays into strings: [{"fo...

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

60%
+1 −0
How do I install Chart.js as a file?

I'm trying to replace Flot.js with Chart.js. In my application, Flot.js is included as a normal JavaScript file, like so: <script language="javascript" type="text/javascript" src="jquery.flot-...

1 answer  ·  posted 7mo ago by CavanWright‭  ·  last activity 7mo ago by Ullallulloo‭

71%
+3 −0
Problems with Google Apps Script API JavaScript "How to... Execute function"

As this is the first question about Google Apps Script, here is a very brief description: it is a platform that helps people easily get programmatic access to Google apps data like Gmail messages, ...

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

66%
+2 −0
How can I manage multiple consecutive strings in a buffer (and add more later)?

This question is inspired by If I have a char array containing strings with a null byte (\0) terminating each string, how would I add another string onto the end? on Stack Overflow. Suppose I have...

2 answers  ·  posted 1mo ago by Karl Knechtel‭  ·  last activity 1mo ago by Lundin‭

66%
+2 −0
Does Snowflake NATURAL JOIN support outer-style join?

I like using NATURAL JOIN in Snowflake, because I find it more elegant than explicit join clauses. However, it appears that the natural join behaves similar to an inner join, in that null values o...

1 answer  ·  posted 10mo ago by matthewsnyder‭  ·  edited 9mo ago by matthewsnyder‭

80%
+6 −0
Name for host + path (parts of a URL)

Among other things, a URL consists of a host and a path: I was wondering (and couldn't find anything) if there's a name for the combination of host and path. Is there a name for these: examp...

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

url
66%
+2 −0
Get list of all variables from Jinja template

Suppose you have a jinja template like this: I am going to {{ foo }} to get some {{ bar }}. I hope I can find: {% for i in baz %} - {{i}} {% endfor %} This template will require you to pass ...

0 answers  ·  posted 6mo ago by matthewsnyder‭  ·  edited 6mo ago by Karl Knechtel‭

42%
+1 −2
Program freezing in `post_comments_to_lemmy` function due to potential infinite loop

I'm experiencing an issue where my program appears to freeze when executing the post_comments_to_lemmy function. This function fetches comments from the GitHub API and posts them to a Lemmy instanc...

1 answer  ·  posted 10mo ago by ShadowsRanger‭  ·  last activity 10mo ago by __blackjack__‭

60%
+1 −0
How to use Ansible extract filter in map with an external dictionary

Ansible's extract filter is supposedly made for use in map, but at the time of writing the documentation doesn't actually show how to use it together with the map filter. The following outputs VAR...

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

60%
+1 −0
How to start creating a Giraffe web project and how to serve it?

Having some trouble with giraffe-template on Mac M1, so decided to set up a Giraffe project manually. Started following the Doing it manually section of the Giraffe README, but got stuck right away...

1 answer  ·  posted 1mo ago by toraritte‭  ·  last activity 1mo ago by toraritte‭

77%
+5 −0
Why does calloc accept 2 arguments, and with what arguments should one call it?

According to the standard (C17 draft, 7.22.3.2) The function calloc void *calloc(size_t nmemb, size_t size); "allocates space for an array of nmemb objects, each of whose size is size [and] i...

1 answer  ·  posted 8mo ago by Lover of Structure‭  ·  last activity 8mo ago by Lundin‭

81%
+7 −0
How do I add functionality to the back button?

How do I add functionality to the back button in Android without reimplementing the back button entirely? Prior to last year, I would just call onBackPressed() and then simply override it: overri...

1 answer  ·  posted 10mo ago by Ullallulloo‭  ·  edited 10mo ago by Ullallulloo‭

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‭

50%
+0 −0
Best practices to write functions for both execution modes in Tensorflow, eager and graph mode

I regularly run into the problem that I have a Python function that I want to use in both, eager and graph execution mode. I therefore have to adjust the code so that it can handle both situations....

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

62%
+3 −1
How does a client verify a server's SSL certificate? What are the specific steps?

I have little to no idea what happens after a client obtains the server's certificate. It has to make sure that it (somehow) valid, but how?

1 answer  ·  posted 5mo ago by toraritte‭  ·  edited 5mo ago by toraritte‭

66%
+2 −0
How can I return XML from BeforeSendRequest and AfterReceiveReply to the calling method in a thread-safe way?

We have a console application using the Azure WebJob SDK. The WebJob relies on a WCF service using SOAP, which it accesses through a DLL we wrote that wraps the auto-generated WCF types in somethin...

1 answer  ·  posted 11mo ago by Celarix‭  ·  edited 10mo ago by Alexei‭

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
Running mvn validate does not show rules passed message though it should

My large, multi-module Maven project validation (Maven Enforcer plug-in) is playing tricks on me. moduleA> mvn validate correctly finds all modules runs enforcer on all of them displays co...

0 answers  ·  posted 10mo ago by LAFK‭

60%
+1 −0
How to solve the "ReferenceError: service is not defined"?

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‭

81%
+7 −0
How to verify if a year is leap in Java?

How to verify if a year is leap? Given a numeric value (such as 2023) or some object that represents a date (such as Date, Calendar, LocalDate, etc), how can I do it?

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

71%
+3 −0
Is it possible to get the current function in a trace function?

I'm trying to subclass pdb to have a debugger that, in case of a call to a decorated function, can "step in" the decorated function directly and skip the decorator content altogether. A well-behave...

1 answer  ·  posted 12mo ago by luser‭  ·  last activity 12mo ago by r~~‭

86%
+11 −0
Alternatives to `EXPLAIN ANALYZE` for queries that won't complete

I have a large and complex PostgreSQL SELECT query that I would like to make faster. EXPLAIN suggests it should run quickly, with the worst parts being scans of a few thousand rows. When run, it do...

2 answers  ·  posted 7mo ago by Emily‭  ·  last activity 7mo ago by matthewsnyder‭

66%
+2 −0
Method not found when emitting a custom signal, but the game seems to work when played.

In Godot 4.1.1 I moved some scenes and started getting parenting errors. I think I got that fixed, but I'm mentioning it in case it is important. I have an Area2d called House. house.gd has two c...

1 answer  ·  posted 5mo ago by TecBrat‭  ·  last activity 5mo ago by TecBrat‭

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 ❤️‭

25%
+0 −4
Configure port in Gbee.ai [closed]

How do one configure a port in GBee.ai framework.

0 answers  ·  posted 7mo ago by nishnatadat‭  ·  closed 7mo ago by Alexei‭

60%
+1 −0
Best practices for business versioning within Web APIs

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

0 answers  ·  posted 4d ago by Alexei‭  ·  edited 4d ago by Alexei‭

77%
+5 −0
What is the purpose of having underscored names and then defining a non-underscored alias to it?

In a C implementation in <stdio.h> on Linux I saw something like: extern FILE *__stdinp; extern FILE *__stdoutp; extern FILE *__stderrp; And then: #define stdin __stdinp #define stdou...

1 answer  ·  posted 5mo ago by 90 98‭  ·  last activity 5mo ago by aghast‭

60%
+1 −0
MongoDB Java Morphia case insensitive criteria query?

So I googled some on how to make a case insensitive criteria query but could not find the solution very easily. So I basically have code that looks like this: ... query.criteria("fieldName").con...

1 answer  ·  posted 3mo ago by propatience‭  ·  edited 3mo ago by propatience‭

50%
+0 −0
Why does `let map f = id >=> switch f` work in F#?

Asked How to implement map using the fish (>=>, Kleisli composition) operator in F#? a couple of hours ago, and r~~'s answer blew my mind: let map f = id >=> switch f It is perfect ...

1 answer  ·  posted 24d ago by toraritte‭  ·  edited 16d ago by Alexei‭

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‭

77%
+5 −0
Why does this work? .collect() automatic conversion to function return type

I'm completing the rustlings exercises as part of self-teaching Rust. While working on the third iterators exercise, I solved the exercise but don't quite understand why my solution works. Specifi...

1 answer  ·  posted 2mo ago by qohelet‭  ·  last activity 2mo ago by Iizuki‭

86%
+11 −0
Git: How to clone only a few recent commits?

How do I clone the repository with only part of the history? For example, let's say I want to download only the last 5 commits out of thousands.

2 answers  ·  posted 8mo ago by matthewsnyder‭  ·  last activity 8mo ago by hkotsubo‭

75%
+4 −0
How do I pull new changes in git submodules?

I have a git repository with some submodules. When the submodule repos get new commits on the remote, how can I pull them all?

0 answers  ·  posted 9mo ago by matthewsnyder‭

71%
+3 −0
OpenGL: Pass a double vector from vertex shader to fragment shader

TL;DR: How to pass a interpolated double vector, such as a dvec2, from the vertex shader to the fragment shader? I have a vertex shader. In this the output variable out vec2 uv; is set. And i have...

1 answer  ·  posted 8mo ago by H_H‭  ·  last activity 8mo ago by H_H‭

22%
+0 −5
AttributeError: module 'azure.cognitiveservices.speech' has no attribute 'VoiceProfile' [closed]

I need to use azure.cognitiveservices.speech. However I am getting this error: Here is code on replit it produces the same error. https://replit.com/@mystickain420/Chatty main -- https://githu...

0 answers  ·  posted 4mo ago by KunningFox‭  ·  closed 4mo ago by Alexei‭

66%
+2 −0
What does the w3c standard say about tabbing away from a disabled element?

I'm looking at the behaviour of Chrome and my test framework and trying to understand what the correct behaviour should be before raising an issue/ticket on one or the other (or revisiting how my t...

0 answers  ·  posted 9mo ago by pureferret ‭  ·  edited 9mo ago by Alexei‭

37%
+1 −3
We app is terminated automatically at Windows server

I've my go app the is running a web API and working smoothly at my laptop. I read this and completed the IIS setup using a config file: <configuration> <system.webServer> ...

0 answers  ·  posted 1y ago by hyousef‭

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‭

25%
+0 −4
Having problems with my php script [closed]

The exam checking for the backend is working perfectly well but the front end keeps saying an error occurred. Am like ok then tried the demo version replaced the javascript and everything i can rep...

0 answers  ·  posted 4mo ago by zick853‭  ·  closed 4mo ago by Mithical‭

60%
+1 −0
How to call static methods in ColdFusion?

How to use static functions in ColdFusion? How to import component? How to call a static function using both tag and script syntaxes? Adobe added support for static functions in ColdFusion...

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

41%
+3 −5
Building a language model completely from scratch

What I would like to do I would like to try to build a language model 100% from scratch if possible, for a learning experience. That means no external libraries and no pre-curated datasets. It ...

1 answer  ·  posted 3mo ago by Julius H.‭  ·  last activity 2mo ago by matthewsnyder‭

75%
+4 −0
Can Matlab packages have subdirectories?

I'd like to organize my Matlab packages into folders. However, if I try to lay out my code like this +MyPackage |---foo.m |---SubDir |---bar.m then I'm unable to reach bar. F...

1 answer  ·  posted 12mo ago by zaen‭  ·  last activity 12mo ago by zaen‭