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

General Q&A about programming, scripting, software design & architecture, process, tools, testing, and more.

66%
+4 −1
Why are commas not needed for modulo string formatting when printing?

I'm still a novice in Python. But have come across a question about format specifiers. For example, if I have two variables that are called animal and age. And print a string in the console using f...

2 answers  ·  posted 24d ago by Bennshinpoes‭  ·  last activity 6d ago by Mithical‭

81%
+7 −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 2mo ago by Trevor‭  ·  edited 2mo ago by Alexei‭

25%
+0 −4
What factors should be considered when choosing web security measures for a site? [closed]

What factors should be considered when choosing web security measures for a site?

0 answers  ·  posted 2mo ago by Andrew‭  ·  closed 2mo ago by Mithical‭

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 3mo ago by Alexei‭  ·  last activity 3mo ago by Derek Elkins‭

66%
+2 −0
How to compress columns of dataframe by function

Problem How can I compress each column of a dataframe to the output of a function (i.e., mean), preserving columns? MWE import pandas as pd data = {"A": [1, 2, 3, 4], "B": [5, 6, 7, 8]} ...

0 answers  ·  posted 1mo ago by young_souvlaki‭

66%
+2 −0
TeamCity build variables

I want to pass a variable to TeamCity (on prem) to choose between deployment environments (there are 14 of 'em - don't ask) when running a TC deployment configuration build which uses a PowerShell ...

1 answer  ·  posted 2mo ago by mcalex‭  ·  edited 2mo 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&lt;string, integer&gt; 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 4mo ago by Abbas Gadhia‭  ·  last activity 4mo ago by Abbas Gadhia‭

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 3mo ago by filosoful‭  ·  last activity 3mo ago by jimbobmcgee‭

60%
+1 −0
How can I upload images or files to strapi using graphQl

How can I upload images or files to strapi using graphQl. I'm using Cloudinary as the image provider. The strapi admin panel works fine, uploads the images to cloudinary. But, when using graphQl m...

0 answers  ·  posted 4mo ago by Phtremor‭

60%
+1 −0
How to use ReactNative SDK with flexible sync using a code first approach

I am working on a React Native app using Realm, Atlas Flexible Sync, and MongoDB, and I'm super confused about how subscriptions work. I'm coming from a .NET SQL background, so I'm completely new t...

0 answers  ·  posted 16d ago by Scriptastrophe‭  ·  last activity 6d ago by Mithical‭

28%
+0 −3
Built-in way to compute coefficient of variation in pandas

Background The coefficient of variation is: defined as the ratio of the standard deviation to the mean Question Is there a built-in function for this? Tried I know I can do df.std() / df...

1 answer  ·  posted 4mo ago by young_souvlaki‭  ·  last activity 4mo ago by cuzzo‭

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 2mo ago by alx‭  ·  edited 2mo ago by Lundin‭

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: &lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;JS + CSS Clock&lt...

0 answers  ·  posted 2mo ago by Ansh‭  ·  closed 2mo ago by Alexei‭

22%
+0 −5
Replit particles push instead of being background [closed]

I am working on a replit https://AppropriateMessyRoutes.ozabramo.repl.co and I am trying to implement https://github.com/VincentGarreau/particles.js as a background but I keeps on pushing every...

1 answer  ·  posted 4mo ago by ObviousPlays‭  ·  closed 4mo ago by Alexei‭

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

22%
+0 −5
how to use one list to find a similar list in another list python

I want a way to make it so that I can use list B to find out if a copy of itself exists in list A. listA = ['1', '1', '0', '1', '0', '1', 'down'] 2 ['0', '0', '1', '1', '1', '1', 'up'] 2 ['1', '...

0 answers  ·  posted 5mo ago by Solaranfel1366‭  ·  edited 5mo ago by Alexei‭

66%
+2 −0
Does redirecting blog from sub domain to root domain hurts SEO of old blogs?

We have done a reverse proxy to forward blog.example.com to example.com/blog. As I think it gives great help in getting the “link juice” to the root domain. However, I am concerned about any possi...

0 answers  ·  posted 1mo ago by ThomasM‭  ·  last activity 6d ago by Mithical‭

75%
+4 −0
How to programmatically get current wallpaper file path?

I have written a screensaver program that, in part, uses the current wallpaper for some visual effects. However, finding the current wallpaper in different operating systems and environments is les...

1 answer  ·  posted 2mo ago by ghost-in-the-zsh‭  ·  last activity 2mo ago by ghost-in-the-zsh‭

50%
+1 −1
Why does my code show an error at deriving (eq)? (SOLVED) NEW ERROR: At SimpleEnigma & SteckeredEnigma constructors which I need help on :")

Hi, I'm trying to code an Enigma machine in Haskell which were used by the German in WWII to transmit coded messages. An Enigma Machine consists of 3 rotors which are substitution ciphers and a re...

1 answer  ·  posted 5mo ago by Anonymous‭  ·  last activity 5mo ago by Alexei‭

80%
+6 −0
How to use grep to print only specific word from a string

I have a variable that contains a string: $CCSR = "branches/features/arm_and_musl" I want to get only the part after the last /. In this case it's "arm_and_musl" but it can be anything. So som...

3 answers  ·  posted 8mo ago by Megan‭  ·  edited 8mo ago by hkotsubo‭

85%
+10 −0
How to manage user-specific application data on Linux?

I am developing an application that targets Linux-based OS, and I need to store the user's configuration, metadata and other things in a persistent way (i.e. on the file system). I know that one c...

3 answers  ·  posted 7mo ago by Björn‭  ·  last activity 7mo ago by celtschk‭

83%
+8 −0
Is partial allocation of an object Undefined Behavior?

Is it valid to partly allocate an object, as long as you only use the allocated part of it? #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; struct s { int i[100]; }; int main(void) {...

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

75%
+4 −0
How would I fix my IntelliJ IDE? It cannot open and re-installing does not work.

So I was looking around for some async solutions and I found one on github, https://github.com/electronicarts/ea-async I follow the setup instructions for maven. Only to realize it didn't work (I ...

1 answer  ·  posted 4mo ago by cuzzo‭  ·  last activity 4mo ago by cuzzo‭

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 &lt;html&gt;...

1 answer  ·  posted 1mo ago by Moshi‭  ·  last activity 6d ago by Mithical‭

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 3mo ago by true_blue‭  ·  last activity 3mo ago by Moshi‭

75%
+4 −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 1mo ago by hkotsubo‭  ·  last activity 1mo ago by hkotsubo‭

25%
+0 −4
how do i fix this code [closed]

this is my build.gradle.app file: plugins { id 'com.android.application' } android { compileNdk flutter.compileNdkVersion compileOptions{ sourceCompatibility Ja...

0 answers  ·  posted 5mo ago by LSHpqr‭  ·  closed 5mo ago by Alexei‭

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 6mo ago by AdriZ‭  ·  last activity 6mo ago by Dirk Herrmann‭

66%
+4 −1
How to provide additional information when raising exception

MWE filename = "bad_dir" print(f"File not found: {filename}.") raise(FileNotFoundError) Question How do I raise an exception while adding additional information? In the example above, the...

1 answer  ·  posted 5mo ago by young_souvlaki‭  ·  last activity 5mo ago by Alexei‭

50%
+2 −2
What does this function definition mean in Haskell?

What does this function definition mean in Haskell? fn x [] = [] fn x (True:ys) = x : fn x ys fn x _ = []

1 answer  ·  posted 4mo ago by Anonymous‭  ·  last activity 4mo ago by r~~‭

22%
+0 −5
Solution E-Commerce de Paiement [closed]

Salut, quelle solution de paiement e-commerce avec 0% de commission me proposerez vous ?

0 answers  ·  posted 2mo ago by Bicano‭  ·  closed 2mo 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 7mo ago by Estela‭  ·  last activity 6mo ago by Ethan‭

50%
+0 −0
org.apache.http.NoHttpResponseException: nginx.apps.cloud.cloud.local:443 failed to respond

Getting the following error only when I call a post API through Nginx [0m[31m12:48:35,903 ERROR [io.acurio.hub.api.rest.impl.DesignsResource] (default task-16) Failed to invoke workflow: com.masha...

0 answers  ·  posted 6mo ago by SmartestVEGA‭

25%
+0 −4
Does a for...of loop must contain a variable without assignment sign, and why?

The following code pattern reflects this answer. This code contains a for...of loop: for (const child of e.childNodes) { // Do stuff; } Does a for...of loop must contain a variable without...

1 answer  ·  posted 11mo ago by deleted user  ·  edited 11mo ago by hkotsubo‭

50%
+1 −1
Why does a keydown event is listened only once?

The following code (credit for user:hkotsubo) moves the user to another page if Alt+Shift+E are pressed together. window.addEventListener('DOMContentLoaded', () =&gt; { let domain = window.loca...

0 answers  ·  posted 11mo ago by deleted user

57%
+2 −1
What should I read if I knew C++ twenty years ago? [closed]

For someone who was familiar with C++ in the past and is coming back to it after a long break, what are some useful books that won't waste time with basics but will cover the new features of the mo...

0 answers  ·  posted 7mo ago by Fred Wamsley‭  ·  edited 7mo ago by Alexei‭

c++
77%
+5 −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&lt;A, B&gt; { (a: A, b: B): any } function test&lt;...

0 answers  ·  posted 11mo ago by Moshi‭  ·  edited 11mo ago by Moshi‭

75%
+4 −0
How to configure .gitignore to ignore all files except a certain directory

MWE In the terminal run: mkdir mwe cd mwe mkdir dir touch f1.txt f2.pdf dir/f1.txt dir/f2.pdf git init . Create a .gitignore with: * # ignore all !dir/ # except this directory ...

1 answer  ·  posted 8mo ago by young_souvlaki‭  ·  last activity 8mo ago by Moshi‭

45%
+3 −4
Create a list of Niven numbers in Python

There's this new challenge on Code Golf CD and I'm using Python to do it. A little bit of golfing already took place, so the code might look a bit messy for you. Anyway, I'm proud of what I've writ...

2 answers  ·  posted 7mo ago by General Sebast1an‭  ·  last activity 7mo ago by Dirk Herrmann‭

66%
+2 −0
C# WPF datagrid not persisting inserts

I am working with VS 2022 and trying to make a WPF MVVM application. The application updates the items displayed in the datagrid, persisting the changes to the database upon save. However, adding a...

0 answers  ·  posted 10mo ago by FrankLuke‭

60%
+1 −0
Where is the "Just My Code" debug option in Visual Studio Mac?

Title says it all. I found "Step into external code" but not sure if it's the same feature.

0 answers  ·  posted 3mo ago by user34567‭

77%
+5 −0
Which functions in the C standard library must always be avoided?

It would seem that the C standard library is a collection of diverse functions that pretty much just ended up in the standard by tradition or "accident", rather than through some careful plan or ra...

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

42%
+1 −2
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: &lt;configuration&gt; &lt;system.webServer&gt; ...

0 answers  ·  posted 2mo ago by hyousef‭

77%
+5 −0
PGP sign emails sent with git-send-email(1)

How can we use git-send-email(1) to sign patches (emails) with the gpg(1) keyring? I've heard it can be done, but couldn't find anything in the git-send-email(1) documentation nor in a web search.

2 answers  ·  posted 10mo ago by alx‭  ·  last activity 9mo ago by alx‭

33%
+0 −2
Deep linking from another app isn't working for Amazon prime and disney+hotstar

It's not possible to send data to amazon prime and disney+hotstar. I was trying to send user to amazon prime when they click a (video) link (e.g. https://www.amazon.com/gp/video/detail/B01MSPI8JN/r...

1 answer  ·  posted 4mo ago by billy‭  ·  last activity 4mo ago by billy‭

66%
+2 −0
Order a subcollection from linq

I am using linq/EF core to retrieve data via an API call. How do I sort the collection of related data for each retrieved entity? Assume the following structure: an Order is made on a certain da...

1 answer  ·  posted 10mo ago by mcalex‭  ·  last activity 10mo ago by Alexei‭

50%
+1 −1
Rest service doesn't find @GET Method (Jersey Rest service in Gradle).

I have to implement a JSON based REST web service for querying literature. Ordinary users should be able to query data and process it in their clients. The "main user" can adapt database entries vi...

0 answers  ·  posted 2mo ago by Gagamelius‭  ·  edited 2mo ago by Alexei‭

77%
+5 −0
Child div doesn't inherit parent's div background-color

I have a parent div with two child divs. I want the parent div and the child divs to have a blue background color when it's hovered. But the child divs doesn't inherit the background color. It is o...

1 answer  ·  posted 6mo ago by Bennshinpoes‭  ·  last activity 6mo ago by r~~‭

75%
+4 −0
WPF MVVM ListBox not updating

I am trying to combine MVVM in WPF using Microsoft.Toolkit.MVVM. Somethings are working as expected. The text boxes bind to fields and update in both directions. The button command executes and cha...

2 answers  ·  posted 12mo ago by FrankLuke‭  ·  last activity 12mo ago by elgonzo‭

75%
+4 −0
What are the types of DOM nodes?

If I am not mistaken any DOM "tree" node is actually a "branch", which would be an HTML element or perhaps a CSS pseudo-element, of course. If that's true what are the different node types and esp...

1 answer  ·  posted 11mo ago by deleted user  ·  last activity 11mo ago by hkotsubo‭