Category "arrays"

How do I extract data from a string into a 2d array?

Using axios, I am fetching data from a website. Unfortunately,the data fetch is in HTML format. The data fetched is like this: 1 Agartala VEAT 120830Z 23004KT 5

Matplotlib: display element indices in imshow

From this answer I know how to plot an image showing the array values. But how to show the i,j indices of each element of the array, instead of the values thems

How print a loop inside of sweet alert window

I want to loop an array and show the result using sweet alert, I am new in this so I try the code below, but show me some like [object],[object] swal({ conte

How do fix the "Cannot find 'NSFetchRequest' in scope error

I have tried to make an NSFetchRequest in many different ways and each time I get this error: "Cannot find type 'NSFetchRequest' in scope" Here are the specific

Elegantly calculate the minimum and maximum of a number array simultaneously

In Javascript, given a simple number[] array, is there an elegant way to calculate the minimum and maximum values simultaneously, or return undefined if the arr

array indexOf with objects?

I know we can match array values with indexOf in JavaScript. If it matches it wont return -1. var test = [ 1, 2, 3 ] // Returns 2 test.indexOf(3); Is th

Python: Generating all n-length arrays combinations of values within a range

Ok. I'm looking for the smartest and more compact way to do this function def f(): [[a,b,c] for a in range(6) for b in range(6) for c in range(6)] which

Parsing JSON File to array in PHP

I am currently trying to read co-ordinates from a JSON file and save them to an array for further use. However I am not managing to read the file successfully.

How to Paste string of values in single cell of Excel using VBA

I have 2 sheets named "Target Data" and "Pivot". I have filtered data in "Target Data" and now want to copy only visible cells in single cell of "Pivot" sheet.

An integer array of up to 10 integers is read. Negative integers are not allowed to read

My program only allows positive integers up to 200 to be entered. -1 and the rest of negative numbers are not allowed to be read, and for safety, the 10th digit

What is the best practice of streaming JSON objects in Nodejs, if it is bigger than 10M and split it into multiple streams?

I have a JSON object, it is a big object. I need to send (write) it as a Kafka message and it takes a lot of time. I need a mechanism to stream the JSON object

PHP array slice from position + attempt to return fixed number of items

I'm looking for an efficient function to achieve the following. Let's say we have an array: $a = [0, 1, 2, 3, 4, 5, 6, 7]; Slicing from a position should alw

return nested array solidity

Is it possible to return an array in solidity? // SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; pragma experimental ABIEncoderV2; contract

Problems with parsing a JSON array objects into an object

first question i post here. I'm learning js and trying to do some APIs for a college project. I have the body of the API that passes a JSON object like that:

Convert numpy array from space separated to comma separated in python

This is data in .csv format file generally we expect array/ list with [1,2,3,4] comma separated values which it seems that nothing happened in this case data =

Check if dynamic array is initialized or contains value - VBA Excel

Is there a way to tell if some dynamic array, for example arr() as String is initialized? IsEmpty and IsNothing seems not to work with dynamic arrays. Currently

Array divided into days of the week

I want the array to be divided into days of the week according to the date specified in BETWEEN and AND public static function showDataByEmployer($employer) {

How to bind an empty array to the props in Vue.js3?

<script lang="ts" setup> interface Props { bigArray: string[]; } ***const props = withDefaults(defineProps<Props>(), { big

Swift 4.2) Mutate array of struct with for_in/forEach vs. access by index

I am trying to modify struct element in array. I found that you can do that by accessing(iterate) the struct by index, but you can't if you use 'for in' loop or

How to remove an element from a json with ruby?

For this json structs: { "a_path": { "b_path": [ { "id": 1, "name": "a" }, { "id": 2, "name": "b"