arrays

Accessing an array of HTML input text boxes using jQuery or plain Javascript

I'm looking to create a form which contains a dynamic number of input text boxes. I would like each text box to form part of an array (this would in theory make it easier for me to loop through them, especially as I won't know the number of text fields that will eventually exist). The HTML code would like something like: <p>Field 1: <in...

Changing text color upon selection of a specific cell/row in a UITableView on Iphone?

Hi! I have a simple grouped UITableView fed from a couple of arrays. Changing the selected text color is no issue, using the cell.selectedTextColor method. But this results in the same color being applied no matter which cell I select. I would, for example, want the text in cell 2 to turn green upon selection, while the text of all th...

how does the FlashBuilder debugger know the order in which items were added to an associative array with string keys?

I have an array of objects which uses a delimited string as the keys. When examined in the FB4 debugger, the keys look like this: [+] 22477◦25220◦20.1 [+] 22477◦25220◦20.6 [+] 22477◦25220◦20.8 [+] 22477◦25244◦55.1K(j) The first two items are numeric (cast to string) but the third item in the multi-part delimited key is na...

PHP Objects vs Arrays

I have a huge amount of PHP objects for a neural network for which I have to iterate over and perform some maths on. I was wondering if I would be better off using an associative array over instances of classes? I am dealing with around 3640 objects and iterating around 500 times (at best) on top of that so any micro-optimization helps ...

How to read a Delphi Array of Fixed Sized Strings within a packed record in c#

I need to read a blob field from a database into a c# app. However the blob field was written to the database by a Delphi App using the following method: procedure WriteABlob(Blob : TBlobField; var Buffer; size : integer); var s : String; begin setlength(s,size); move(buffer,s[1],Size); Blob.Value := S; end; ...

Javascript match changing the value of a different array

I am having issues with a couple arrays below and the match method. On my page I call the Checkout() function and it sets a temporary array equal to the array I've been building with different options. It then loops through the temporary array and removes html from one of the elements. The issue is that when I alert the array Remote.C...

How to get length in Javascript of an array of Form text fields...

I have this HTML code: <form id="form1" name="form1" method="post" action=""> a <input type="text" name="item[]" value="1" /> <br /> b <input type="text" name="item[]" value="1" /> <br /> c <input type="text" name="item[]" value="1" /> </form> I can't seem to pro grammatically pull the length out of the text fields array , is there so...

PHP - How to get the element before the last element from an array ?

How can I get the element before the last element from an array in PHP5 ? ...

How can I remove an element from a Perl array after I've processed it?

I am reading a postfix mail log file into an array and then looping through it to extract messages. On the first pass, I'm checking for a match on the "to=" line and grabbing the message ID. After building an array of MSGIDs, I'm looping back through the array to extract information on the to=, from=, and client= lines. What I'd like to...

Pros and cons between ArrayList and Arrays.

When to use ArrayList and when to use Arrays? ...

php xml2array problem

I hope you can help me out with this problem I have with xml2array. when there is one item in the XML it returns just the array (example 1), when there are multiple items it returns an extra dimension 0,1,2,3 (example 2). I don't want to have two sets of foreach code for 1 and many arrays. How do I can convert example 1 into example 2?...

AS3 Functions: is it possible to return a value inside of a loop?

I am trying to find the index from an array using a loop function, but I am getting an error: private function findMatch(matchValue:int):int { for (var i:int = 0; i < playersList.length; i++) { if (playersList[i].value + matchValue == levelTarget) { return i; } ...

Pulling $_POST array elements into sequential variables with a common prefix

I have a $_POST array that results from selecting (in this case) 3 rows from a displayed HTML table in which each row has a checkbox. The IDs are unique identifiers for each row. Array ( [checkbox] => Array ( [0] => 001403166 [1] => 001407509 [2] => 001407541 ) ) I want to gathe...

JavaScript arrays

What is the easiest way to insert a new object into an array of objects at the index position 0? No jQuery; MooTools okay; no unshift() because it's undefined in IE according to w3schools. ...

Obtaining double value out of array, iphone

NSDecimalNumber *lat = [[NSDecimalNumber alloc]initWithDouble:sqlite3_column_double(selectStatement, 1)]; [latt addObject:lat]; [lat release]; CLLocationCoordinate2D annot; annot.latitude = [[latt objectAtIndex:k]doubleValue]; The above 2 codes shows the creation and retrieving of double valu...

How to get numeric key of new pushed item in PHP?

$arr[] = $new_item; Is it possible to get the newly pushed item programmatically? Note that it's not necessary count($arr)-1: $arr[1]=2; $arr[] = $new_item; In the above case,it's 2 ...

Php array dynamic fill

how can i fill following type array dynamicly in for loop array('items'=>array( array('label'=>'News', 'url'=>array('/site/index')), array('label'=>'News2', 'url'=>array('/site/2')), )); I am new in programming thanks for help ...

VBScript - Create and collect value from array

Hi, I'm trying to figure out how to write a vbscript that does this: I've got a system of checkboxes which represents a type of software. And each of these checkboxes are collected into each own boolean variable. For each of these 'true's I want to send an e-mail. How can I do this using a "for each" loop or something? ...

WINDBG, how to view the contents of an array?

I'm using WINDBG to analyze a dump file for a program that exhibits a bit too high memory usage. One of the objects involved is holding an object array, referencing a lot of objects I'd like to look at, to try to find out why they were allocated. Here's what I've tried: First, my collection of ServiceContainer objects: 0:000> !do 056...

How to get last key in array in javascript?

This is similar to this question,only PHP->javascript http://stackoverflow.com/questions/2197933/how-to-get-numeric-key-of-new-pushed-item-in-php ...