Latest Questions

After installing TypeScript, why does "Peek Definition" in Visual Studio Code stop working?

I'm very new to TypeScript and am trying to figure why, when transitioning a project to TypeScript in Visual Studio Code, "Peek Definition" stops working. Befor

Get window from XEvent

I'm struggling figuring out how to obtain the window a specific event was triggered from. What I want to achieve is the following: Capture XCursorNotifyEvent Fi

How to write test cases for Service layer using Junit 4 and mockito

My Repository layer is returning list object, But in my service layer i am filtering out all other and return a single Object. when i try to create test cases i

React state management rendering for one object or array of objects

I'm learning React and starting with handling state in a CRUD form via the useState Hook. Something like this: const [data, setData] = useState({}); where data

Is sso (single sign on) without redirection good?

I built a sso server sso.mydomain.com. The common sso implementation is to redirect users to the sso server to login then redirect back. But is it simpler to aj

Installing Dlib gets into error requseting cmake.. and c++

I have installed cmake and configured via env and after that too dlib wont install i need dlib because i want to install face-recagation complete logs are here

Azure Devops Deploy Docker image to ec2 instance

I hope somebody can direct to the best approach to solve this matter. I have an azure account on which I have an azure container registry holding my docker imag

Pyspark - explode return an empty dataframe when a nested collection has no item

I have the following dataframe +---------------+--------+ |book_id |Chapters| +---------------+--------+ |865731 |[] | +---------------+----

Content-Disposition: download file automatically

The API call to the server is returning a zip file with Content-Disposition in format attachment, <filename> I am using FileSaver's saveAs to save the fil

Parsing error: require() of ES Module not supported

I was coding and out from nothing I'm getting this error and I don't know what to do. I've tried everything on stackoverflow and other sites already and nothing

How can I make swift package management make offline? Every time I open a project, it begins downloading, which takes longer when the project is huge

Every time I open a project, it begins downloading, which takes longer when the project is huge.

how do I find the average of this array but only for the values that are not equal to zero in python [duplicate]

array([1500, 1520, 1540, 1590, 1590, 1600, 1600, 1560, 1560, 1560, 1580, 1520, 1460, 1510, 1520, 1320, 1320, 1300, 1300, 1320, 1320, 1320, 132

Is there a way to keep the order of cases as defined, while running bundle exec rspec {file_path} --format documentation?

I am having a problem while running bundle exec rspec spec/services/abc_service_spec.rb --format documentation The output of it, is not in the same order as th

Aggregates with Knex and Javascript

I have an application built using javascript, react, express, and postgreSQL. I have used knex to create and seed my database. The majority of the functions suc

Discord bot won't go online

I've just started learn python and my discord bot won't go online. it just said " Process exit with exit code 0". And there's no error with the code. here's my

How to fix "shutdown: NOT super-user" when using a shutdown script in Python? [duplicate]

I got this script import os shutdown = input("Do you wish to shutdown your computer ? (yes / no): ") if shutdown == 'no': exit() else: os

Updating RDS snapshot export into S3

We have some data in our Mysql RDS, which slows down our application, but it's no longer needed. So we want to remove old records but keep them somewhere so our

Migrate mailbox to O365 with onprem database not mounted

We have problems with a mailbox databases on prem exchange 2013 server, it shows as Dismounted. We have try everything to repair and mount the database again bu

What are the implications of using a variable declared outside of an async context as a placeholder for its return values?

I understand that if the variable was declared outside of the function, it should be marked as global. But what about this case? Is it safe to do something like

Flutter: Using a (Future) http post request in ChangeNotifier

in one of my ChangeNotifier, if have an authentificate method. This is a method, that gets an auth - token with a Future gettoken function and then sets the som

How to multiply three inputted numbers in assembly using emu8086?

I'm sorry for asking this without any code to show you, but my teacher assigned us to make something like this as a surprise quiz, and me and my classmates don'

How to add tailwind to a .less file

I have a gatsby project that uses .less as the CSS preprocessor, adding tailwind to it as shown in the docs does nothing @tailwind base @tailwind utilities @tai

With arrays, why is it the case that a[5] == 5[a]?

As Joel points out in Stack Overflow podcast #34, in C Programming Language (aka: K & R), there is mention of this property of arrays in C: a[5] == 5[a] Jo

Next.js is not recognizing '@types/react'

When I try to run my Next.js app with npm run dev I get an error message saying that I don't have the required packages to run Next with Typescript: Please inst

Is it possible to calculate the value after overflow?

I understand that if 1 is added to INT_MAX it will overflow and we will get the negative maximum. It is connected in a cycle. In the code below can I calculate

Providing an S3 upload task with AWS creds?

I'm currently using a service connection for this: - task: S3Upload@1 inputs: regionName: 'us-east-1' bucketName: 'bucket' sourceFolder: '

Mongoose query always returns empty array

Im trying to make a greater than query but it always returns an empty array. const productSchema = require("./productsSchema"); const getProductsGreaterThan

Angular Migration Error for Version 13.0.3

I got the following issue while upgrading from Angular 12 to 13.0.3. Using package manager: 'npm' Collecting installed dependencies... Found 79 dependencies. F

flutter TextField use cause KeyboardListener alway show keyboard on event

using KeyboardListener to gain barcode from scanner, i can't resolve a incredibly stupid problem. scanning first with keyboardListener work perfectly. events ar

How to use python to create and modify windows shortcuts

Based on most of the postings I have read, I need to import winshell in order to create a Windows shortcut using python. But I am running Anaconda python and wh