Latest Questions

How to do PCA on multiple images by flattening the tensors?

I have an array of tensors for a single image. I want to flatten the vectors and perform PCA on the same. The below is the code to extract the tensors on a sing

Why my navbar is not working for small devices?

I'm doing a small project using react, where I needed navbar, so I copied the navbar code from flowbite(that uses Tailwind CSS), I've changed all necessary thin

Same queryset evaluation code, different field names in Django Views

I have seemingly redundant code in Django Views which evaluates the same query-set (Model.objects.all()) but with different field names: def overview_view(reque

GitHub workflows doesn't find a module

I'm trying to configure tests in the GitHub workflows for my FastAPI application. My alembic.ini -file is located in app folder. The alembic ´env.py´

Type error in this code for my ingredient multiplier

This is a picture of the error I'm getting when running the code: I can't figure out what it thinks is wrong. I assume it has something to do with the way I us

what is the Function that takes place upon reopening app

I created an app using Xamarin.Forms. I am trying to detect if there is a change in phone's language each time the app is reopened after being closed using the

Is there a way to make custom CSS properties in JavaScript?

Is there a way to create custom CSS properties in JavaScript? Example Note: this code won't work, it's just showing the sort of thing I'm looking for. I'm looki

Concatenate Task results within Job Definition?

Within Chainlink a Job definition, how would developers go about concatenating two results, like strings (Not the sum of values)? I provided an ideal approach b

Github Actions returning null values for valid test

I am developing a Flutter app using Firebase as a backend, and constructing some mock unit tests. One of my test cases passes without issue on my local machine,

Is there any way to add a pattern to the stroke of moveable line

Here is my code to add the pattern to the stroke of the moveable line. when I try to move the line, the pattern remains in the same position. It should move ins

Azure DevOps REST API, how to allow Azure Function to create workitems in DevOps project?

I'm creating a schedule-triggered Azure Function which will run tests once a day. If during the run any test fails, I want it to create a bug on a Azure DevOps

How to borrow ctx in a module chain

I have this entrypoint where ctx is passed by a parent: pub mod instructions; #[program] pub mod solana_anchor_coinflip { use super::*; pub fn flip(ct

Can I create a Django Rest Framework API with Geojson format without having a model

I have a Django app that requests data from an external API and my goal is to convert that data which is returned as list/dictionary format into a new REST API

How do I set up an SQL table to save week days and time in each event record

I'm looking for the efficient way to store week days and times of each event. How do I achieve the following result Events table id name dates rel_id 1 hello w

How to store thousands of coordinated in one column of mysql

I am creating one table which has one column which supposed to store more than 5-10k coordinates at a time. I have declared it as longtext but while storing it

Polymorphism with instance variables [duplicate]

Here are three classes that I wrote: public class Shape { public int x = 0; public void getArea() { System.out.println("I d

Cypress: Code in page object file is being executed as a test case before the before hook

I was trying to use a condition as a function within a page object. class Folders { DropdownCheckFunction(){ cy.get('.more-less-container').then

Make cause gcc to throw "No such file or directory" even though gcc in command line works fine [closed]

I want to use make to compile my c programs, but make seems to throw an error when simply using gcc doesn't. What I tried: ┌─γ

Getting the out of range index error when trying to make a Page Tab View from API array

This is my Model: class Api { func getRockets(completion: @escaping ([Rocket]) -> ()) { guard let url = URL(string: "https://api.spacexdata.com/v

How to make a date dynamic in Dynamics based on the day of the week

I want to have a date that takes another date and subtracts 2 days from it, but if that "subtracted 2 days" date lands on a weekend, it gets moved to a weekday.

Lazy load images in a modal with a slider

I have a website that I am trying to optimize and one of the things that keeps coming back is I need to lazy load my larger images that I have inside a modal, t

How do i get my sticky navbar to work using tailwind css?

I am working on a website using tailwindcss. But for some reason the navbar wont work when using the "sticky" class. I tried using the "fixed" class instead, bu

Get generated keys from single insert statement with multiple values

i'm inserting multiple rows into a table using a single insert statement. The table has an auto increment field as the primary key. Like so: INSERT INTO MyTabl

Limit incorrect guess attempts in Hangman Javascript

I'm trying to code a hangman game where a user only has three incorrect guess attempts. i.e. if they guess the correct letter they continue playing. If they gue

How to use one Route for a controller to hit all actions in Laravel 8

I switched to Laravel 8 from CakePhp and I would like to know if it's possible to use only one route for all the actions in a controller. I found "Implicit Cont

Is there are way for CronTriggerImpl to get how many times it have been triggered

we can use SimpleTrigger getTimesTriggered to know how many times this schedule have been triggered, for CronTriggerImpl, is there a similar way to achieve this

How do I check if a tree object is really close to another in unity?

I have been making a survival game in unity and I have generated the trees with the below function The GenerateTree function void GenerateTree(int x, int y)

PHP - Resort Array with a Key array [duplicate]

Good day, So I have the following array to start with that has items added to it. The order the items are added in the list have no specific s

RN notifee onBackgroundEvent dosen't called when an action get pressed

I'm using @notifee/react-native & Firebase messaging service to display an incoming call notification on Android that has two actions (accept-call and rejec

Google Sheets deleteRow not working in my Macro

I'm trying to build a Macro to erase all the rows that have empty values on column D. Originally, I was using this code that I found: function deleteRows() {