Category "arrays"

Debugging ajax flow

I am really confused on a program that I made. A few days ago, it was working just fine, but now I am having problems with initializing it. I think I've figured

Pascal 'Split' Function

I am coding a little program in pascal and I have run into a small problem. In other languages there is a function named 'split' or 'explode' to take a long str

Find the longest word/string in an array

I just started learning JavaScript. I am trying to write a JavaScript to find and print the longest word in an Array. I came up with the code below: var longWo

Insertion sort error occurring in a C program

I am probably missing something simple here, but I was looking over some simple algorithms in C and have not been able to get the insertion sort in the code bel

How to fuse array in Lua

how can I fuse two array into one to be like: local array1 = {2272, 2271, 2270, 2269} local array2 = {2267, 2266, 2268, 2265, 2264, 2263, 2262, 2261} local fus

Checking already visited states in A* solution for 8-puzzle problem

I am working on a solution to the 8-puzzle problem using the A* algorithm for an university assignment, and currently working on a method to identify already vi

Why is memory adress getting printed instead the values of array in c+.+

When I'm trying to print the values of an array, its memory location is getting printed instead of values. What am I doing wrong? int main() { int list[3];

Inserting Country Selection into MySQL PHP [duplicate]

I'm currently developing a site that provides specific news events to users. The purpose of the site is to allow users to select which countri

Create dictionary from an array of objects using property of object as key for the dictionary?

With Swift is it possible to create a dictionary of [String:[Object]] from an array of objects [Object] using a property of those objects as the String key for

does array.filter() creates a new array?

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter as per document says The filter() method creates a new array with

Loop ID through cells in Google Apps Script

Good Day! I would like the Purchase Order ID repeated upon submission of a form in an earlier sheet. My current code however repeats this throughout the length

Using Associative arrays

I'm trying to access a position of a associative array which is inside of another array. Here is my array: Array ( [order_data] => stdClass Object

How to change element in array?

Array is 2 dimensional 10x10 gameBoard Code I made for array: int gameBoardLength = gameBoard.length; System.out.print(" "); //two spaces to align t

Create empty array using reflection [duplicate]

How do I create empty array of a type given by reflection? I have tried using the Activator.CreateInstance(Type) method: Type arrayType = typ

How to flatten tree structure into array of arrays

Given a structure like this: var node = { children: [] } That is to say: It only has children property. No parent property. No nextSibling property. How to

Map and filter an array at the same time

I have an array of objects that I want to iterate over to produce a new filtered array. But also, I need to filter out some of the objects from the new array de

transfer a 2d array from python to c++ and back

I am using python to call methods in a shared C++ library. I am having an issue converting a numpy 2D array to a C++ 2D array. I need to enable the following fu

PHP-Sort array based on another array?

OK, I already got this question in stackoverflow but sadly it's in javascript - Javascript - sort array based on another array and I want it in PHP $data = ar

YAML equivalent of array of objects in JSON

I have a JSON array of objects that I'm trying to convert to YAML. {"AAPL": [ { "shares": -75.088, "date": "11/27/2015" }, { "shares": 75.08

React render array of components

Quick question. Anyone know how to render an array of components? Trying to make it easier for a developer to alter a particular component. (It's like a dashboa