arrays

How to send js array via ajax?

I can only send string or numeric values,how to send an array? ...

Splitting up html code tags and content

Does anyone with more knowledge than me about regular expressions know how to split up html code so that all tags and all words are seperated ie. <p>Some content <a href="www.test.com">A link</a></p> Is seperated like this: array = { [0]=>"<p>", [1]=>"Some", [2]=>"content", [3]=>"<a href='www.test.com'>,...

Select all the components of a array without a loop

I've made a array full of JLabels and would like to add a listener to them. The listener doesn't need to know exactly which one was clicked on, just that one was. Is there a way to add the listener to the whole array instead of using a 'for()' loop ? Thanks for reading. ...

Copying arrays of structs in C

Hi there, It's been a long since I don't use C language, and this is driving me crazy. I have an array of structs, and I need to create a function which will copy one array to another (I need an exact copy), but I don't know how to define the function call. I guess I need to use pointers, but when I try it gives me an error. struct gro...

Iteration through arrays in arrays PHP

Hello How can i itarate this array array(2) { [0]=> array(1) { [0]=> array(14) { [0]=> string(17) "ratosk8@censored" [1]=> string(23) "alokkumar.censored" [2]=> string(24) "uuleticialima1@censored" [3]=> string(23) "camera.clicks@censored" [4]=> string(24) "billtha...

C# Array.BinarySearch Problem

Can anyone explain why this is happening? ie. Even when 175 is present in the array at location 7, the array.binarysearch is returning a negative value? Please see this image: ...

how many strings in a const char* str[] ?

const static char *g_szTestDataFiles[] = { ".\\TestData\\file1.txt", ".\\TestData\\file2.txt", ".\\TestData\\file3.txt", ".\\TestData\\file4.txt", ".\\TestData\\file5.txt", ".\\TestData\\file6.txt" }; Is there way to programmatically determine how many items is in that thing? I could always do #define NUM_DATA...

Java Array Sort descending?

Is there any EASY way to sort an array in descending order like how they have a sort in ascending order in the Arrays class http://www.j2ee.me/javase/6/docs/api/java/util/Arrays.html ? Or do I have to stop being lazy and do this myself :[ ...

How to pull out the values of ticked checkboxes using PHP?

while ($row= mysql_fetch_array($result, MYSQL_ASSOC)) { $id=$row[id]; $html=<<<html <tr><td> <input style="float:left" type="checkbox" name="mycheckbox" value="$id"> <span style="float:left">$row[content]</span> <span style="color:black;float:right">$row[submitter]</span></td></tr> html; echo $html; } Since the HTML code is g...

multi-dimensional array transmit issue

Hello everyone, I am using VSTS 2008 + Native C++ to develop RPC programs (both client and server). I am reading MSDN document for marshalling multi-dimensional array http://msdn.microsoft.com/en-us/library/aa374185%28VS.85%29.aspx I am confused about the following statement, and I am confused about what means offline and online, and ...

Fail to target a instance inside a MC in an Array

I can't trace whats inside holderMC, and its content. What's wrong here? instance.text="something" holderMC.addChild(instance) anArray.push(holderMC) addChild(holderMC) trace(anArray[anArray.length-1].instance.text); returned undefined. ...

C Compile-Time assert with constant array

I have a very big constant array that is initialized at compile time. typedef enum { VALUE_A, VALUE_B,...,VALUE_GGF } VALUES; const int arr[VALUE_GGF+1] = { VALUE_A, VALUE_B, ... ,VALUE_GGF}; I want to verify that the array is initialized properly, something like: if (arr[VALUE_GGF] != VALUE_GGF) { printf("Error occurred. arr[VA...

How can I concatenate two arrays in C?

How do I concatenate two arrays to get a single array containing the elements of both original arrays? ...

reversing an array of characters without creating a new array

write a program that enters an array of characters from the user and reverses the sequence without creating a new array ...

From arrayList to long[]

Hi. I am doing a method that needs to return a long[]. It looks like this: public long[] parseString(String input) input are strings like: 1, 3, 4 10, 30, 40, 50 Inside parseString I use a regex to get all numbers and add them to an ArrayList as I can't know how many oconcurrences it will find. At the end I create a long[] with ...

C: Array with elements varying in size

Is it possible to have an array of elements (structs) where the values vary in size? The issue I am faced with is that I do not know how to access an element since it requires a cast. The "array" just contains pointers to the structs. Therefore I have decided to go with void**. As not each of the elements is of the same type, the type ...

Difference between various Array copy methods

What is the difference between System.arraycopy(), clone() manual copying by iterating through the elements and just doing arraynew = arrayold? ...

How to get unselected checkbox?

Hello! I have three checkboxes like ch[0], ch[1] and ch[3] (sometimes i have more, or less, it's dinamic) and in PHP i want to get the unselected items also, like this: 0=yes,1=no,3=yes and so on. Can I solve this somehow? ...

initializer-string for array of chars is too long

I keep getting this error: initializer-string for array of chars is too long Even if I change num and length to 1, it still gets the error: #include <iostream> #include <cstring> using namespace std; int main() { const int num = 11; const int length = 25; char array[num][length] = { "Becky Warre, 555-1223" ...

Can anyone see what is wrong with my Javascript?

I have written the following: var pages=["[www.google.co.uk] This is the WWW. ","[www.yahoo.co.uk] This is also the WWW. "]; function findScoresC(s){ var scores=[]; var words=[]; var wordScore; var indexScore=[]; s=s.toLowerCase(); for(i=0;i<pages.length; i++){ var lowerCaseContents=(pages[i].substring(pages[i].indexOf("]")+1,pages[...