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)
71%
+3 −0
How to convert Dos paths to Posix paths in Powershell

What is the best way to convert Dos paths to Posix paths in Powershell? eg given: C:\Program Files\PowerShell\Modules\ I want something like: /Program\ Files/PowerShell/Modules/ Is the only so...

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

75%
+4 −0
JavaScript redirect is getting "hijacked" and it is not onbeforeunload event.

My redirect in javascript somehow gets "hijacked" and I don't understand how. Previous developer (who is no longer working with the company) on page load initialized onbeforeunload event like so: ...

1 answer  ·  posted 9mo ago by Vanity Slug ❤️‭  ·  last activity 7mo ago by Vanity Slug ❤️‭

60%
+1 −0
How does scoping work in R?

If I run ls() in R, it shows the variables (including functions) in my workspace. But there are other variables visible too, e.g. functions from packages like ls itself. And if I write a function...

1 answer  ·  posted 7mo ago by djm‭  ·  edited 7mo ago by Alexei‭

50%
+1 −1
How do I properly render a quad in OpenGL using a GL_TRIANGLE_STRIP primitive?

I am currently working with LWJGL and the obstacle I face right now on my project is rendering textures to a cube, e.x a set of 8 vertices with position, color, and UV information. For now, I am st...

1 answer  ·  posted 7mo ago by cuzzo‭  ·  last activity 7mo ago by djm‭

66%
+2 −0
VS Code: How to open a file and folder in a new window?

I've figured out that code --new-window /foo/bar/baz.txt will open baz.txt in a new window. But when I do this, it says "no folder opened" in the file explorer pane. That makes it hard to work with...

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

71%
+3 −0
Clear selectManyMenu component if user unselects item in JSF 2

I am working with JSF 2.3 and have a selectManyMenu component that is marked as required but that I want to be cleared if the user unselects all items. Currently, the user can unselect all items, b...

1 answer  ·  posted 10mo ago by tarhalda‭  ·  edited 7mo ago by BalusC‭

50%
+0 −0
Adding two products into cart with help of a checkbox.

I've created a code snippet in "functions.php" that should add another product to your cart if you mark the checkbox, but somehow, only the original product is add (like the single product from the...

0 answers  ·  posted 7mo ago by gft‭  ·  edited 7mo ago by gft‭

60%
+1 −0
How to delete a local branch in git?

How to delete a local git branch which hasn't been pushed to anywhere, and only exists locally?

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

80%
+6 −0
What is the meaning of "short circuit" operators?

When reading about various operators used by programming languages, the term "short circuit behavior" is often used. For example in this C code: int a = 0; a && b++ Someone explained t...

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

87%
+12 −0
Are there best practices for sticking conditions in WHERE clauses vs the JOIN statement?

Lets say I have two tables, A and B and I need to join a subset of them. Is there best practices of sticking the conditions in the WHERE clause like this, SELECT * FROM A JOIN B on a.fk_b = b....

3 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 7mo ago by billkarwin‭

71%
+3 −0
How should open source forks, with a mix of upstreamable and non-upstreamable commits, be maintained?

I have a few different projects that rely on open source technology that I wish to make modifications to (say, to add key features for business or personal use) that will vary between upstreamable ...

1 answer  ·  posted 8mo ago by eoin.oneill‭  ·  last activity 7mo ago by matthewsnyder‭

62%
+3 −1
How do I remove an element from a Java array?

One way to remove element from array is to replace element with zero. Below is a rough snippet I am sharing: int N = sc.nextInt(); int pos = sc.nextInt(); int A[] = new int[N]; if(pos == i) { ...

1 answer  ·  posted 7mo ago by abhinavxyz‭  ·  edited 7mo ago by E_net4‭

71%
+3 −0
How do I pass field names containing dashes in dbt source yml file?

Working with dbt version 2 I'm trying to set up source checks but I'm running into an issue where the column names I'm setting tests for have dashes (e.g. my_table.some-field-with-dash). I current...

1 answer  ·  posted 7mo ago by Sigma‭  ·  last activity 7mo ago by Sigma‭

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‭

33%
+0 −2
Help with android studio gradle [closed]

I need help figuring out if my dependencies need upgrading or conflict with each other. I tried using the command prompt to solve problems but it didn't help. Here is my code. Android Studio Iguan...

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

50%
+1 −1
Is there a text version of pickle?

Is there a Python serialization format that has capabilities similar to Pickle, but is text based? The problem I always have with pickle is that it's binary, so I can't manually view or edit the d...

0 answers  ·  posted 7mo ago by matthewsnyder‭

84%
+9 −0
What is the point of pipx?

Background Many Python programs now recommend installing with pipx, and there is a sense that you shouldn't install with pip anymore, you should use tools like pipx. Main Question However, what ...

3 answers  ·  posted 8mo ago by matthewsnyder‭  ·  last activity 7mo ago by tripleee‭

60%
+1 −0
Optimized representation for sets?

I need to do a lot of calculations involving sets. There are relatively few values in the "universe" of candidates that could appear in any of the sets, but potentially very many such sets (they mi...

1 answer  ·  posted 8mo ago by Karl Knechtel‭  ·  last activity 8mo ago by Karl Knechtel‭

81%
+7 −0
How do I customize merge behavior for a shared git repo?

I often find it useful to arrange things so that each commit on master's first-parent is a discrete change. It allows git log --first-parent --oneline to be used as a concise, automatically-generat...

1 answer  ·  posted 3y ago by ajv‭  ·  last activity 8mo ago by GrantMoyer‭

75%
+4 −0
How to align my content to the left?

This revolves around images. I'm trying to write an HTML page of COVID-19 safety procedures, and here's what I've written so far: <!DOCTYPE html> <html> <head> <title&...

2 answers  ·  posted 2y ago by General Sebast1an‭  ·  last activity 8mo ago by Peter Taylor‭

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‭

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‭

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‭

66%
+2 −0
Is it okay to use python operators for tensorflow tensors?

TL;DR Is (a and b) equivalent to tf.logical_and(a, b) in terms of optimization and performance? (a and b are tensorflow tensors) Details I use Python with Tensorflow. My priorities are Make t...

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

60%
+1 −0
`git submodule foreach git pull` in parallel

I use git submodule foreach git pull to update my submodules. There's quite a few and it appears that foreach is updating them one by one, instead of in parallel. How can I do it in parallel?

1 answer  ·  posted 9mo ago by matthewsnyder‭  ·  last activity 8mo ago by GrantMoyer‭

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‭

66%
+2 −0
Reaching to a directory in git-bash

I have created a directory named Temporary_add_to_version_control on Desktop. Now I am trying to reach that directory by typing the following in git-bash: cd ~/Desktop/Temporary_add_to_version_con...

1 answer  ·  posted 8mo ago by Birbal01‭  ·  edited 8mo ago by meta user‭

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
50%
+0 −0
What is a Crossfilter group?

From reading about the Crossfilter data manipulation library for JavaScript, I take it that "groups" are an important concept in its operation. However, the Crossfilter documentation does not ever...

0 answers  ·  posted 8mo ago by CavanWright‭

60%
+1 −0
Can't use tf.timestamp() from within @tf.function with XLA / jit_compile=True

I would like to use tf.timestamp() when it is available (eager mode and graph mode without XLA), and use 0. (or a better fallback if there is one) when it is not available (with XLA; @tf.function(j...

0 answers  ·  posted 8mo ago by daniel_s‭

42%
+1 −2
How to implement automatic text-to-link conversion in TypeScript?

I'm trying to create an automatic text-to-link conversion feature in a TypeScript application. The desired workflow is: Copy a URL to the clipboard Select some text Paste the URL - this should...

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

75%
+7 −1
Automatically install all packages needed

When running various Python scripts, I often need to do this annoying dance: $ python script.py ... ModuleNotFoundError: No module named 'foo' $ pip install foo $ python script.py ... Module...

3 answers  ·  posted 10mo ago by matthewsnyder‭  ·  last activity 8mo ago by meta user‭

77%
+5 −0
How can I schedule a later task in Python?

I want my CLI Python program to schedule a task, and then exit. After some times has passed (say 10 minutes) the task should execute. The task can be a Python method or a shell command, whatever i...

3 answers  ·  posted 8mo ago by matthewsnyder‭  ·  last activity 8mo ago by H_H‭

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‭

63%
+10 −5
Is it wrong to demand features in open-source projects?

I have been using open-source software, and the open-source Community is great at maintaining such projects. But I have observed something in smaller open-source projects. Whenever I demand some f...

3 answers  ·  posted 3y ago by theabbie‭  ·  edited 8mo ago by tripleee‭

77%
+5 −0
How to move a tag in git?

I have created a tag in my project, using git tag v2023 However, I forgot to commit a few changes. Now I would like to move this tag to the current point (after having committed the changes I had...

1 answer  ·  posted 9mo ago by mr Tsjolder‭  ·  edited 8mo ago by meta user‭

50%
+0 −0
Embedding other controller-action with Phalcon

I'm trying to revive an old project of mine. It was built with Phalcon PHP 2 or 3 (I don't even remember which version, but quite old). There I could include a call to the loop inside the controll...

0 answers  ·  posted 8mo ago by posthy‭  ·  edited 8mo ago by Alexei‭

83%
+8 −0
How to declare variable-length arrays correctly?

This is meant as a FAQ Q&A regarding variable-length arrays (VLA). The two bugs described below are surprisingly common. I'm trying to use the variable-length arrays feature of C99 (and newe...

1 answer  ·  posted 2y ago by Lundin‭  ·  last activity 8mo ago by Lundin‭

77%
+5 −0
How can I properly type-hint methods in different files that would lead to circular imports?

I am writing a Python package where I have two classes in different files that (indirectly) depend on each other. If I wouldn't care about type-hints, there would be no problem, but unfortunately,...

2 answers  ·  posted 8mo ago by mr Tsjolder‭  ·  edited 8mo ago by Alexei‭

71%
+8 −2
Write to same file from multiple threads

I want to write a text file from multiple threads. The file structure is line-oriented. This means writing of lines should be atomic. I am using Qt 5.15.2. Is it enough to protect a shared QTextSt...

2 answers  ·  posted 3y ago by Silicomancer‭  ·  edited 8mo ago by Shree‭

66%
+2 −0
Android Studio "not showing null elements" in unit tests.

My Android app needs to process lists that contain nullable elements. I am using JUnit 4.13.2 for unit testing. I am using Android Studio Flamingo | 2022.2.1 Patch 2 . I have a failing test,...

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

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‭

71%
+3 −0
How can a Python program send itself to the background?

Is it possible for a Python program to send itself in the background? For example, on Linux you can do nohup some_cmd & and any program will run in the background. Some programs also support s...

1 answer  ·  posted 8mo ago by matthewsnyder‭  ·  last activity 8mo ago by r~~‭

66%
+2 −0
Clone .git repo into current dir, without touching files

I have git repo where the .git is deleted. I didn't realize it until after I made some changes to the code. I want to re-create the .git by cloning. However I don't want it to touch the files that...

1 answer  ·  posted 8mo ago by matthewsnyder‭  ·  last activity 8mo 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‭

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‭

64%
+9 −4
Is omitting braces for single statements bad practice?

Consider this code: while(arr[index] != 0) index++; vs while(arr[index] != 0) { index++; } Personally, I prefer the first. The fact that the braces are not needed makes them -- u...

6 answers  ·  posted 3y ago by klutt‭  ·  last activity 8mo ago by H_H‭

60%
+1 −0
How to put text next to my ImageIcon on a cell in a JTable

I have an application that works with a JTable, and in this JTable, I want each cell to have both an ImageIcon and some text. I see at this link, JTable supports ImageIcon OR text, but seemingly n...

1 answer  ·  posted 8mo ago by davidalayachew‭  ·  edited 8mo ago by Alexei‭

66%
+2 −0
Resolving "fatal: Unable to find remote helper for 'https'" and a warning about templates

On a live boot of Ubuntu 20.04, I was trying to clone into a private GitHub repository. I went through the hassle of installing git, and then gh, and making sure I was signed in through the termina...

0 answers  ·  posted 8mo ago by Mithical‭

git
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‭