Category "arrays"

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"

Push unique objects into array in JAVASCRIPT

I want to push object that only have unique id1 into array. Example: let array = [], obj = {}, access = true if(access){ obj['id1'] = 1 obj['id

How to define Typescript Map of key value pair. where key is a number and value is an array of objects

In my angular2 app i want to create a map which takes a number as key and returns an array of objects. I am currently implementing in following way but no luck.