I have two array one is two dimensional and second is one dimensional and want to merge in a two dimensional array.  For Example :  # array1 Array (     [0] =&gt; Array         (             [id] =&gt; 598                   )      [1] =&gt; Array         (             [id] =&gt; 599                 ) ) # array2 Array (            [id] =&gt; 66     )  #resultant array Array (     [0] =&gt; Array         (             [id] =&gt; 598         )     [1] =&gt; Array         (             [id] =&gt; 599         )     [2] =&gt; Array         (             [id] =&gt; 66                  ) )   In above example array1 and array2 are two input array and want to result as resultant array.  I have tried array_merge php function but it is not working.   How to do that?
23579
It's probably beginner question but I'm going through documentation for longer time already and I can't find any solution. I thought I could use implode for each dimension and then put those strings back together with str_split to make new simple array. However I never know if the join pattern isn't also in values and so after doing str_split my original values could break.  Is there something like combine($array1, $array2) for arrays inside of multi-dimensional array?
93553
I have two excel sheets. I have to merge the two such that the values in one match with the other. For eg.  The first excel,    the 2nd excel  1  t                 1   tes1 2  5                 3   tes3 3  t                 4   tes4 4  g   Notice that in the first column of the 2nd excel, 2 is missing, so I want the first excel to look like this,  1 tes1 t 2      5  3 tes3 t 4 tes4 g   I am new to excel. Any help on this will be highly appreciated.
67765
I'm looking for the name of the PHP function to build a query string from an array of key value pairs. Please note, I am looking for the built in PHP function to do this, not a homebrew one (that's all a google search seems to return). There is one, I just can't remember its name or find it on php.net. IIRC its name isn't that intuitive.
96246
I have been looking for a solution to this, have seen some sort of add on called dynamic text but I don't think that suits my needs.  Basically, I have a multi dimensional array. Basically what I want to do is pass a value from the array into the 'to' field in Contact Form 7. I know I could just write my own contact form but I'm using the plugin quite extensively on the site so for integration it would be nice to use it for this new thing I'm building too. Any clues, doesn't seem you can put php straight in to the to field, as this didn't work to well!:  &lt;?php echo $passmein;?&gt;
95963
Let's say that I have two arrays (in Java),  int[] numbers; and int[] colors;  Each ith element of numbers corresponds to its ith element in colors. Ex, numbers = {4,2,1}      colors = {0x11, 0x24, 0x01}; Means that number 4 is color 0x11, number 2 is 0x24, etc.  I want to sort the numbers array, but then still have it so each element matches up with its pair in colors.  Ex. numbers = {1,2,4};     colors = {0x01,0x24,0x11};  What's the cleanest, simplest way to do this? The arrays have a few thousand items, so being in place would be best, but not required. Would it make sense to do an Arrays.sort() and a custom comparator? Using library functions as much as possible is preferable.  Note: I know the "best" solution is to make a class for the two elements and use a custom comparator. This question is meant to ask people for the quickest way to code this. Imagine being at a programming competition, you wouldn't want to be making all these extra classes, anonymous classes for the comparator, etc. Better yet, forget Java; how would you code it in C?
112730
How do I join two files vertically without any separator? I tried to use paste -d"" a b, but this just gives me a.  Sample file:  000    0   0   0 0001000200030004   10  20  30  40     2000    4000             .123             12.1 1234234534564567
67149
I'm trying to create an array of arrays that will be using repeated data, something like below:  int[] list1 = new int[4] { 1, 2, 3, 4 }; int[] list2 = new int[4] { 5, 6, 7, 8 }; int[] list3 = new int[4] { 1, 3, 2, 1 }; int[] list4 = new int[4] { 5, 4, 3, 2 };  int[,] lists = new int[4, 4] {  list1 ,  list2 ,  list3 ,  list4  };   I can't get it to work and so I'm wondering if I'm approaching this wrong.   What I'm attempting to do is create some sort of method to create a long list of the values so I can process them in a specific order, repeatedly. Something like,  int[,] lists = new int[90,4] { list1, list1, list3, list1, list2, (and so on)};  for (int i = 0; i &lt; 90; ++i) {    doStuff(lists[i]); }   and have the arrays passed to doStuff() in order. Am I going about this entirely wrong, or am I missing something for creating the array of arrays?
6421
I have two arrays in PHP as follows:  People:  Array (     [0] =&gt; 3     [1] =&gt; 20 )   Wanted Criminals:  Array (     [0] =&gt; 2     [1] =&gt; 4     [2] =&gt; 8     [3] =&gt; 11     [4] =&gt; 12     [5] =&gt; 13     [6] =&gt; 14     [7] =&gt; 15     [8] =&gt; 16     [9] =&gt; 17     [10] =&gt; 18     [11] =&gt; 19     [12] =&gt; 20 )   How do I check if any of the People elements are in the Wanted Criminals array?  In this example, it should return true because 20 is in Wanted Criminals.
22636
If I have 2 DataTables (dtOne and dtTwo) and I want to merge them and put them in another DataTable (dtAll).  How can I do this in C#?  I tried the Merge statement on the datatable, but this returns void.  Does Merge preserve the data?  For example, if I do:   dtOne.Merge(dtTwo);   Does dtOne change or does dtTwo change and if either one changes, do the changes preserve?  I know I can't do this because Merge returns void, but I want to be able to store the Merger of both dtOne and dtTwo in dtAll:  //Will Not work, How do I do this dtAll = dtOne.Merge(dtTwo);
14769
I need to concatenate two String arrays in Java.  void f(String[] first, String[] second) {     String[] both = ??? }   What is the easiest way to do this?
13411
Trivial question: Is there any standard notation for the concatenation of two or more matrices?  Example:  $$A = \left(\begin{array}[c c]  - a_1 &amp; a_2\\ a_3 &amp; a_4  \end{array}\right),$$  $$B = \left(\begin{array}[c c]  - b_1 &amp; b_2\\ b_3 &amp; b_4  \end{array}\right),$$  Then the concatenation (by rows) of $A$ and $B$ is:  $$C = \left(\begin{array}[c c]  - a_1 &amp; a_2\\ a_3 &amp; a_4 \\  b_1 &amp; b_2\\ b_3 &amp; b_4  \end{array}\right).$$  I just want to know if there is a standard notation for this operation.
22800
I have two arrays like this:  A=(vol-175a3b54 vol-382c477b vol-8c027acf vol-93d6fed0 vol-71600106 vol-79f7970e vol-e3d6a894 vol-d9d6a8ae vol-8dbbc2fa vol-98c2bbef vol-ae7ed9e3 vol-5540e618 vol-9e3bbed3 vol-993bbed4 vol-a83bbee5 vol-ff52deb2) B=(vol-175a3b54 vol-e38d0c94 vol-2a19386a vol-b846c5cf vol-98c2bbef vol-7320102b vol-8f6226cc vol-27991850 vol-71600106 vol-615e1222)   The arrays are not sorted and might possibly even contain duplicated elements.   I would like to make the intersection of these two arrays and store the elements in another array. How would I do that? Also, how would I get the list of elements that appear in B and are not available in A?
88660
What is the accepted/most commonly used way to manipulate dynamic (with all dimensions not known until runtime) multi-dimensional arrays in C and/or C++.  I'm trying to find the cleanest way to accomplish what this Java code does:  public static void main(String[] args){  Scanner sc=new Scanner(System.in);  int rows=sc.nextInt();  int cols=sc.nextInt();  int[][] data=new int[rows][cols];  manipulate(data); }  public static void manipulate(int[][] data){    for(int i=0;i&lt;data.length;i++)    for(int j=0;j&lt;data[0].length.j++){          System.out.print(data[i][j]);           }     }   (reads from std_in just to clarify that dimensions aren't known until runtime).  Edit:I noticed that this question is pretty popular even though it's pretty old.  I don't actually agree with the top voted answer.   I think the best choice for C is to use a single-dimensional array as Guge said below "You can alloc rowscolssizeof(int) and access it by table[row*cols+col].".  There is a number of choices with C++, if you really like boost or stl then the answers below might be preferable, but the simplest and probably fastest choice is to use a single dimensional array as in C.  Another viable choice in C and C++ if you want the [][] syntax is lillq's answer down at the bottom is manually building the array with lots of malloc's.
91750
I'm not a GIS professional so I hope I use the correct wording, at least I hope you understand my question.  Let's say there are five polygons in the feature A. In the shapefile there are  more features. In feature A two polygons from the five existing are intersecting. I want to merge the two so overlapping lines will be deleted and the result is one polygon.  A possible solution would work like this:   I select the feature which 'activate' all five polygons  I switch to edit mode  I select the points of the two polygons  I use function MERGE-SELECTED-POLYGONS   So far I found only functions to merge objects (features?), merge shapefiles, and so on.  Is there a function MERGE-SELECTED-POLYGONS?
36961
I would like to create something like a=array[1,2,15,6,18] and then a[0]=1, a[1]=2. Is it possible to create an array in LaTeX (with pgf or another package)?
6976
What's the simplest, most standard, and/or most efficient way to split a List into two sub-Lists in Java? It's OK to mutate the original List, so no copying should be necessary. The method signature could be  /** Split a list into two sublists. The original list will be modified to  * have size i and will contain exactly the same elements at indices 0   * through i-1 as it had originally; the returned list will have size   * len-i (where len is the size of the original list before the call)   * and will have the same elements at indices 0 through len-(i+1) as   * the original list had at indices i through len-1.  */ &lt;T&gt; List&lt;T&gt; split(List&lt;T&gt; list, int i);   [EDIT] List.subList returns a view on the original list, which becomes invalid if the original is modified. So split can't use subList unless it also dispenses with the original reference (or, as in Marc Novakowski's answer, uses subList but immediately copies the result).
29178
I have the following code:  if ($_POST['submit'] == "Next") {     foreach($_POST['info'] as $key =&gt; $value) {         echo $value;     } }   How do I get the foreach function to start from the 2nd key in the array?