Here's what I have in PHP:
for ($i = 0; $i < 355; $i++)
{
echo "vote";
echo "$i";
echo "=$votesArray[$i]";
if($i != 354)
{
echo "&";
}
}
Which should send data to Flash that looks something like "vote0=2&vote1=5&..." and so on.
Here is the Actionscript 3 side:
var i:int;
for (i = 0; i < 355; i++)
{
...
How would I do this?
To bring it into some better context, I'm having a value from an XML attribute and I want each individual value to be added to an array of strings and each of those values is separated by commas
...
I have point A(x,y) and B(x,y). they listed as array (a => array(x,y), b => array(x,y))
How get lenght between point A and B. Please help in php. :)
...
ie, verify
$a[0]=1; $a[0]=1; $a[0]=1; $a[0]=1; $a[0]=1; $a[0]=1; $a[0]=1; $a[0]=1;
but not
$a[0]=1; $a[0]=2; $a[0]=1; $a[0]=1; $a[0]=1; $a[0]=1; $a[0]=1; $a[0]=1;
thanks :)
...
Hello,
In the code snippet, I expected a segmentation fault as soon as trying to assign a value to count[1]. However the code continues and executes the second for-loop, only indicating a segmentation fault when the program terminates.
#include <stdio.h>
int main()
{
int count[1];
int i;
for(i = 0; i < 100; i...
I just tried the following in vala, and the assertion fails.
int[] x = {1,2};
int[] y = {1,2};
assert( x == y );
I suppose Vala compares the memory locations of x and y instead of the content of the arrays. Is there an easy way to compare two arrays without having to loop though them in vala?
...
Hi,
So I wanna sort an array of Points using the built in sorting method, by a specific coordinate, say x. How can I do this? Heres a sample code:
Point A[] = new Point[10];
// ... Initialize etc.
Arrays.sort(A, x-coordinate);
Is there a built-in comparator for x-coordinates in Point Class? If not, how can I create one and use it. An...
public class Sonnet29 implements Poem {
private String[] poem;
public Sonnet29() {
poem = { "foo", "bar" , "baz"};
}
@Override
public void recite() {
//...
}
}
Line poem = { "foo", "bar" , "baz"}; is giving compilation error.
Any specific reason why this is not allowed?
How do I initialize a Stri...
Hope my question is correct to the post.
<form action="process.php?id=<?php echo intval($order['id']);?>" method="post">
<ul>
<?php
$sd = 'SELECT * FROM download WHERE pid IN ('.$order['pid'].') ORDER BY pid ASC'; // pid IN (3,4,5)
$qd = $db->rq($sd);
$no = 1; while($download = $db->fetch($qd)) {
?>
<li>
<?php echo $no...
This is how I have things setup:
container.html
database1.js (contains large array called database1)
database2.js (contains large array called database2)
Here's a sample of the array (shortened from 6000+ rows to 2):
var database1=[[
"2010-01-03 07:45","2010-01-03 11:00","534","A","","","","","Installed washing machine","0","1",...
how make special random array. i have array(1=>35,2=>25,3=>40). how make possibility that array show special elements. Ex.
If i want get 100 elements from array. it will be
35/100 +-10 - must bee 1 element,
25/100 +-10 = must be 2 element,
40/100 +-10 - must be 3 element.
Elements must be random, but most elements +-10. i know its pos...
Need to put the frequency of each number occurrence into a 1D array and output the result. The 2D to 1D part is throwing me off, I'm not terribly comfortable with arrays yet.
public static void main( String[] args ){
int matrix [][]=new int[20][2];
for (int row=0;row<matrix.length;row++){
for (int column=0;column<matrix[row]...
Via the starPrint method I need to make the frequency of each number populated in the array display in a histogram as such:
1=3***
2=4****
3=7*******
and so on. It needs the number of stars populated that are equal to the frequency of the number appearing! At the moment I'm getting the number of asterisks of the length of the array.
...
hi everbody,
i'm newbie in javascript so, in this example exists the geometrycontrols.js (for global controls) and markercontrol.js (for marker controls)
my problem is identify the arrays where "data" is saved...
at the reference i see a savedata function but i have no idea how work with this function...
on the other side, in test.h...
Is there a built-in way to join two arrays in ColdFusion, similar to JavaScript's array.concat()?
...
Under the addRolls method I need to populate the nums array with the frequency of the 'total' variable numbers. These method adds the two dice rolls together properly and stores it in the 'total' variable but I cannot seem to properly throw them into an array that does the frequency such as the method above it - indFreq. In case that'...
I am trying to do something really simple - initialize an array in Javascript. And it's not working in Google Chrome. Here is the code:
status = [];
for(i=0; i < 8; i++)
status[i]=false;
alert(status.length); //It says 0 when it should say 8
What gives?
...
object, contains 'array1'.
$Obj -> array1 [12]; // works fine.
however, dynamically generating that array name - you can't use square brackets...
$var = 'array1';
$Obj -> $var [ 12] ; // nothing. no error, but no result.
I had to do
$ar = $Obj -> $var ; // copy out array
$ar [12] ; // get value in array.
note:
$Obj -> $$var ...
Hi,
given the following code:
/* signatures */
int getParams(char params[MAX_PARAM_LEN][MAX_LINE_LEN]);
int getVersion(const char params[MAX_PARAM_LEN][MAX_LINE_LEN],
const char* tagName );
/* initializing */
char params[MAX_PARAM_LEN][MAX_LINE_LEN] = {};
/* getting parameters */
paramCount = getParams(params); /* OK, p...
I have an array of timezones:
$timezones = array(
'Africa/Abidjan',
'Africa/Accra',
...
'America/Argentina/Buenos_Aires',
'America/Argentina/Catamarca',
...
'Pacific/Wallis',
'UTC',
);
How can I easiest split this array so that I get one like this:
$timezones = array(
'Africa' => array('Abidjan', '...