Category "arrays"

How to read from a .txt file into an array of objects

I have the following sample data in a .txt file 111, Sybil, 21 112, Edith, 22 113, Mathew, 30 114, Mary, 25 the required output is [{"number":"111","name":"Syb

java.lang.ArrayStoreException when extending a list with new elements

I am calling methods with parameters like this: methodName(Object... param). These methods I can't change. To keep my code a bit more dynamic, I have lists whic

Iterate Object and replace values

I have this Object: { "data": { "success": true, "historical": true, "date": "2022-01-01", "base": "MXN", "rates": { "COFFEE": 0.021

How do I filter or re/assemble and collect data-items where each of an item's many color values meets a certain condition?

I have this sample data and I wanted to filter it where the colors are less than 20 or equal to 20: const data = [ { name: "Item1", colors: { green: 8 } },

How to read from a file and parse it

I have a file .txt containing some values formatted like this: 0,30,25,10 Now, I open up the file and store it into an array char imposta_tratt[300]; FILE *f

How to fix and understand this Segmentation Fault (core dump) error? I cannot comprehend it whatsoever

I am tasked with creating a C code that does what page-replacement algorithms do. The code is barely 200 lines, so I will try to send some portions and hopefull

I want to combine the objects in the array, how should I change them?

const data = [ { productId: 6, productName: "pouch", productPrice: 29000, discountRate: 19, optionName: "13inch", optionPrice: 0,

Java - How to replace entire 2D ArrayList with another that has different size

I have 2D ArrayList consisting of Objects, i pass it to a function in another class, like this: public void function(ArrayList<ArrayList<Object>>)..

How to access a specific value in array

I want to access each element of my "to" value of the children property in my array. const items = [{ name: 'Administrateur', children: [ { name:

How to access nested array

I am trying to access recipeIngredient in this array. I have tried this: <cfloop from="1" to="#ArrayLen(contents)#" index="i"> <cfoutput> #i.recip

ARRAYFORMULA(VLOOKUP(QUERY(IMPORTRANGEs))) instead of ARRAYFORMULA(QUERY(IMPORTRANGEs)) doesn't work

I am importing data from 4 sources, their format is: | C | D | E | F | G | H | | 31.03.2022 | * | -60 000 | * | * | Prep

Creating and Emailing Totals Doc from Google Form Responses

I am trying to create a function that takes form response data and applies it to a template to create a 'completion certificate' with their total scores, then e

C++ and Java array declaration/definition : differences

my question is really simple (which doesn't imply that the answer will be as simple.. :D ) why do arrays in C++ include the size as part of the type and Java's

How can I access and process nested objects, arrays or JSON?

I have a nested data structure containing objects and arrays. How can I extract the information, i.e. access a specific or multiple values (or keys)? For examp

How can I get key values and correspond it to each other in js?

I have an array of objects as follow: [ { "card_key": "Edition", "card_value": "Elite Fight Night" }, { "card_key": "Car

Script that returns _id in MongoDB with JavaScript

I need a javascript code that saves in a variable the _id I'm having trouble getting that _id because it’s inside an array. I have looked everywhere but I

How to select elements from json column except unwanted columns in spark

I have various columns in Spark DataFrame, they are nested json columns. In configuration i will provide a list of columns and fields to remove from json. For e

How to get correct date format from JSON string in Python?

I am trying to get some data from a JSON url using Python and convert in Pandas PD. Everything is working OK. Only there is a column for date. It is coming weir

bilinear interpolation with DSP CMSIS library - passing 2D array

I am struggling to obtain the correct results for the function with CMSIS DSP bilinear_interp. I've first tried a simple linear interpolation: float test_tabl

Test multidimensional array with Laravel and Pest

I have a little problem when I want to test an array in my unit test. I want to test both structure and type of keys, but I don't know how to process it (I trie