Category "arrays"

Filtering array with Boolean giving unexpected results

I can't understand why the output is 17 its only returning the true values not the false values either that the false value are boolean also function countSheep

How can I use optional chaining with arrays and functions?

I'm trying to use optional chaining with an array instead of an object but not sure how to do that: Here's what I'm trying to do myArray.filter(x => x.testKe

How to loop and display array of objects and their nested arrays

I need help, I got stuck on objects with multiple nested arrays. I have a json file which consists of object, that holds array of objects, and these objects hav

Reverse each word with uppercase without changing word

How do I reverse each uppercase and lowercase ("I am A Great human") to ("I ma A Taerg namuh")? This is the code I Have: function wordsReverse(str) { let wo

Create new numpy array by duplicating each item in an array

I would like to create a new numpy array by repeating each item in another array by a given number of times (n). I am currently doing this with a for loop and .

Creating a limited count array of custom type

I am creating array of Promises of type [MSGraphScheduleInformation?]. I want to limit the array count to 4, but the repeating param in the API is throwing erro

Declare an array in TypeScript

I'm having trouble either declaring or using a boolean array in Typescript, not sure which is wrong. I get an undefined error. Am I supposed to use JavaScript s

How do you use a JSON array in a "WHERE IN" clause in MariaDB

I am using MariaDB version 10.2 I have an array of GUIDs stored as JSON in a table and I want to select rows from another table where the ID matches any of the

Setting a pointer to a specific array and/or struct element

Here is the scenario: I have an array, AllElements of structure ElementSet, and inside of that structure - is a set of myElement structures and also an array of

How to query an array of FLOAT?

I have a table with a column with type double precision[] created like this: from sqlalchemy import Column, String, ARRAY mytablename= 'mytable' class creat

Program in assembly x86 [closed]

I recently made a program with C++ and ASM. Can anyone help me make this code a more efficient one , in the ASM part or both. I would really a

Initializing a class with numpy array question

So I have defined the following function to be entered into a class: MatrixConverter(arr) Which works exactly how I want it to, taking in a numpy array as argu

How to average columns of data from multiple, flat arrays?

Let's say I have 4 arrays with the same amount of values in each: $array1 = array(0, 7, 5, 0); $array2 = array(2, 6, 10, 0); $array3 = array(4, 8, 15, 10); $arr

Sort flat array by multiple rules

I would like some help regarding my sort function for an array as it is not working as I expected. This function is to sort array of [0,1,2,3,4,...23] into arra

I tried to solve Best Sum problem in Python but I am not able to figure out the issue, please suggest what is wrong

The function should return an array containing the shortest combination of numbers that add up to exactly the target sum. If there are two (or more) possibiliti

How to set value by call variable name from string c#

Now I'm new for c# development. I have 100 data from Array and also have 100 variables. How can I match 100 data with 100 variables? for example for(int cou

javascript to return values on decrement

My code is following var points = 4; var yModifier = []; for (var i = 0; i <= points; i++) { yModifier.push([]); }; yModifier.forEach( (a, j) =&g

Query formula not working with error AVG_SUM_ONLY_NUMERIC

I am getting this error on my query. Unable to parse query string for Function QUERY parameter 2: AVG_SUM_ONLY_NUMERIC I don't understand whats the problem is

How to save and load multiple arrays in android Java?

I'm very new to Android Dev, within this month, and I'm attempting to create a simple app to store 'medication' that a user needs to take each day. Currently, I

BigQuery standard SQL: how to group by an ARRAY field

My table has two columns, id and a. Column id contains a number, column a contains an array of strings. I want to count the number of unique id for a given arra