I have an array of unsigned integers in C and a java array of longs. I want to copy the contents of the unsigned integers to the java array. So far, the only function that I've found to do this is SetLongArrayRegion(), but this takes an entire buffer array. Is there a function to set only the individual elements of the java array?
Th...
I have this thumbnail list and would like push the image paths (sources) into an array: tn_array
<ul id="thumbnails">
<li><img src="somepath/tn/004.jpg" alt="fourth caption" /></a></li>
<li><img src="somepath/tn/005.jpg" alt="fifth caption" /></a></li>
<li><img src="somepath/tn/006.jpg" alt="sixth caption" /></a></li>
</ul>
...
hi all, i'm a newbie in programming and in php too and i was wondering if anyone can help me with my array problem.
i have two set of array, example:
$name = array("peter","peter","joe");
$cars = array("ford", "gmc", "mercy");
and i would like to merge them into a multidimensional array like this
$merge = array(array($name[0], $...
My project has both managed & unmanaged code. I wrote a class cIVR in managed code, while defining it in an unmanaged cpp file. The project has been working fine for some time.
Now I need to call a member function of one of objects in array 'arrChannels' from another function in the same file.
During array definition it's not allowing...
I have an array of objects that contains a key value with true or false. These values start as false but switch to true on completion of their work. I was looking to determine when all the values had completed i.e. all switched to true. Is there a deviation(logic below) on a while loop with a test if statement that may solve this.
bas...
I have this code, but it won't compile and i can't understand what is wrong - i guess the pointering of the vector is not correct.
My idea was to collect some numbers in main() and store them in a vector and array, and then pass the memory address of them to a function, and using a pointers to print the data stored.
I came up with this...
Surely there must be a way to do this... I can't work it out.
I have a (9,4) array, and I want to repeat it along a 3rd axis 4096 times... So it becomes simply (9,4,4096), with each value from the 9,4 array simply repeated 4096 times down the new axis.
If my dubious 3D diagram makes sense (the diagonal is a z-axis)
4| /off to 4096
3...
I currently have a VB.NET dll that returns a jagged array of double. This is the declaration:
Public Function CalcMatching(ByRef dataArray1 As Object,
ByRef dataLen1 As Integer, ByRef dataArray2 As Object,
ByRef dataLen2 As Integer, ByRef matchingType As String) As Double()()
It works well inside VB.NET, but when I insert it...
Hey everyone,
I am trying to use url rewriting on my website and I want to use the list() and explode() functions to get the right content.
Currently my code looks like this:
list($dir, $act) = explode('/',$url);
In this case $url is equal to everything after the first slash in the absolute url i.e. http://example.com/random/stuff =>...
Is there any equivalent of String.indexOf() for arrays? If not, is there any faster way to find an array within another other than a linear search?
...
I am creating a class for an application "backbone" and I need this function to query the db, and return a multidimensional to look like this:
$myArray = ("name"=>"John", "dob"=>"January 5, 1955");
Of course the data for the array is from a database query.
but, "name" and "dob" would be the database column name and "John" and "Januar...
Hello
While I was trying something special in for loop I recognized that Java doesn't seem to like putting an anonymous array right as the source for a for-each-loop:
for (String crt : {"a","b","c"} ) {
doSomething();
}
actually doesn't work while
String[] arr = {"a","b","c"};
for (String crt : arr ) {
doSomething();
}
doe...
This does not compile.
Dim Tom As New List(Of String) = {"Tom", "Tom2"}
This does
Dim Tom As String() = {"Tom", "Tom2"}
IMO this features should be allowed for all collection types and not only arrays.
...
Having a brain freeze over a fairly trivial problem. If I start with an array like this:
$my_array = array(
'monkey' => array(...),
'giraffe' => array(...),
'lion' => array(...)
);
...and new elements might get added with different keys but always an array value. Now I can be s...
I've got two arrays where I want to find all the elements in Array0 where the full string from Array1 is contained in the string of Array0. Here is the scenario:
I've got a string array that contains the full path of all the xml files in a certain directory. I then get a list of locations and only want to return the subset of xml file...
I have 2 arrays.
$result = array();
$row = array();
Row's elements are all references and is constantly changing. For each iteration of $row I want to copy the values of row into an entry of $result and not the references.
I have found a few solutions but they all seem rather awful.
$result[] = unserialize(serialize($row));
$result[...
#!usr/bin/perl
@array = ();
open(myfile,"sometext.txt");
while(<myfile>)
{
chomp;
push(@array,[split(" ")]);
}
close(myfile);
print @array[0];
Instead of printing the elements of the first array in this multidimensional array, it outputs the hexadecimal(?) pointer reference. If anyone knows how I can print this array, please po...
I'm not even entirely sure how to ask the question, but assuming I have an array in memory like this:
Array (
[0] => Array
(
[0] => Array
(
[0] => 18451
[1] => MDX
)
[1] => Array
(
[0] => 18450
...
How does a pointer points to [-1]th index of the array produce legal output everytime. What is actually happening in the pointer assignment?
#include<stdio.h>
int main()
{
int realarray[10];
int *array = &realarray[-1];
printf("%p\n", (void *)array);
return 0;
}
Code output:
manav@workstation:~/knr$ g...
Sounds easy, but I've got a bug and I'm not sure what's causing it?
nopunccount = 0;
char *ra = new char[sizeof(npa)];
while (nopunccount <= strlen(npa)) {
ra[nopunccount] = npa[strlen(npa) - nopunccount];
nopunccount++;
}
ra never gets a value into it and I have verified that npa has char values to provide within the nopunc...