I'm just trying to quickly debug a webservice by printing out the contents of an int and string array. Is there anyway to do this in one method?
I tried
public static string ArrayToString(object[] array)
{
StringBuilder sb = new StringBuilder();
foreach (Object item in array)
{
sb.Append(item.ToString());
sb.Appe...
What is the difference between the following declarations:
int* arr1[8];
int (*arr2)[8];
int *(arr3[8]);
What is the general rule for understanding more complex declarations?
...
(N is unknown)
$controller->$action($params);
must be
$controller->$action($param1, $param2, $param3... $paramN);
...
When I compiled a code using the array name as a pointer, and I deleted the array name using delete, I got a warning about deleting an array without using the array form (I don't remember the exact wording).
the basic code was:
int data[5];
delete data;
so whats the array form of delete?
...
I have an array or a list from linq. I want to show it as a string in console! What should I do?
...
I need to get the total items in array, NOT the last id, none of both ways I found to do this works:
my @a;
# Add some elements (no consecutive ids)
$a[0]= '1';
$a[5]= '2';
$a[23]= '3';
print $#a, "\n"; # prints 23
print scalar(@a), "\n"; # prints 24
I expected to get 3..
Thank you in advance.
...
I have a three-dimensional array that I want to reset to zero. It seems that there should be an easy way to do this that doesn't involve three for loops:
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
for (int k = 0; k < n; k++) {
cube[i][j][k] = 0;
}
}
}
...
Hi everyone,
I have a problem I can't for the life of me solve. I'm writing a Ruby app (I've been a PHP developer for 8 years, just starting with Ruby) that sells tickets for a concert hall. Each seat has a row (a...z) and a number (1...x). The database model has row (string) and num (int) for each seat.
How can I convert my array of s...
I am writing a decryption class (AES/CBC/PKCS7Padding) where the encrypted data is coming from C#. I want to take the following string (which is base64 encoded):
usiTyri3/gPJJ0F6Kj9qYL0w/zXiUAEcslUH6/zVIjs=
and convert it to a byte array in java to pass into the SecretKeySpec as the key. I know there is the issue of C# having unsigned ...
It seems like this should be relatively simple, but apparently not so much. I can't figure out for the life of me how to store strings and integers in an array in GWT. What data type do you use? If I use JsArrayString, it throws an IllegalArgumentException when retrieving an index containing a number. I obviously can't use JsArrayInt...
I have a semi-large (hundreds of records) 1-dimensional array in Coldfusion. Each item in the array is a struct with several properties. I want to search the array for a struct that has a specific "name" property. I know that for an array of string values I could use Java methods like so:
<cfset arrayIndex = myArray.indexOf("WhatImLooki...
Why isn't there NSArrayController for the iPhone?
Will there ever be an NSArrayController for the iPhone?
...
How do I get this array:
Array
(
[0] => Array
(
[max] => 5
[year] => 2007
)
[1] => Array
(
[max] => 6.05
[year] => 2008
)
[2] => Array
(
[max] => 7
[year] => 2009
)
)
Into this format:
[year] => [max]...
So I'm a Flash guy and I'm trying to convert the following code to Object C:
var slot:Object = new Object();
slot.id = i;
slot.xPos = 25*i;
slot.yPos = 25*i;
slot.isEmpty = False;
// push object to array
arrGrid.push(slot);
Later I can override like:
arrGrid[0].isEmpty = True;
I can't ...
I have two arrays:
Array
(
[2005] => 0
[2006] => 0
[2007] => 0
[2008] => 0
[2009] => 0
)
Array
(
[2007] => 5
[2008] => 6.05
[2009] => 7
)
I want to merge these two arrays such that if a value exists in the 2nd array, it overwrites the first array's value. So the resulting array would be:
Array
(
...
Should I free the allocated memory by myself, or is there a kind of garbage collector?
Is it ok to use th following code in javascript?
function fillArray()
{
var c = new Array;
c.push(3);
c.push(2);
return c;
}
var arr = fillArray();
var d = arr.pop()
thanks
...
I have this array:
unsigned char* data = CGBitmapContextGetData(cgctx);
then I tried to get the size with sizeof(data), but that will return me a nonsense-value of 4. data holds a big amount of information. That can't be just 4 ;)
I even get information at data[8293] ... so ... not 4 elements at all.
...
Is there any simpler way to swap two elements in an array?
var a = list[x], b = list[y];
list[y] = a;
list[x] = b;
...
I'm using OpusScript, which is very similar to Javascript.
I need to sort an Array by two properties of the objects within it.
The object type of the array is 'ScoreEntity', with the properties Score and Time. I need the highest score at the 0 index of the array and vise versa, with the faster time overriding matching scores.
I've bee...
I'm trying do to a basic bash with the use of system calls but I'm having some little problems with a pointer array.
To resume my code, I read commands from the stdin with read() to a buffer then I use strsep() to separate the command from the arguments and all the arguments into an array. Then I create a new process with fork() and exe...