Latest Questions

Replace items of a longer list with matches from a shorter list

My goal is to compare two lists as follows: Take every item in long_list and compare it for substrings to the entire short_list. If there is a match, add the it

Designing POST response body for different types of responses

From my client application I make a POST call to a \validate end-point. This call is made to execute the controller on the server side and not to create any res

Rails validation error message not showing

I am trying to add a custom error message for my model validation. Seen below: validates :cost, numericality: { greater_than_or_equal_to: 0, message: :custom_er

href not accepting loop Django

<table id="tabledata" class="tablecenter" style=" position: static; top:50%;"> <tr> <th>Username</th> <th>Email</th>

Install requirements.txt uses a different path

Fellow users, I am trying to install a requirements.txt file (via cmd prompt: "pip install -r "path\to\file"). The problem is that my system returns an OSError

run glue container locally using docker-compose

I would like to run REPL shell (Pyspark) from the glue container using this command $ docker run -it -v ~/.aws:/home/glue_user/.aws -e AWS_PROFILE=$PROFILE_NAME

Add eventlistener to multiple elements to execute multiple functions

I am trying to add an eventlistener to 2 objects but only get it to work with 1. There are 2 textinputs which both should execute 4 functions on input. The firs

React error: Each child in a list should have a unique “key” prop [duplicate]

Each child in a list should have a unique "key" prop. Screenshot

Cannot do drag and drop test in cypress

How to automate the drag and drop feature in an application using cypress? I am not able to pick a file using cypress. I have tried using cypress-file-upload

SwiftUI: View does not fully update, lags behind when its @ObservedObject is updated from parent?

I have the following code: struct ContentView: View { @Environment(\.managedObjectContext) private var viewContext @State var selectedItemMOID

The named parameter 'child' isn't defined. - in container

I want to use "child" to create a row in a container, but unfortunatly I am getting this error: The named parameter 'child' isn't defined.:29 What I am doing w

foreign key constraint failed (code 787 sqlite_constraint foreign key)

I have been using the Android Studio App for about a month now,in order to create a project for a university subject. Unfortunatelly,I came across a problem whi

How to make a custom context action in Intellij IDEA using a plugin?

I wanna make a simple context action (the one that appears when you click Alt+Enter) using a plugin. But I can't figure out the group I need to add and how to i

Unable to install Pod in Mac M1 pro

I was getting this error when I tried to run pod install require': dlopen(/opt/homebrew/lib/ruby/gems/3.1.0/gems/ffi-1.15.5/lib/ffi_c.bundle, 0x0009): tried

Regex to match Python docstrings

I would like to parse Python docstrings as follows: Summary of class that is multiple lines. Parameters ---------- param1 : str Param 1 is a param Returns

Ignoring an object in struct is nil and not when it's an empty array

Is it possible to only use omitempty when an object is nil and not when it's an empty array? I would like for the JSON marshaller to not display the value when

I cannot add new destination into navigation component in android studio

I got some problems when I create a navigation graph to control fragments, the problem is that whenever I add any new destination to this graph, this destinatio

How to use a same Input action to trigger different events when used on different objects in UNITY?

I'm facing a small problem with the unity's New Input system. I'm trying to build a VR game that has floating buttons in the scene. I have used a gaze reticle f

Typescript: How can I cast a variable as an element of an array?

Array: const myStrings = ["one", "two", "three"]; const newString = "two"; newString will simply be of type string, but I want the type to be something like e

WOPI Token - Secret Key

I'm trying to implement WOPI on my application but im having a hard time to find the secret key to generate a token see below image for the sample code from git

How to drag points with it's connecting line in html5 canvas?

Following is my code. I have face issue when I drag a point. The problem is that whenever I drag point all the line connect to one point. I need to have draggab

Dayjs Locale with React

So I'm trying to show locale of German in my React app with dayjs but is not working, here is my code, i tried to add locale('de') but that is not doing the job

Filtering list of objects based on attribute

I have 4 objects. class MyObject: def __init__(self, id: int, result_name: str): self.id = id self.result = Result(result_name) class Resu

When I go to login page it is in desktop mode (responsive design disappear)

everyone! I am working on a project that is based on this template. Everything is OK on the template except for the login page. The problem there is that when s

find all HealthcareService resources for a given Practitioner - fhir search

I'm struggling a bit with reverse chaining in fhir search. I can find all PractitionerRole resources for a given Practitioner with: [base]/PractitionerRole?prac

How to display post from spesific custom post type's category on Elementor free?

I am trying to make an Elementor module for Custom Post Type, separate into 2 files. [File 1] for setting control. [File 2] to display the custom post type on t

Sql function to remove values from follower table that are common in unfollow table

I want to calculate total followers of a person from follow and unfollow table using SQl. Form of table are as follows Follow table: Unfollow table: My tries:

I define column index parameter in my arrow function but i can use in my useEffect causes is not define

I define column index parameter in my arrow function but I can use in my useEffect causes is not define! What can I do? useEffect(() => { const resizeOb

Efficiently upsert thousands of records to mongodb

We have a database containing around ~20 Million records with an indexed field order_id. Every day, after each hour, we receive an incremental update, starting

Python substring matching question and or logic [duplicate]

I am starting to learn Python and writing a small script with the following logic and can understand the reason for the output or the results