Category "arrays"

PostgreSQL 12.2 with Sequelize 6.3 - UPSERT a array of data and want ON CONFLIT DO UPDATE to merge current existing JSONB and EXCLUDED JSONB

I'm currently using this query to insert or update my array of data when retrieving my list : try { const query = `INSERT INTO "Tables" ("id","tomerge

How can I avoid ArrayIndexOutOfBoundsException or IndexOutOfBoundsException? [duplicate]

If your question is I am getting a java.lang.ArrayIndexOutOfBoundsException in my code and I do not understand why it is happening, what does

Problem to integrate a function with multiple array in python

I work on a Python Script and I need to integrate a very long function. The function contains several array and I don't succeed to integrate it. I need to integ

How do I add bits to a MemoryStream

So I've been trying to add bits of a value to a MemoryStream but the issue is I have no idea how. I've seen that it's used for performance when it comes to netw

Remove duplicate entries from string array column of postgres

I have a PostgreSQL table where there is column which has array of strings. The row have some unique array strings or some have duplicate strings also. I want t

I want to store data in new index as per my key in php [duplicate]

I am having a data in array format with key and value what I want is from first key 0 to key 6 data I want to store in a new array with index

Why is Merge sort better for large arrays and Quick sort for small ones?

The only reason I see for using merge sort over quick sort is if the list was already (or mostly) sorted. Merge sort requires more space as it creates an extra

Merge two arrays with child elements

I've two arrays as follows and trying to merge with id in this case, menuNo is the id and after that, it'll have a new array with child elements as output. Pare

Angular - Count all dates per month & return month & count array

Basically counting records per month, where each record has a Create Date. Need an array that contains month name + count as variables. Only managed to do it wi

Convert every two values of an associative array into key-value pairs

I need to convert an associative array into a new associative array where the original keys are ignored and every two consecutive values become new key-value pa

iterating different length arrays and replace values

I have a dataframe that looks like this: df = pd.DataFrame({'col1': [[[1,5,3],[0,0,0]], [[1,2,3],[0,0,0], [1,2,3]]]}) # which looks like this: col1 0 [[1

Raku list addition operator `Z+` 'fails' unless one of the lists is forced

I'm struggling to understand why the zip-add Z+ operator does not work on some cases. I have some 2-element lists that I'd like to sum. These work as expected w

What is the difference between Array.from(Object) and [...Object]? [duplicate]

There are these two ES6-methods of creating an array from an array-like or iterable object: Array.from(): let arr = Array.from(Object); Spre

How to store contents of string array into 2D array in python and perform operations without any built in function?

I have tried almost everything I cannot figure it out. I cannot figure out which array to use. This is the question and the required output:

JSON: Trouble editing a JSON file in Python

What I want to do is remove the array containing "Nike" under the "Shoe" variable. Here is the Json file: { "Shoes/Colorways": [ { "

How to write a python computer program that will take any valid arithmetic expression as a string and will output a list(or array of string)? [duplicate]

How to write a python computer program that will take any valid arithmetic expression as a string and will output a list (or array of string)

Scratch card game with non-repeat array

This is a scratch card game I modify using script from https://jennamolby.com/interactive-scratch-and-win-landing-page-tutorial/ . I was trying to make a scratc

How do construct id/parentIds with a recursive function

I am trying to build data for a devexpress tree grid using a id/parentId relationship. The id needs to include the complete parent path which will be the parent

How do you print an entire row of a list made of words?

I have simplified my question where I just have a 2x2 list of words. I'm trying to print an entire row but it evidently doesn't work the same as with a list of

Return the sum of the numbers in the array,except ignore sections of numbers

SUMMER OF '69: Return the sum of the numbers in the array, except ignore sections of numbers starting with a 6 and extending to the next 9 (every 6 will