» Home » Array » Page 1
how to write function Max($array) which returns the maximum value contained in $array or some array nested within $array
by Denmark in Programming Languages


$array= array(array(141,151,161),2,3,array(101,202,array(303,606)));

output :606

How do I marshal nested lists as JSON using Jersey? I get an array of nulls or an array of one-element dictionaries containing an array
by tedrodai in Programming Languages

I'm working on a project which uses Jersey to convert objects to JSON. I'd like to be able to write out nested lists, like so:

{"data":[["one", "two", "three"], ["a", "b", "c"]]}

The object I'd like to convert first represented data as a <LinkedList<LinkedList<String>>>, and I figured Jersey would just do the right thing. The above was outpu

Java version of c# Array.Copy(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length)
by Pakistan in C & C++ & C#

I'm trying to convert some C# code to Java and I came across a line that calls this method:


The signature of the C# method looks like this:

Array sourceArray,
int sourceIndex,

I need a single line array. I am using nested loops to push elements into the array. The array contains multipe lines
by Walruz in Programming Languages

I am using perl to produce an array of elements arranged as a single, tab-delimited line. However, only a portion of my array is like this. Other parts get printed as separate lines.

Below is the relevant portion of the code.

It is a foreach loop that has three conditional for loops embedded in it. The push command is used four times at four dif

Adding element to new array using assign by addition, but original array value dynamically changes the new array elements too
by Seattle in Network & Servers

First post, I've been researching this all day and I'm at my wits end! I have an array called $Global:CBCGroups that I want to contain the value of an ever-changing variable called $Global:CBCTempHolder. Whenever $Global:CBCTempHolder is changed, I want it to add it's contents to the array $Global:CBCGroups using += (ie:

$Global:CBCGroups += $Global:CBCTempHolder

How to marshal float array from c# to c, and then edit array in c while having c# be able to reference the updated array instantly
by DevTim in C & C++ & C#

I am not sure if this is possible, I don't know a whole lot about marshaling in c#, so please fill me in on my understanding of this if I am way off, or if this is possible at all.

But basically I have an array of floats in C#, in a C# based app. Every time this program cycles I need to do some very processor intensive heavy lifting on this array of floats. So I wanted to write this

How to convert an object array into a custom type array (involving Array List)
by björnen in Programming Languages

What I am trying to do is to find the intersection of two sets using a custom type IntSet. The code is compiling fine, however when I run it, it throws an ArrayStoreException. From what I gather, the problem is trying to convert the object array into IntSet. Here is the code:

public IntSet[] intersection(Integer[] s1, Integer[] s2) {
Arrays.sort(s1);//sort arrays

PHP - Search one associative array with an array of values, then create a new array with matching results
by Icyflash in Programming Languages

I have one associative array as follows:

"name":"24/7 Card",
"owner_name":"Me as well"

I want to search using the name field in this

Comparing array of keys of associative array to integer indexed array
by frogger9 in Programming Languages

I have written the following code to check whether an array is associative or not

function is_associative( $arr ) {
$arr = array_keys( $arr );
return $arr != array_keys( $arr );

It returns true for arrays like:

array("a" => 5,"b" => 9);

and false for numeric arrays

But it doesn't r

Array is returning “Array” instead of the actual values of the array
by Caleb Ames in Programming Languages

I have an array of values that I am trying to output to a string using the following code:

$arrayINS = explode(", ", $arraystring);
foreach ($arrayINS as &$array1INS) {
$array1INS = "(" . $arrayINS . ", 'Some Text Here')";
$arrayvaluesINS = implode(', ', $arrayINS);

Now, let's say that the $arraystring = 25145, 25064, 24812

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .