arrays

PHP5 SOAP XML into Array

I currently have a return from a SOAP call. <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"&gt; <soapenv:Body> <ns:getMakeResponse xmlns:ns="http://ws.fds.com"&gt; <ns:return> <ResponseCode>000</ResponseCode> <ResponseDescription>No Errors</ResponseDescription> <MakeRetur...

interview questions - little help

i ran into thos quesiton in a google search.... they look pretty common, but i couldn't find a decent answer. any tips/links ? 1.Remove duplicates in array in O(n) without extra array 2.Write a program whose printed output is an exact copy of the source. Needless to say, merely echoing the actual source file is not allowed. ...

How to Pass byte array as parameter in url in iPhone?

I am using following code to get bytes array. thx to this post. Data *data = [NSData dataWithContentsOfFile:filePath]; NSUInteger len = [data length]; Byte *byteData = (Byte*)malloc(len); memcpy(byteData, [data bytes], len); it is the right method to do so? Now, How i can pass bytes array into url? Thank You for Help, ...

Caching strategy for merged MO files, which become arrays?

To clarify: I'm not using the gettext php module/extension, reason being because I have to deal with servers that don't have gettext included, I'm aware of php-gettext but that just complicates things in that I have to use multiple libraries. Further more I don't want to depend on the user having the necessary locales installed, and so...

how to store an array in jquery cookie?

Hi, I need to store an array in a jQuery cookie, any one help me please? ...

Unique values in an array

I have an array of numbers that I need to make sure are unique. I found the code snippet below on the internet and it works great until the array has a zero in it. I found this other script here on SO that looks almost exactly like it, but it doesn't fail. So for the sake of helping me learn, can someone help me determine where the prot...

length of array in c++

I read to get the length of array in C++, you do this: int arr[17]; int arrSize = sizeof(arr) / sizeof(int); I tried to do the same for a string: where I have string * arr; arr = new (nothrow) string [213561]; And then I do arr[k] = "stuff"; where I loop through each index and put "stuff" in it. Now I want the size of the array...

How to add a new value to the end of an numerical array?

In PHP I can do like: $arrayname[] = 'value'; Then the value will be put in the last numerical key eg. 4 if the 3 keys already exists. In JavaScript I can’t do the same with: arrayname[] = 'value'; How do you do it in JavaScript? ...

javascript: check if array exist, if not create it

how do i check if a specific array exists, and if not it will be created? ...

PHP explode is removing the first array value

Ok, first off, I applogize if this question has been asked before, I've spent the last 12 hours sifting through hundreds of forum threads and haven't found one that answers this question exactly yet so here goes. I have a page that I built that has a userlist that is autopopulated as users log in, and each users has a checkbox that allo...

Joining Arrays in PHP

This is really simple but I need a quick way to do this. I have three arrays like $a = array('a','b','c'); $p = array('p','q','r'); $x = array('x','y','z'); How do I combine them to make array ( [0] => array ('a','p','x'); [1] => array ('b','q','y'); [2] => array ('c','r','z'); ); ...

Sorting an array related to another array

If I have two arrays, x and y where y is the value of the tens of every element in x. Now, I want to sort y. But, the order of y will be different of x's. So, I can't tell after sorting which element in y was related to, for instance, x[0]. I want a "double sorting" may be. Your help is infinitely appreciated! ...

php syntax, arrays and errors

Why does the following code give me an error in php?: $b = array("1" => "2")["1"]; Error I get is Parse error... Help. ...

length and length() in java.

Why do we have length of an array as an attribute. array.length and for String we have a method str.length()? Just came in my mind, is there some reason? ...

how to make a python array of particular objects

in java, the following code defines an array of the predefined class (myCls): myCls arr[] = new myCls how can I do that in python? I want to have an array of type (myCls)? thanks in advance ...

Weird VB.NET array-property situation

I have this weird situation. I have these two classes: Public Class Entry End Class Public Class Core End Class One of the properties of the Core class will be an array of Entry objects. How can I declare it? Now, the only way to change (add/remove) this array from outside should be using two functions - AddEntry(Ent As Entry) an...

C# How to add string elements in array to string

Hello to all. Need assistance to do this. Or advice about how to add string to string elements in array? We have 2 txt files with 100 or more strings in each: domain.txt domain1 domain2 .. title.txt title1 tilte2 .. and we have: string link = < a h ref="http://www.domain.com" target="_blank">title< /a> After reading files we would...

Javascript: Assign dynamically produced values to new array

I'm looping through 3 arrays, finding 'actionTimings' in each array and adding up the actionTimings values (values are all numbers). How would I assign the 3 values I obtain to a new array? Here's what I have so far... $.each(dinnerComponents, function(intIndex, component) { totalCookTime = 0; for ( var i = 0; i < component.actionTimi...

Object (string or array) NAME. how to get it?

I need a prototype done in this way: Array.prototype.getname=function(){ [...]return arrayname; } So I can: z=new Array; alert(z.name); and I should have "z" in the alert. I'm working on Chrome and caller/callee seem to return empty. ...

access php array children through parameters?

I have a unique case where I have an array like so: $a = array('a' => array('b' => array('c' => 'woohoo!'))); I want to access values of the array in a manner like this: some_function($a, array('a')) which would return the array for position a some_function($a, array('a', 'b', 'c')) which would return the word 'woohoo' So basicall...