arrays

AS3 removing MovieClips in an array

Anybody any ideas on how to remove children from stage using AS3 if I store the reference to the objects in an array and they exist in different locations i.e they are not all children of the same parent? SomeArray.push(this); ...

converting 'int' to 'long' or accessing too long array with 'long'

hi, let say i have an array that is long enough to access any of its index with int, is there any way to access the index of such an array with long? and how the java handles this kind of array? e.g. int[] a = new int[]{1,5,2,4........9,2,1} assume in above array that 9,2,1 are at indices that are beyond the range of int (2^32). how ...

How to search same pattern in a string and then take them to array in Java?

For example, The string is: "{{aaa,bbb},{ccc,ddd},{eee,fff}}" I want the program auto split it as a string pattern Pattern is: {{...},{...},{...}} What is the Pattern Matching regex? ...

How to load array of object into extjs gridpanel

Hi, I am new to ExtJS. In examples, I do not find any one similar to my situation: I have an Array of Object like bellow: arr = new Array(); obj = new Object(); obj.StringField = "Field1"; obj.IntField = 1; arr.push(obj); obj = new Object(); obj.StringField = "Field2"; obj.I...

writing JSON with JSP

You would probably do this automatically with some library. But I am new with Java and JSON and I need a quick sollution. What I would like is to write down (echo) JSON out of a JSP file. So far so good, but now I have a list of objects. So I start a fast enumeration. And now the question: how do I close the JSON array with }] instead...

Rearranging array elements

Not sure if it is a duplicate. Given a data structure having first N integers and next N chars. A = i1 i2 i3 ... iN c1 c2 c3 ... cN. I need an in-place algorithm to rearrange the elements as A = i1 c1 i2 c2 ... iN cN. ...

ColdFusion Arrays and Variables

Hey guys, I really am stuck here. I keep getting an error on this code and I have absolutely no idea why. Basically what I am trying to do is check a form for a field called quantity_# with # being a number. If it finds it I want to go through all those fields and add them onto a 2 dimension array so I can store the actual value of that ...

C#: Maximum length of byte[]?

I'm trying to create an array of bytes whose length is UInt32.MaxValue. This array is essentially a small(ish) in-memory database: byte[] countryCodes = new byte[UInt32.MaxValue]; On my machine, however, at run-time, I get a System.OverflowException with "Arithmetic operation resulted in an overflow". What's the deal? Do I need to us...

ANSI C: Passing array by value generates wierd error I can not solve.

When I declare this function: void vLFSR_ParseInput(unsigned char * pucDataArray,unsigned char unCount){} and try to pass it this array unsigned char g_ucUSCI_A0_RXBufferIndex = 0x00; unsigned char g_ucaUSCI_A0_RXBuffer[RXBUFFERSIZE]; with this function call vLFSR_ParseInput(&g_ucaUSCI_A0_RXBuffer,g_ucUSCI_A0_RXBufferIndex); ...

PHP - choose 3 different random values from an array

Hi. As title said : I have an array of 30 values and i need to extract from this array 3 different random values. How can do it? cheers ...

compare two arrays of numbers and remove duplicates in php

Hi, OK i have two groups of mobile numbers (from mysql) which i need to process, the problem is i need to remove duplicate numbers from the results. Someone told me about "array_intersect" but I am not very good at these things and I don't see any good examples on the PHP website. Any help or suggestions is appreciated thanks :) ...

creating a legend within for loop for Matlab plot

Hi, I want to plot several curves, each having a different length. So, I've placed each curve as an array in a cell index, Y (this allows me to index through arrays of different sizes inside a FOR loop). I use "hold all" below to enable each iteration of the FOR loop to plot each new array in the cell array Y inside the same plot. hold...

How do I find common elements from n arrays.

I am thinking of sorting and then doing binary search. Is that the best way? ...

how does ruby handle array range accessing?

ruby-1.8.7-p174 > [0,1][2..3] => [] ruby-1.8.7-p174 > [0,1][3..4] => nil In a 0-index setting where index 2, 3, and 4 are all in fact out of bounds of the 2-item array, why would these return different values? ...

Deep copy of an object array

I want to make a deep copy of an object array using a constructor. public class PositionList { private Position[] data = new Position[0]; public PositionList(PositionList other, boolean deepCopy) { if (deepCopy){ size=other.getSize(); data=new Position[other.data.length]; for (int i=0;i<d...

C# Deserialization Json array without []

I'm really new too Json and I'm trying to call a Web Service. When the service return an array of one element de json string for this array is without the [ ]. This cause a Exception in the serializer I use. (I use this one http://james.newtonking.com/) My question is simple can I add something too tell to the deserializer to always ta...

How to store event.getX & event.getY in an array for android

How to retrieve the coordinate from event.getX or getY and store into an array? I want to use the coordinate store in array to redrawn in Canvas each time the user touch action. ...

how to get and use associative array from YAML to action in symfony framework 1.4.8

Ive got in app.yml some configration data, and I want to foreach them in action. I try do this by get them by sfConfig::get('app_datas') but it fails. Lets show them in details: YAML: all: datas: foo: bar foo2: bar2 and in the actions.class.php I try use this code: foreach (sfConfig::get('app_datas') as $key => $value) { ...

c++ references array

Hello, I wounder how i can make this code work? #include <iostream> using namespace std; void writeTable(int (&tab)[],int x){ for(int i=0;i<x;i++){ cout << "Enter value " << i+1 <<endl; cin >> tab[i] ; } } int main(void){ int howMany; cout << "How many elemets" << endl; cin >> howMany; int tab...

AS3 Object List Search with Attribute Value Only

Suppose I have a list of objects of a certain custom type and I need to find an object given only the value of one of its attributes, how do I do it? Eg. // Where user1 ... usern are objects of some class User users = [ user1, user2, user3 ... usern ] // How do I find out the objects that have the "foo" attribute set to "bar" ...