I've been programming C/C++ for 20 years but I'm new to objective-c and Coco and have some questions about the performance of NSMutableArray and NSArray.
I need an container much like the stl list container, but coco doesn't seem to have one and inserting and removing elements from the middle of MSMutableArray seems slow, but treating ...
Ok this has been driving me nuts for the past couple of hours and i know there is an easy answer.
I have a scrollPane which has a movie clip called right_container_mc as it's source.
Inside this right_container_mc I have other other movie clips called execiseBox that get added (in the correct positions on the stage) from an array with a...
Is it possible to get specific bytes from a byte array in java?
I have a byte array:
byte[] abc = new byte[512];
and i want to have 3 different byte arrays from this array.
byte 0-127
byte 128-255
byte256-511.
I tried abc.read(byte[], offset,length) but it works only if I give offset as 0, for any other value it throws an ...
typedef struct _stats_pointer_t
{
char **fileNames;
stats_t stats;
} stats_pointer_t;
I need to fill 'fileNames'. Basically, I need to mimic this functionality:
char *fileNames[argc - 1];
fileNames[0] = argv[0];
... but using the struct stats_pointer. So I need to declare the struct, then probably allocate memor...
I get this error:
Traceback (most recent call last):
File "D:/Python26/PYTHON-PROGRAMME/049 bam", line 9, in <module>
ball[i][j]=sphere()
NameError: name 'ball' is not defined
when I run this code. But the ball is defined ( ball[i][j]=sphere() ). Isn`t it?
#2D-wave
#VPython
from visual import *
#ball array #ready
for i in ran...
Hi, i was wondering what is the best way to generate an MD5 (or any other hash) of a multi-dimensional array?
I could easily write a loop which would traverse through each level of the array, concatenating each value into a string, and simply performing the MD5 on the string.
However, this seems cumbersome at best and i wondered if t...
Hello, everyone!
I need to do lots of conversions between primitivetype[] and boxedtype[] (both directions).
Such as: Integer[] <-> int[], Double[] <-> double[], ...
I wanted to know, if there's some quasi-standards APIs out there, which provide such functionality, before I write such utility methods by myself.
Java has 8 primitive ty...
public static void parseProfilesJson(String the_json){
try {
JSONObject myjson = new JSONObject(the_json);
JSONArray nameArray = myjson.names();
JSONArray valArray = myjson.toJSONArray(nameArray);
for(int i=0;i<valArray.length();i++)
{
String p = nameArra...
I'm saving a bunch of ID's to the session like this.
session[:id_group] = 1,2,3,4,5
Because I need to save them to a data base with a form.
In that form I have hidden-field :
<%= form.text_field :group, :value => session[:id_group].inspect%>
I use the inspect so that the value saved to the database gets to be [1,2,3,4,5] and not 1...
I need check whether a given array will match another array. I can't figure out how to either manipulate the first array, or to match it some other way.
I need to match this array:
Array
(
[1] => site
[2] => blog
[3] => index.php
)
to match this:
Array
(
[site] => Array
(
[path] => site
...
Does anyone know how I can compare the elements in an array with the adjacent elements?
For example, if I have an array:
0 0 0 1 1 1 1 0
0 1 1 1 1 1 1 0
0 1 0 1 1 1 1 0
0 1 1 1 1 1 0 0
0 0 0 0 1 1 1 1
1 1 1 1 1 1 1 1
Is there a way to cycle through each element and perform a logical test of whether the elements around it are equal ...
i have a js array like this:
var myArray = [];
myArray[1] = 'test';
myArray[2] = 'test';
-i want to hide it from users to see it. how can i store just the array in a php script and call it?
right now i have the .js separate from my form. and i just call it. but anyone can easily view source and visit the url using the .js name
-ano...
I have created a 2 d array which reads as follows
int i,j,lx,ly;// lx,ly are the row and column respectively
double** a;
a=(double**) malloc((lx+2)*sizeof(double));
a[0]= (double*) malloc((lx+2)*(ly+2)* sizeof(double));
assert(a[0]);
for(i=1;i<lx+2;i++)
{
a[i]=a[i-1]+i*(ly+2);
}
// I...
I have a regex:
/abc(def)ghi(jkl)mno(pqr)/igs
How would I capture the results of each parentheses into 3 different variables, one for each parentheses? Right now I using one array to capture all the results, they come out sequential but then I have to parse them and the list could be huge.
@results = ($string =~ /abc(def)ghi(jkl)mno(...
How can i check if this key is the last in an array?
$array = array("a","b","c");
The value "c" would have the key 2, is there some code like this is_end(2) which returns true or false depending if they key is the last of the array? Or is there some kind of while() statement I can do?
...
Hi folks, is it possible to store multiple datatypes in an array, if not, what could the reason be?
TIA
...
hey how to create unsigned arrays with keys in actionscript 3?
in php its simple:
array('key' => 'val');
in ac3 you can create unsigned arrays like that:
['val']
['key': 'val'] // breaks
...
Is there a way for creating an array from other severals arrays, in Objective C?
...
Hi,
I am using PostgreSQL 8.4. I really like the new unnest() and array_agg() features; it is about time they realize the dynamic processing potential of their Arrays!
Anyway, I am working on web server back ends that uses long Arrays a lot. Their will be two successive processes which will each occur on a different physical machine. E...
Given a simple zero based, numerically indexed array:
var list = ['Foo', 'Bar', 'Baz'];
Many times, I have noticed that when someone suggests looping through variables in an array like this:
for(var item in list) { ... }
...there's almost certainly someone suggesting that that's bad practice and suggests an alternative approach:
v...