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
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
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 7mo ago by mr Tsjolder‭

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 7mo ago by meta user‭

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%
+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 7mo ago by ggorlen‭

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‭

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‭

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‭

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‭

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

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‭

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‭

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‭

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

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‭

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‭

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‭

85%
+10 −0
What is C23 and why should I care?

The C language has gone through many iterations and the latest one not yet released is informally called "C23", supposedly because they hoped to release it in 2023. The latest draft version N3096 i...

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

c c23
50%
+1 −1
How to resolve a "ValueError: dimension 't' already exists as a scalar variable" arising when I am using xarray.Dataset.assign_coords()?

I have the following xarray Dataset: d: <xarray.Dataset> Dimensions: (x: 79, y: 63, t: 1) Coordinates: * x (x) float64 0.9412 1.882 2.824 3.765 ... 71.53 72.47 73.41 74.35 * ...

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

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 8mo ago by ZILtoid1991‭  ·  edited 8mo ago by Karl Knechtel‭

77%
+5 −0
Terms for types of functions with respect to side effects

Mathematically, the purpose of a function is to return an output. However, in a programming context functions often have side effects. It is even common to call functions for the side effects alone...

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

75%
+4 −0
Readable syntax for executing many callables with useful side effects

In Python, multiprocessing is easy to do if you follow a "list projection" paradigm. Say you want to take a list of inputs X and apply some function f to every x_i, such that y_i = f(x_i) and the y...

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

80%
+6 −0
Why is git merge from rather than to?

Why does git merge take the source branch rather than the destination branch as a parameter? The most common merge case by far for me is "Okay, this branch looks good, let's merge it into branch X...

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

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

71%
+3 −0
How can I output / display multiple values, with controlled spacing, without building a string?

I know that I can display a single string in the terminal window like print("example") (or similarly with a string in a variable), and I know how to open text files and write to them. I also know ...

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

66%
+4 −1
How can I build a string from smaller pieces?

Suppose I have some variables like: >>> count = 8 >>> status = 'off' I want to combine them with some hard-coded text, to get a single string like 'I have 8 cans of Spam®; b...

2 answers  ·  posted 9mo ago by Karl Knechtel‭  ·  last activity 8mo ago by Karl Knechtel‭

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‭

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

87%
+12 −0
What are statements and expressions?

When I have tried to read technical explanations of the syntax rules for programming languages, and when I am trying to decipher error messages, I often encounter the terms expression and statement...

4 answers  ·  posted 9mo ago by Karl Knechtel‭  ·  last activity 9mo ago by Dirk Herrmann‭

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‭

71%
+3 −0
How do I serialize a const generic length array with Serde?

I have the following code: use serde::{Deserialize, Serialize}; #[derive(Sereialize, Deserialize)] struct Container<const SIZE: usize> { contents: [String; SIZE] } But I'm getti...

0 answers  ·  posted 9mo ago by mousetail‭

66%
+2 −0
VS Code can't find node installation due to dynamically setting the PATH

I installed Node.js using NVS to manage my node installations. This works great, except that I haven't been able to figure out how to debug using VS Code. When trying to launch, I receive this err...

0 answers  ·  posted 9mo ago by Moshi‭

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 7mo ago by GrantMoyer‭

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

71%
+3 −0
How to resolve the mypy error "Returning Any from function declared to return 'Dict[str, Any]'" in Python?

I have a function that loads JSON data and is declared to return a dictionary with string keys and values of any type (Dict[str, Any]). However, mypy is raising an error stating that I am returning...

1 answer  ·  posted 9mo ago by ShadowsRanger‭  ·  last activity 9mo ago by Moshi‭

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%
+2 −2
Slicing a dictionary using a string variable

I am working on adding uncertainty to some of my dynamics within a larger Monte Carlo simulation. As a way to perform multiple operations on each value, I decided to make and use a new function to ...

1 answer  ·  posted 9mo ago by megalomaniac‭  ·  edited 9mo ago by megalomaniac‭

66%
+2 −0
"Move symbol" refactor for Python in Visual Studio Codium

Is there a way to add support for "move symbol" in Python code for VS Codium? PyCharm can do this, but I am looking for a VSC solution. PyLance can do this, but PyLance itself is closed source, a...

0 answers  ·  posted 9mo ago by matthewsnyder‭  ·  edited 9mo ago by matthewsnyder‭

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‭

66%
+2 −0
Redux Toolkit Issue with Managing States

I am all new with using Redux Toolkit, I followed the official documentation to setup the store: // store.ts import { configureStore, ThunkAction, Action, combineReducers } from '@reduxjs/toolkit...

0 answers  ·  posted 9mo ago by boudagga.ma94‭

60%
+1 −0
What can be used in react-native instead of an html label tag to achieve the same result?

I wanna make a form in React native. A field in this form in (non-native) React would be like this: <div> <label htmlFor="lastName">Last Name:</label> <input type="text...

0 answers  ·  posted 9mo ago by andre‭  ·  edited 9mo ago by andre‭

66%
+2 −0
Maven exec:exec fails to see executables

I am stumped at Maven exec plugin. Running mvn exec:exec -Dexec.executable="curl" (or "echo") works. But when running mvn exec:exec or mvn exec:exec@b (or @a) it fails saying The parameter 'exe...

0 answers  ·  posted 9mo ago by LAFK‭

33%
+2 −6
How do I use an existing AI model to classify pornographic images? [closed]

In the last few months, AI has advanced considerably, notably in the area of generating images. We now have powerful models like DALL-E, Stable Diffusion, etc. These are quite competent at generati...

0 answers  ·  posted 9mo ago by matthewsnyder‭  ·  closed 9mo ago by Alexei‭

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 9mo ago by ShadowsRanger‭  ·  last activity 9mo ago by __blackjack__‭

80%
+6 −0
How to use function composition for applying a function to first elements of a list?

Can anyone explain to me why my Haskell function gives rise to a type-definition error? Originally, I wrote the following function to subtract one from the first n elements in a list: dec_first :...

2 answers  ·  posted 9mo ago by mr Tsjolder‭  ·  last activity 9mo ago by mauke‭

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 9mo ago by matthewsnyder‭  ·  edited 9mo ago by matthewsnyder‭