Latest Questions

How can I add a conditional within my model that changes a model field based on a previous fields value?

Using Django/python. So I have a 'food' model that is taking multiple user inputs, one of which is 'type' and has the options of 'fresh' and 'pantry'. Another i

UWP App will not build using windows-latest (windows 2022) on Azure Pipeline

I am trying to build a UWP app using the latest version of windows for my vmImage, currently the build script looks like this: Build script Code # Universal Win

How to do if else condition on Pyspark columns with regex?

I have a pyspark dataframe event_name 0 a-markets-l1 1 a-markets-watch 2 a-markets-buy 3 a-markets-z2 4 scroll_down This dataframe has event_name column EXCL

Android camera intent

I need to push an intent to default camera application to make it take a photo, save it and return an URI. Is there any way to do this?

Pytest does not find my tests in Poetry project (VSCode finds)

I've just created my first Python package using Poetry using the usual poetry new mypackage command. My problem is that pytest does not execute any test when I

Can we create ksql table from topic together with topic data?

I have a db connector, which will detect the timestamp column update on my user table on my database and push it to my kafka topic. Thus, my kafka topic will ke

Mongod Active: Failed (code=exited, status=217/USER)

I am using ubuntu16.04 on VPS. It has been migrated to another company's VPS and is in use. nginix works fine and my node application works fine. When the mongo

Cannot create leases container (Gremlin API) with /id as partition key, but comos db trigger requires /id as partition key

I am trying to create a cosmos db trigger for Gremlin API, since the trigger requires partition key as /id, I am not able to create it either from settings in t

How to save a UUID in SwiftUI using @AppStorage

When using @AppStorage("navigationWaypointID") var navigationWaypointID: UUID? I get a No exact matches in call to initializer. I can work around by using a St

Entries are outputting mutliple times

My entries field is outputting the correctly selected FAQs multiple times? I have an FAQ structure which has my Questions and Answers. I then created a Entries

How to create Update method inside the same page as the user profile?

So as you can see here's my profile page i just want to create an update method here. Is it possible to do inside this page for the update method? I'm still new

How is data transferred between two Python scripts

as an example I have two scripts, say script1.py f = open("output1.txt", "w") count = 1 for i in range(100): f.write(str(count) + "\n

Typescript, merge object types?

Is it possible to merge the props of two generic object types? I have a function similar to this: function foo<A extends object, B extends object>(a: A,

I'm trying to make a function that takes a 2d array as a parameter and outputs a normal array containing every unique number, in java

The function needs to have a 2d array as a parameter and then return a normal array with all the unique numbers. If the 2d array is [ [1,1], [4,2] ] then it sh

How to download multiple files using wget in linux and save them with custom name for each downloaded file

How to download multiple files using wget. Lets say i have a urls.txt containing several urls and i want to save them automatically with a custom filename for e

How to make a random sample of panel data (keeping all years for each randomly selected id)

I am using an unbalanced panel dataset, with multiple ids, each with 1 or more years of data. I would like to work with a smaller dataset as I build my code. I

Windows Container Access is denied. (0x5). using Powershell. But still accessible on Docker Desktop CLI tool

I am running a docker-compose up and spinning up my Windows containers. Then I want to attach to a container. I tried docker attach <container id>, but i

ManifestV3 new promise error: The message port closed before a response was received

I'm working on an extension that does a lot of message-passing between its content scripts and the background service worker (manifest V3), and I've noticed an

Run powershell scripts from a C program

I'm creating a C program to run several powershell scripts. But when I run the command with the system function it opens the script in a txt file instead of run

I could not connect to docker daemon from remote in ubuntu 20.04

I want to run docker daemon for remote connection without any TLS verification. So based on this I edit file /lib/systemd/system/docker.service and add two belo

Why do “specific” component renders a more “generic” one?

This is straight from reactjs site. function Dialog(props) { return ( <FancyBorder color="blue"> <h1 className="Dialog-title"> {

How to plot nodes of different shapes and facecolor of bbox in the same graph using networkx and matplotlib in Python?

I want to plot a simple graph using networkx. There are two nodes with labels Python and Programming in each. The code and graph are as follows: import networkx

Localhost refused to connect in Visual Studio code

Im working on a node.js file and when I run the API I get a ERR_CONNECTION_REFUSED error on chrome.The Error Page

How do I determine the correct path for FXML files, CSS files, Images, and other resources needed by my JavaFX Application?

My JavaFX application needs to be able to find the FXML files to load them with the FXMLLoader, as well as stylesheets (CSS files) and images. When I try to loa

How to draw a HSV Triangle in ue4 Materials

This material will be applied to the image object in the widget. It is also important that there is an opportunity to change the color! Hue Ring & Triangle

How do I compare strings in Java?

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals()

PDDL is not compiling. Log files gave me a bunch of errors

I am very new to PDDL and I got an assignment due soon. For some reason, it is not compiling and keeps giving me errors but the log file is so messy and I can n

how to fill missing in one column based on another in r

I have a subset of data frame as below. I want to fill the NAs in column "age at disease" so that the age of one individual with disease be same as the sibling

How to connect to Docker container with localhost instead of 127.0.0.1

I am running a mcr.microsoft.com/mssql/server docker container for local development that works perfectly on one machine. But on my laptop the container is some

Add string and integer from one line string generate by speech recognizer to 2 separate list

I have some string from speech recognizer and the value is random but in the same form (x,y...n) MyOrder = 'orange 2 grape 3 apple 4 mango 5 banana 1' How to a