tagged [arrays]

Loop a multidimensional array and only print two specific column values per row

Loop a multidimensional array and only print two specific column values per row How can I print the filepath and filename values from each row? ``` Array ( [0] => Array ( [fid] => 14 [li...

Checking if ANY of an array's elements are in another array

Checking if ANY of an array's elements are in another array I have two arrays in PHP as follows: How do I check if of the elements are in the

10 Jan at 21:28

size of NumPy array

size of NumPy array Is there an equivalent to the MATLAB `size()` command in Numpy? In MATLAB, In Python,

10 Jan at 20:26

Getting the "diff" between two arrays in C#?

Getting the "diff" between two arrays in C#? Let's say I have these two arrays: I would like to get the differences between the two. I know I could write this in just a few lines of code, but I want t...

29 Dec at 03:32

Does a primitive array length reflect the allocated size or the number of assigned elements?

Does a primitive array length reflect the allocated size or the number of assigned elements? I declared an array as shown below: Then I assigned following values to the array: Then I declared and init...

27 Dec at 23:11

Save byte[] into a SQL Server database from C#

Save byte[] into a SQL Server database from C# How can I save a byte[] array into a SQL Server database? This byte[] contains a HashAlgorithm value. The data is needed again for later use. So converti...

27 Dec at 01:52

Remove duplicate values from JS array

Remove duplicate values from JS array I have a very simple JavaScript array that may or may not contain duplicates. I need to remove the duplicates and put the unique values in a new array. I could po...

convert ArrayList<MyCustomClass> to JSONArray

convert ArrayList to JSONArray I have an ArrayList that I use within an ArrayAdapter for a ListView. I need to take the items in the list and convert them to a JSONArray to send to an API. I've search...

24 Dec at 01:20

how to add values to an array of objects dynamically in javascript?

how to add values to an array of objects dynamically in javascript? This is an array of objects, How can I add values to these dynamically? iItried the below code but no success: ``` var lab =["1","2"...

21 Dec at 22:49

Query an object array using linq

Query an object array using linq I would like to know how can I query an array of objects. For example I have an array object like CarList. So CarList[0] would return me the object Car. Car has proper...

21 Dec at 21:34

invalid types 'int[int]' for array subscript

invalid types 'int[int]' for array subscript This following code gets this compile error: "`invalid types 'int[int]' for array subscript`". What should be changed? ``` #include using namespace std; in...

21 Dec at 20:50

How to get an Array with jQuery, multiple <input> with the same name

How to get an Array with jQuery, multiple with the same name I have a form where users can add input fields with jQuery. After submitting the form I get an array in PHP. I want to handle this with the...

21 Dec at 20:47

Check if an element is present in an array

Check if an element is present in an array The function I am using now to check this is the following: ``` function inArray(needle,haystack) { var count=haystack.length; for(var i=0;i

21 Dec at 09:47

C char array initialization: what happens if there are less characters in the string literal than the array size?

C char array initialization: what happens if there are less characters in the string literal than the array size? I'm not sure what will be in the char array after initialization in the following ways...

20 Dec at 12:7

Reference - What does this error mean in PHP?

Reference - What does this error mean in PHP? ### What is this? This is a number of answers about warnings, errors, and notices you might encounter while programming PHP and have no clue how to fix th...

Put result of String.Split() into ArrayList or Stack

Put result of String.Split() into ArrayList or Stack I am using the `String.Split()` method in C#. How can I put the resulting `string[]` into an `ArrayList` or `Stack`?

18 Nov at 22:30

How to find the size of an array (from a pointer pointing to the first element array)?

How to find the size of an array (from a pointer pointing to the first element array)? First off, here is some code: Is there a way to find out the size of the array that `ptr` is pointing to (instead...

16 Nov at 10:20

JS map return object

JS map return object I got this array, What do I need to do in order to return an array mapped, that adds 10 to each > launches value, here

15 Nov at 16:40

C# - How to create an array from an enumerator

C# - How to create an array from an enumerator In C#, what's the most elegant way to create an array of objects, from an enumerator of objects? e.g. in this case I have an enumerator that can return b...

8 Nov at 20:8

Returning an array using C

Returning an array using C I am relatively new to C and I need some help with methods dealing with arrays. Coming from Java programming, I am used to being able to say `int [] method()` in order to re...

3 Nov at 19:35

JavaScript Array to Set

JavaScript Array to Set MDN references JavaScript's [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) collection abstraction. I've got an array of objects tha...

25 Oct at 14:46

How to check if an array is empty or exists?

How to check if an array is empty or exists? When the page is loading for the first time, I need to check if there is an image in `image_array` and load the last image. Otherwise, I disable the previe...

20 Oct at 12:42

TypeError: Cannot read property "0" from undefined

TypeError: Cannot read property "0" from undefined I'm getting a very weird undefined error: ``` function login(name,pass) { var blob = Utilities.newBlob(pass); var passwordencode = Utilities.base64...

How do I concatenate two arrays in C#?

How do I concatenate two arrays in C#? --- Right now I use Is there an easier or more efficient method? --- Be careful with the `Concat` method. The post [Array Concatenation in C#](

14 Oct at 21:42

Print array without brackets and commas

Print array without brackets and commas I'm porting a Hangman game to Android and have met a few problems. The original Java program used the console, so now I have to somehow beautify the output so t...

12 Oct at 21:13