arrays

movieClip in Array displays null, and aren't showing up on stage.addChild(Array[i])

i am new to Actionscript3, i need to know why i keep getting Parameter child must be non-null. And my code won't display 5 enemyBlock objects onto the stage but only just one. any tips and help will be much appreciated. thanks in advance. returns: TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayO...

Copying contents from one NSMutableArray to another

I have two NSMutableArrays: NSMutableArray* currentMessages NSMutableArray* items I am trying to copy the contents of items into currentMessages as such: [self.currentMessages addObjectsFromArray:self.items]; When I am debugging self.items contains 30 objects. After this operation self.currentMessages contains 0 objects. Why is th...

How can I free all allocated memory at once?

Here is what I am working with: char* qdat[][NUMTBLCOLS]; char** tdat[]; char* ptr_web_data; // Loop thru each table row of the query result set for(row_index = 0; row_index < number_rows; row_index++) { // Loop thru each column of the query result set and extract the data for(col_index = 0; col_index < numb...

An array of structures in C...

For the life of me I can't figure out the proper syntax for creating an array of structures in C. I tried this: struct foo { int x; int y; } foo[][] = { { { 1, 2 }, { 4, 5 }, { -1, -1 } }, { { 55, 44 } { 100, 200 }, } }; So for example foo[1][0].x == 100, foo[0][1].y ==...

dynamically created arrays

My task consists of two parts. First I have to create globbal char array of 100 elements, and insert some text to it using cin. Afterwards calculate amount of chars, and create dedicated array with the length of the inputted text. I was thinking about following solution : char[100]inputData; int main() { cin >> inputData >> endl;...

Java: How to store Vector<String[]> in XML (or save in any other way)

Basically I have a proof-of-concept application that is a digital recipe book. Each Recipe is an object and each object has, among other fields, a Vector containing arrays. The Vector is the list of all ingredients in the Recipe while each ingredient has an array showing the name of the ingredient, the amount, and the unit for that amo...

Flex Datagrid and nested array

I have a JSON decoded array of Projects which contain a nested array of Milestones. I'm trying to display the Milestones one at a time inside a Datagrid. However, it seem Datagrid can't handle more than 1 level of data. Following is a simple diagram of what I'm trying to do. [Project Name [0]] [Milestone[0]] [Project Name [1]] [Mile...

How to create a dynamic array of an Abstract class?

Lets say I have an abstract class Cat that has a few concrete subclasses Wildcat, Housecat, etc. I want my array to be able to store pointers to a type of cat without knowing which kind it really is. When I try to dynamically allocate an array of Cat, it doesn't seem to be working. Please help? Cat* catArray = new Cat[200]; ...

passing an array structure as an array

I'm having trouble passing a structure array as a parameter of a function struct Estructure{ int a; int b; }; and a funtion Begining(Estructure &s1[]) { //modifi the estructure s1 }; and the main would be something like this int main() { Estructure m[200]; Begining(m); }; is this valid? ...

after shuffle a list get array with jquery

i want after i shuffle a list of images to get all the alt="" value in one array! but i get always the save value!why? $('ul').shuffle(); //this will shuffle the list var a = {}; $("ul img").each(function() { a[this.alt] = $(this).attr("alt"); }); $.operation(a, shuffle); ...

PHP , How can I get values out of a complex array ?

I am calling a soap function that returns the following array: Array ( [FastAddressResult] => Array ( [IsError] => false [ErrorNumber] => 0 [ErrorMessage] => [Results] => Array ( [Address] => Array ( [Id] => 13872147.00 [OrganisationName] => [DepartmentName] => [Line1] => Methley Grove [Line2] => [Line3] => [Line4] => [Line5] => [PostT...

How to get an array to check in the in_array function? See description Below...

I am fetching the data using mysql_fetch_array like : while($row = mysql_fetch_array($select)) { $tables[] =$row; } Now i need this $tables array as one dimensional array only, so that i can use it in if(in_array($val['table_name'],$tables)) { //Some Code } to check for whether the $val['table_name'] is ...

Need to add an array into another array at a specified key value

Ok, I have an array like so, but it's not guaranteed to be laid out in this order all of the time... $array = array( 'sadness' => array( 'info' => 'some info', 'info2' => 'more info', 'value' => 'value', ), 'happiness' => array( 'info' => 'some info', 'info2' => 'more info', 'v...

php - How do I count occurences of items in an array

take this array: Array ( [#twitterwhites] => 0 [#lufc] => 0 [#FOOTBALL] => 0 [#Liverpool] => 0 [#liverpool] => 0 [#ESPN] => 0 [#LUFC] => 0 [#cafc] => 0 [#cafc] => 0 [#ocra] => 0 [#nra] => 0 [#2nd] => 0 [#secondamendment] => 0 [#SCR] => 0 [#TC500] => 0 [#cpfc] => 0 [#MOT] => 0 ) I want to return a result like this: #liverpool = 2 #c...

php - Is it possible to count the number of keys in an array?

I've googled this but found no answers, so I guess it's not possible. If there is a way, I'd love to know it. Thanks ...

Java Arrays.equals() returns false for two dimensional arrays.

Hi there, I was just curious to know - why does Arrays.equals(double[][], double[][]) return false? when in fact the arrays have the same number of elements and each element is the same? For example I performed the following test. double[][] a, b; int size =5; a=new double[size][size]; b=new double[size][size]; for( int i = 0; i < ...

How to get array identifier in javascript?

Hi, how can I get the indentifier of an associative array (not Array object) in a for loop? like so: var i = 0; for(i=0;i<=myArray;i++) { if(myArray.ident == 'title') alert('The title is ' + myArray['title']); } ...

php - how do I display items from an array with their values

I have this array: Array ( [#LFC] => 1 [#cafc] => 2 [#SkySports] => 1) How do i display it like this on a page? (preferably in value descending order as below): \#cafc (2), #LFC (1), #SkySports (1) Thanks ...

Sending an array of complex objects in the get string in C# ASP.NET MVC

Hi, I want to send an array of objects in the get request string. I know this isn't the optimal solution, but I really just want to get this up and running. If I have a class, something like this public class Data { public int a { get; set; } public int b { get; set; } } public class RequestViewData { public IList<Data> MyDa...

How can I extract an array from an executable file?

I want to do the inverse of this question. I am embedding a file into an executable as an array, and I would later like to extract the embedded file from the executable. It seems like objcopy might be useful here but I haven't figured out the proper incantation yet. (Edit: clarify question, I somehow removed the crux of it in editing ...