arrays

Problems with PHP when trying to create big array

Hi, Here is my code, which creates 2d array filled with zeros, array dimensions are (795,6942): function zeros($rowCount, $colCount){ $matrix = array(); for ($rowIndx=0; $rowIndx<$rowCount; $rowIndx++){ $matrix[] = array(); for($colIndx=0; $colIndx<$colCount; $colIndx++){ $matrix[$rowIndx][$colIndx]=...

PHP var_dump array

array(14) { [0]=> string(1) "1" ["id"]=> string(1) "1" [1]=> string(7) "myUserName" ["UserID"]=> string(7) "myUserName" [2]=> string(10) "myPassword" ["passwordID"]=> string(10) "myPassword" [3]=> string(24) "[email protected]" ["emailAddress"]=> string(24) "[email protected]" [4]=> string(7) "myFirs...

Comparing two array values

I have a form used to void, dismiss, amend and correct citations. A void can not be done in conjucntion with a dismissal, amendment, or correction. If you need to void and amend, you complete two forms. You can however do a dismissal, amendment and/or correction on the same form. I have two arrays created based on the variables from the...

summarise php array into treeview

Array ( [00000000017] => Array ( [00000000018] => Array ( [00000000035] => I-0SAYHADW4JJA [00000000038] => I-RF10EHE25KY0 [00000000039] => I-8MG3B1GT406F ) [00000000019] => I-7GM4G5N3SDJL ) [000000...

How do I make a plot in Matlab if I do not know the specific size of the array?

I have some code function runTubulin() n = 10; for j = 1:n TubulinModel(); end plot(TubulinModel(), n); So my problem is that TubulinModel has a random number of outputs So I keep getting ??? Error using ==> TubulinModel Too many output arguments. Error in ==> runTubulin at 11 plot(TubulinModel(), n); Is ...

ArrayList of arrays vs. array of ArrayLists vs. something similar

I'm creating a TableModel which will have a fixed number of columns, but the number of rows will be changing (mostly, increasing as function of time). Which would be better approach to store the data, ArrayList[] columns = new ArrayList[numberOfColumns]; // Each array element is one column. Fill each of them with a new ArrayList. ... pu...

PHP Array Key encoding?

I use a encoded string as a key in array, and also uses the same string as a value in the array, like below code indicates: $string = 'something in some encode'; $list = array(); $list[$string]['name'] = $string; when I print_r the array out(just print_r without headers/encoding specific), found that the key in the array and it's 'nam...

Matching one-d Array with a two-d Array

Hi, I'm having some problems grasping how to match a one-dimensional array with a two-dimensional array. So I have one array, a one-dimensional, that contains numbers (e.g. 1, 2, 3, 4, 5...) and one two-dimensional array that contains numbers and some text (e.g. [1][dog], [2][cat], [3][mouse]...) So now what I want to do is to use the ...

How to convert Matlab output into an array?

Hi there I hope you can help me. I've made an M-file that outputs data into my Matlab command window in the form below (I've deleted the extra spaces). My question is, is there an easy way to convert this output into an array, without having to type all the data into the array editor as I'm currently doing? (Or even run it straight from ...

Should I use php quote escapes for single quotes or use double quotes in arrays?

I realized that I can have problems with single quotes in php arrays: <?php $lang = array( 'tagline' => 'Let's start your project', "h1" => "About Me" ); ?> So I changed it to double quotes: <?php $lang = array( "tagline" => "Let's start your project", "h1" => "About Me" ); ?> Should I use "php quote escapes", inste...

adding blank elements to array

Hi I have an array x in size of objects (between 1 and 100) and I want to increase the size to 101 ... I've resized the array and that adds the objects but unfortunatly (not suprising) the added items have not been initialised, do I've reverted to using a do while loop and adding the elements indiviually, but looking at the code around ...

An efficient cache in Delphi

I'm creating a cache which is going to contain records in Delphi 2007. Each record contains a String, 2 Dates and a value. Type MyRecord = Record Location : String; Date1 : TDateTime; Date2 : TDateTime; Value : Double; End; There are no guarantees on what the maximum size of the cache will be. It is highly likely tha...

Should I use Hypens, Underscore or camelCase in php arrays?

I just started using php arrays (and php in general) I have a code like the following: languages.php: <?php $lang = array( "tagline" => "I build websites...", "get-in-touch" => "Get in Touch!", "about-h2" => "About me" "about-hp" => "Hi! My name is..." ); ?> index.php: <div id="about"> <h2><?php echo $lang['about...

Simple question: In numpy how do you make a multidimensional array of arrays?

Right, perhaps I should be using the normal Python lists for this, but here goes: I want a 9 by 4 multidimensional array/matrix (whatever really) that I want to store arrays in. These arrays will be 1-dimensional and of length 4096. So, I want to be able to go something like column = 0 #column to ins...

I am getting a System.NullReferenceException : Object reference not set to an instance of an object when trying to add a value to an array at runtime

I have a piece of code: EDIT: The _penParams are initialized as the added line below. ProjectionParameters _penParams = new ProjectionParameters(); [Given(@"Rate Rule List $raterule")] public void Rate_Rule_List(Int32 raterule) { _penParams.RateRuleIds.Initialize(); _penParams.RateRuleIds.Add(raterule...

Sort a list from Arrays.asList() changes also the origin array ?

Hi all, I noticed a strange behavior (for me) when sorting a list retrieved with Arrays.asList(). It seems that after Collections.sort( list ), the origin array is also sorted ! How is it possible ? List<Rate> rates = Arrays.asList( arrayRates ); Collections.sort( rates, new RateEffectiveDateComparator() ); /* after that the rates lis...

C(++) malloc confusion

I'm just not getting any further with allocating memory for arrays in C and mainly C++. I've looked for examples but there aren't any useful ones for me out there, at least it seems so. So if I have a typedef here like this: typedef struct { int x; int y; } Coordinate; Coordinate* myList; And I have an array of the type Coordinate t...

Using PHP Gettext Extension vs PHP Arrays in Multilingual Websites?

So far the only 2 good things that I've seen about using gettext instead of arrays is that I don't have to create the "greeting" "sub-array" (or whatever its called). And I don't have to create a folder for the "default language". Are there other pros and cos of using gettext and php arrays for multilingual websites? USING GETTEXT: sp...

Displaying JSON array through ajax (jquery)

I'm pretty new to Ajax and JSON and tried to get this to work but can't seem to get the hang of it. How do I call the json in ajax and display all the info inside the json file? here's my json file { posts: [{"image":"images/bbtv.jpg", "alter":"BioBusiness.TV", "desc":"BioBusiness.TV", "website":"http://andybudd.com/"}, {"image":"imag...

C++ malloc - dynamic array

Assuming that I have a program that has an array of unknown lenght that consists of Customers. Here, a customer struct: struct Customer { char* lastname; char* firstname; int money; }; And here - an array: Customer* CustomerDB; Okay. But the thing is that I want to add and remove customers dynamically during runtime. I don't wa...