Latest Questions

Django Admin OSMWidget not displaying map

We use the Django Admin to set easily a Point. It is easier to navigate through a map rather than write latitude and longitude manually. At the beginning of the

Accessing previous state within a useDispatch method

How do I access previous state inside the callback function in react? Because once I access data it is always returning an initial state version, since I use us

Polyfill for Excel HSTACK and VSTACK array functions

Microsoft has announced many new array functions (https://techcommunity.microsoft.com/t5/excel-blog/announcing-new-text-and-array-functions/ba-p/3186066), inclu

How to rename key value pair within a nested json structure in C#

Hello everyone and thanks for helping me in advance. The following question might sound silly but I'm a beginner about it. Let's start! I have the following jso

Why is `splice(@_, 0, shift)` safe?

The perl 5.18.2 documentation of splice has this example: my(@a) = splice(@_,0,shift); my(@b) = splice(@_,0,shift); And I wonder: If @_ is evaluated before the

Trying to send data from query to another function

first i have two problem here the first problem when i run this query it gives me this Error //ERROR SQLSTATE[42S22]: Column not found: 1054 Unknown column '390

Is there a way to get latest value of a metric in Prometheus while ignoring(without) a label?

PROMQL Query that I tried is - last_over_time(METRIC_ABC{ INDICATORNAME="INDICATORNAME_1"}[6h]) Returns metrics - METRIC_ABC{DATE="2022-04-27", INDICATORNAME="

Vuejs types for component refs

I have following scenario: I have an component here: <div class="border shadow p-2"> <chart :config="barConfig" ref="linechart" /> </div>

How to test a DatePicker component using Jest?

Here is the component to test, its a DatePicker component: import { useState } from 'react'; import { useFormContext } from '../Form'; import Textbox from '../T

Lighthouse CLI for performance while running extension

I have an extension that I would like to measure webpage performance with and w/o it running. I use Lighthouse CLI: lighthouse https://www.bing.com/search?q=cur

How to use same enum in multiple files in Typescript without import

I've been struggling with this now longer than I should and surprisingly, the existing questions (and there are many) don't really help further. My goal is to d

How can we change two values dynamically by using one variable? in yaml script?

we are using gitlab for ci/cd we have two branches for frontend dev branch- workflow: rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_B

How to set Exposure on Camera2 api

I want to set camera exposure.When camera starts i want to set higher values and when it stops it is set to lower value.So i used the below code.On emulator it

Should I always return a promise when I have an async function?

When I write an async function it usually returns a promise: export const myPromiseFunction = async (params) => { // some logic return Promise.resolve('r

Make Text widget shrink to longest line when text is wrapped to multiple lines

Is it possible to shrink a Text widget to the width of the longest line when the text is wrapped because it becomes too long to fit on a single line? Basically

Configuring default micronaut httpClient properties using ConfigurationProperties

I am writing a java library module in Micronaut which has an httpClient. The idea is that my microservices will use this library as a jar dependency and use the

Flutter Carousel, put side items behind the center card

I want to know how to put the carousel items behind the center item, then when it slides there will be no spaces between items but it will stay behind I have th

Kubernetes (Google) insufficient CPU and memory during deployment, autopilot cluster

Any idea why I just started getting "Insufficient CPU" and Insufficient memory" when deploying containers (nodejs api and cloud sql proxy) to Kubernetes. This h

Rails - StimulusJS: how to set target value from within setTimeout?

In my Rails-Stimulus controller, I fetch data in a loop from a function in which I've setTimeout. How do I set the target value from within the setTimeout? My f

Retrieving values from nested json using Python

I have a json string below that i need to pull out all the values for securityId from _source. I expect the result to be NGN33 and NGG2 however the code below o

ASP.NET Core : how to restrict applying custom attribute on condition during compile time?

Here is the sample code: public sealed class CustomAttribute1 : Attribute {} public sealed class CustomAttribute2 : Attribute {} [CustomAttribute1] [CustomAtt

Take function from one file to another (React)

So I'm struggling to pass "polygonNFTs" to another file. I need to find its number to decide give user permission or not. its working in index but not in navbar

find object canny edge detection and remove noise background

Hello i am trying to get this canny edge detection in this but what I achieve is how to remove noise from the background like the example one and only show th

label text is displaying at wrong place when typing

As the image is shown below, the first image displays my text field before I click on it. the second image displays how it displays when after start typing and

map multiple properties to single nested object using typescript and class-transformer

I'm using class-transformer (in nestjs) to convert my database entities into dto types to output from my api. My database entities look like: class MyEntity {

How to link a objective-c library into a c/c++ project

I have this code: for the objective-c library GNUmakefile include $(GNUSTEP_MAKEFILES)/common.make LIBRARY_NAME = libteste libteste_OBJC_FILES = ./src/teste.m

Firebase Assistant missing in Android studio's Tools tab

So I'm building an application with android studio and I am having problems connecting to Firebase. This means that Firebase assistant is not in Tools. Now, a

@Composable funck. into onClick event - Jetpack Compose

I try show AlertDialog when press a button. For AlertDialog i have a composable function - showDialog. It is clear that this function calls a dialog. I have ano

Conditional render + add some extra code in React

I'm aware of some of the conditional rendering methods for React components. Some of them can be found here. Using ternary operatiors, if...elses.... But I want

Update column values based on another dataframe's index

I have the following dataframes: NUMS = ['1', '2', '3', '4', '5'] LETTERS = ['a', 'b', 'c'] df1 = pd.DataFrame(index=NUMS, columns=LETTERS) a b c 1 N