Category "arrays"

regexp_matches, array per row

In PostgreSQL, I have a table as follow. | id | mycolumn | | -------- | -------------- | | 1 | /1/2/8/ | | 2 | /1/40/22/11/ |

Issue with Generating Random Numbers using Laravel contains vs foreach loop [duplicate]

Hey guys I come across this strange issue where if I use the foreach it does not generate a unique random number wheres if I use laravel funct

Check if two arrays have an object with the same property

Here's my goal: compare two objects and figure out if there is 1 or more items in common. If there are 1 or more in common, return true otherwise (no items in

Python: extracting specific values out an numpy array of indices

I have a numpy array of indices. For example: indices = np.array([0, 1, 2, 6, 7, 9, 12, 13, 14]) I would like to make an array signals = np.zeros(np.amax(indi

Java Array Odd Sorting Algorythm

I got an algorithm to write that set order of an Arrey but in a specific way. Find the lowest number of an array Save it at the start of the new array. Mark in

Declaring a static array of bytes in VBA

I can declare a static byte array in VBA like this, but it appears that the elements are not of type byte. Dim A As Variant A = Array(&H9F, &H2C, &H

How can i make for loop a recursive method

How can I make this code a recursive method? for (int i = 3; i < arr.length; i++) { writer.write(arr[i] + "\n"); strout += arr[i] + "\n"; }

Finding peak in a large data set with python

I want to know if there is a way to eliminate points that are not close to the peak. For example if I have a data set with 10 million points and the peak is aro

Variation: Find the object with the highest value in Javascript [duplicate]

In Finding the max value of an attribute in an array of objects there are many (great) answers that report the highest value in an array, but

constexpr iterate over section in memory

I am trying to turn a function, createArray, into a constexpr function. This function creates an array from a contiguous section in memory marked by two arbitra

Programs which accept uppercase and lowercase commands as input

I'm trying to add a help/information box in my program that pops whenever someone type in a /h, /?, /help commands. I want to make sure that my program accepts

Bubble sort on string array not doing anything in C with strcmp

I am trying to sort a string array in C (char**), the string array is an array of all the names of files in a directory. Here are all the parts of the code, I e

What does the Array method `reduce` do?

I found a very useful function reduce, and I'm using it, but I'm not sure if I understand it properly. Can anyone help me to understand this function? Example:

Randomise each element of String from inside? [duplicate]

I am trying to change the place of characters in a string. The first and last have to stay like they are. For example: String str = "String te

Pushing value to array that is the value of an object

I have the following structure: let mappings = { "1002": ["1000", "1003"], "2000": ["2001", "2002"] } and I want to add this piece of data const issueT

arrays and methods help needed

i've been puzzling over this for about 5 hours now, I just can't get the errors to stop. am I doing something fundamentally wrong, or misunderstanding something

How to optimise a condition which checks for each object of an array of objects whether specific properties are not undefined?

I want code optimisation for an if-statement because I otherwise have to add more key-value pairs into this condition with &&. I have an array of object

Arrays sorting Program

you are given a stream of integers represented by an array[ ] of size N. Whenever you encounter an element arr[i] , you need to increment its first occurrence (

Use an array as chart values

I need an array with chart values, I obtained one but after exiting from the function it became blank, here's what happens: Example function AddvotoTec(voto

How to delete certain number from a list in list using the index in python?

I have a list in a list, and I am trying to delete the third number of each sublist, but every time I am getting an error TypeError: list indices must be intege