arrays

Problem copying NSMutableArray

I am trying to copy one array to another: NSMutableArray *itemsCopy = [[NSMutableArray alloc] initWithArray:self.items copyItems:YES]; but I get the error: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Item copyWithZone:]: unrecognized selector sent to instance 0x5a74900' *** Call stack at fir...

C# Run Program from byte array

Hello, I have a program stored in byte array. Is it possible to run it inside C#? Thanks ...

Getting a double[] row array of a double[,] rectangular array

Suppose you have an array like: double[,] rectArray = new double[10,3]; Now you want the fouth row as a double[] array of 3 elements without doing: double[] fourthRow = new double[]{rectArray[3,0], rectArray[3,1], rectArray[3,2]}; Is it possible someway? Even usin...

Is this the correct way to reloadData on a UITableView?

I am trying to append objects to my data source and then reload the table. Is this the correct way of approaching it? self.items is my datasource //Copy current items self.itemsCopy = [self.items mutableCopy];//[[NSMutableArray alloc] initWithArray:self.items copyItems:NO]; NSLog(@"Copy Size before append: %d",[itemsCo...

In JS/JQuery can I pull a single element out of a Multi-Dimensional array and store it in another array?

I am using flot to do some graphing and I am trying to animate the graph into steps. I want to take a multi-dimensional array with say 3 objects where each of those objects has 3 objects. So I have this: array1[0][0] = 30 array1[0][1] = 30 array1[0][2] = 10 array1[1][0] = 35 array1[1][1] = 35 array1[1][2] = 15 array1[2][0] = 40 array1[2...

change the data of char array

i have an array of type char char *arg[100] this array its reading the data from somewhere, when that when i print arg[0], it prints the value "help", and when i print the arg[1], it prints the value "exit".. as an example what i want exactly is to change the arg[0] from "help" to anything else, like "man" how i can do that??? than...

PHP: How to get this string value?

I have an array with the following data: [steamid] => stdClass Object ( [0] => Shakyor ) How can I get the 'Shakyor' string from there? $array->$steamid doesn't work. $array->$steamid[0] doesn't work. $array->$steamid->0 is not legal markup obviously. ...

Turning additional strings in this JSON array into a UITableView Detail

I have a NSURL request that brings back an array of "name" and "phone", "etc"... The "name" Key shows up fine on the master table, but I'm having trouble figuring out how to get the rest of the array to show up on the detail table when I select the row. (I have the DetailerTableViewController working to accept the view). Any help would b...

How to sort an array of arrays in php?

In php I have a numerical array of associative arrays: mainArray: [ array1:['title':'Record a','order':'2'], array2:['title':'Record b','order':'4'], array3:['title':'Record c','order':'1'], array4:['title':'Record d','order':'3'] ] What is the simplest way to sort mainArray by the 'order' value of each associative array? Th...

using structures with multidimentional tables

I have a table of structures and this structures are 2 dimentional table of constants. can you teach me on how to get the values in the table of constants. (note following is just example) typedef struct { unsigned char ** Type1; unsigned char ** Type2; } Formula; typedef struct { Formula tformula[size]; } table;...

How to find the duplicate and highest value in an array

Hello guys I have an array like this array={'a'=>'2','b'=>'5', 'c'=>'6', 'd'=>'6', 'e'=>'2'}; The array value might be different depending on the $_POST variables. My question is how to find the highest value in my array and return the index key. In my case, I need to get 'c' and 'd' and the value of 6. Not sure how to do this. Any ...

How do I get the size of the boost buffer

I am trying to make an asynchronised server in visual studio and I use boost::asio::async_read(m_socket, boost::asio::buffer(m_buffer), boost::bind(&tcp_connection::handle_read, shared_from_this(), boost::asio::placeholders::error)); to get the buffer to be put in m_buffer ...

Retrieve array key passed on value PHP

I have the following array $group= array( [0] => 'apple', [1] => 'orange', [2] => 'gorilla' ); I run the array group through an for each function and when the loop hits values of gorilla I want it to spit out the index of gorilla foreach ($group as $key) { if ($key == gorilla){ echo //<------ the index of g...

How initialize array of classes? (C++)

Hello, I have this class constructor: Pairs (int Pos, char *Pre, char *Post, bool Attach = true); How can I initialize array of Pairs classes? I tried: Pairs Holder[3] = { {Input.find("as"), "Pre", "Post"}, {Input.find("as"), "Pre", "Post"}, {Input.find("as"), "Pre", "Post"} }; Apparently it's not working, I also tried...

Java: Combine 2 List <String[]>

I have two List of array string. I want to be able to create a New List (newList) by combining the 2 lists. But it must meet these 3 conditions: 1) Copy the contents of store_inventory into newList. 2) Then if the item names in store_inventory & new_acquisitions match, just add the two quantities together and change it in newList. 3)...

Mysql results into array (PHP)

How can i convert mysql results (from mysql_fetch_array) into such a form? $some = array( "comments" => array( array( "text" => "hi", "id" => "1" ), array( "text" => "hi", "id" => "2" ), array( "text" => "hi", "id" => "3" ), array( "text" => "hi", "id" => "4" ) ) ); while the db looks like:...

How to fill byte array with junk?

I am using this: byte[] buffer = new byte[10240]; As I understand this initialize the buffer array of 10kb filled with 0s. Whats the fastest way to fill this array (or initialize it) with junk data every time? I need to use that array like >5000 times and fill it every time with different junk data, that's why I am looking for a fas...

php array to jquery array to qTip plugin.

Hi I'm trying to get a PHP array to use in some jquery script using the qTip plugin. This is my array: $descqtip[ ] = array('name' => ''.$name.'', 'description' => ''.$description.''); Here is my jquery code: <script type="text/javascript"> $(document).ready(function() { var description = <?php echo json_encode($descqtip)?>; ...

how to echo/access the 'get' index of the given array in PHP syntax

I have the array variable say $value, and it has the below given array [navigation] => navigationHistory Object ( [path] => Array ( [0] => Array ( [page] => order_form.php [mode] => NONSSL ...

3D array initialization

I need to represent some spatial points: x,y,z when I try to initialize the array like this: int[][][] points { { {100, 120, 10}, {100, 120, 18}, ... } } I got an error: Uncompilable source code - not a statement where is the error? ...