Category "arrays"

AJAX/FLASK/JS: How to POST existing array into endpoint?

I am trying to POST the songFiles array pushed from the getTableData() function (inside the ajax request) into the /api/fileNames endpoint, which is then sent t

PHP array filled by a MySQL query [closed]

I need to fill multiple different arrays by using a MySQL query. This would have up to 16 different arrays. I want to specify each array with

I want to new array of 2 array is not equal data [duplicate]

I want to new array of 2 array is not equal data example let a = [{id:1, name:"a"},{id:2, name:"b"},{id:3, name:"c"}]; let b = [{id:1, name:"

Inconvenience when working `as const` arrays - readonly T[] not assignable to T[] - how to remove readonly modifier from array [duplicate]

I keep running into this problem all the time (playground link): const arr = [1,2,3] as const const doSomethingWithNumbers = <T extends nu

A dynamic array that changes size on one click function and being used on in another click function

I'm programming something for a school task and having a problem. I need to create an array, then I need to change its size on one-click function(the size of th

Merge multiple outputs from multiple functions into one array in Javascript?

Example I have these values, there is any way to put them together in a single array? This is one of the functions that make the results, they take their data f

Is there any Fortran function to transpose 3D array?

I need to transpose a 3D matrix in Fortran. I have a 3d array: V(111,222,333); I need to transpose it to V(333,111,222). Is there any function to do that in For

Delete all files without deleting folders

I have a folder named (top) with 10 folders named 1,2,3,4,5,6,7,8,9, and 10. Inside the top folder I have files, too (are not folders). I can list all the files

Initializing an hyperarray parameter agent attribute from a database

I am similar problem to this Initializing an array agent attribute from a database but Im having a problem as it brings back the whole row of data and not only

How can I get N smallest number in an array?

I'm trying to get the N smallest numbers (given by the user) in an array without using methods like sort()... in the last step, I keep getting only the smallest

Is there any reason to keep array length -1 in iterations of a loop using arrays?

private static void SortArray(List<int> nums) { int buffer = 0; for(int i = 0; i < nums.Count - 1; i++) {

Using SELECT DISTINCT to retrieve nearly identical array values in PGSQL

In an app that I am currently developing users are allowed to locations identified, amongst other things by their latitude/longitude coordinates. The location e

How to convert array into JavaScript object

I have an array like this (which is similar to a JSON array) of length n: const mainData = [ { phrase: "Phrase 1", categorynumber: 1, optionnumber

PHP extracting from hard array [duplicate]

How can I extract all elements from this array through PHP? I tried to do with array_slice but it didn't help My main problem is that I need t

Angular 12 FormGroup dynamically Array checkboxes custom validator does not work

I am creating an Angular 12 app, with Material. I have a form with an checkbox array loaded dynamically from database. I need to validate that at least one chec

How can I sum and average my array in Java

I want to sum and average my array in Java. How can I do that? public class EjerciciosArrays extends javax.swing.JFrame { ArrayList<Double> mi_ar

NRRD File of brain tumor is not being read into python with pynrrd module

I have nrrd files of the brain tumor. When reading the file into an array with a header and passing the code print(filename), I get an array of zeros. I checked

How to convert json array to model class in flutter dart/

{ "feed": { "entry": [ { "im:name": { "label": "The Rise" }, "im:ima

How to use a value from $_POST as the parameter of an in_array function?

I have built an HTML form to search through a .csv and return all entries that match the specific input string. My aim is to be able to search through a .csv an

Re-slicing slices in Golang

I recently picked up the Go language, and now I am confused with the following code: package main import "fmt" func main() { a := make([]int, 5) prin