Merging 2 arrays so the sets are intertwined into the 1.

Say for example
int a[] = {1,2,3,};
int b[] = {11,14,15};
and i wanted to merge b into a (or maybe array c if merge a not possible) so the vaule in array a or c is: 1,11,2,14,3,15
Been twisting my brains and playing around with the loops and i know how to simple add b to the end of c but i want to merge it so the vaules are intertwined. Can someone give me a pointer to the concept on how i could do it, or show me. Thanks.

public int[] intertwine2(int[] a, int[] b) {
int[] c = new int[a.length + b.length];
int j = 0;
for(int i = 0; i < Math.max(a.length, b.length;
gth; i++)
if(i < a.length) c[j++] = a;
if(i < b.length) c[j++] = b[i];
return c;
Very nice. Except your missing a ')' after b.length. =P                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • User defined func: Unavble to merge two arrays in result list

    Hi
    I am trying to merge two arrays on the basis of "FEE" element in the input file;
    Actually there is an Attribute Name and Value pair array coming in the input file which has 5 pairs already(Notification + 100 , oversize + 8 etc.) see example below;
    <m0:Fees>ZB9</m0:Fees>
    <m:Attribute>
      <m0:Attributename>NOTIFICATION</m0:Attributename>
      <m0:Attributevalue>100</m0:Attributevalue>
      </m:Attribute>
    <m:Attribute>
      <m0:Attributename>OVERSIZE</m0:Attributename>
      <m0:Attributevalue>8</m0:Attributevalue>
      </m:Attribute>
    <m:Attribute>
      <m0:Attributename>OVERWEIGHT</m0:Attributename>
      <m0:Attributevalue>108</m0:Attributevalue>
      </m:Attribute>
    <m:Attribute>
      <m0:Attributename>SIGNATURE</m0:Attributename>
      <m0:Attributevalue>294</m0:Attributevalue>
      </m:Attribute>
    <m:Attribute>
      <m0:Attributename>RTS</m0:Attributename>
      <m0:Attributevalue>8</m0:Attributevalue>
      </m:Attribute>
    The condition is:
    CASE 1. If the FEE doesn't exist in the file then only the Atrribute Name and Value in added to the Array
    CASE 2 If FEE exist then add all the Atrribute Name and Value pairs as well as in the last index of Array add String "Fee" in Attributename and String "ZB9" in  Attributevalue.
    CASE 1 is working fine.
    but in CASE 2 even if i m taking an output array of length Attributename +1 and Attributevalue +1 and trying to add "Fee" and "ZB9" respectively, it never happens.
    Please have a look at the code below;
       //write your code here
    public void ud_Attributename(String[] Fees,String[] Attributename,ResultList result,Container container){
              String attribute_copy[]=new String[Attributename.length+1];
              String attribute_name[]=new String[Attributename.length];
              String array_copy1[]=new String[Attributename.length+1];
              //int len =Attributename.length;
              if(Fees[0]!=null)
                   if(Fees[0].equals("ZB0"))
                   Fees[0]="01";
                   else if(Fees[0].equals("ZB5"))
                   Fees[0]="02";
                   else if(Fees[0].equals("ZB6"))
                   Fees[0]="03";
                   else if(Fees[0].equals("ZB9"))
                   Fees[0]="04";
              try{
                   if((Fees[0]=="01")||(Fees[0]=="02")||(Fees[0]=="03")||(Fees[0]=="04"))
                        for(int x=0;x<=Attributename.length;x++)
                             if(x==Attributename.length)
                             array_copy1[x]="Fee";
                             else{
                             array_copy1[x]=Attributename[x];
                             result.addValue(array_copy1[x]);
                   else
                        for(int i=0;i<=len;i++)
                             attribute_name<i>=Attributename[i+1];
                             result.addValue(attribute_name<i>);
              }catch(Exception e)
              {e.printStackTrace();}
    Same way i've used for Attributevalue.
    But the result is
    <ATTRIBUTEPAIR>
    <PAIR>
    <NAME>NOTIFICATION</NAME>
    <VALUE>04</VALUE>
    </PAIR>
    <PAIR>
    <NAME>OVERSIZE</NAME>
    <VALUE>8</VALUE>
    </PAIR>
    <PAIR>
    <NAME>OVERWEIGHT</NAME>
    <VALUE>108</VALUE>
    </PAIR>
    <PAIR>
    <NAME>SIGNATURE</NAME>
    <VALUE>294</VALUE>
    </PAIR>
    <PAIR>
    <NAME>RTS</NAME>
    <VALUE>8</VALUE>
    </PAIR>
    </ATTRIBUTEPAIR>
    Please suggest where i am wrong. ur help is very much appreciated.
    Thnks in advance

    this is i am doing now
       //write your code here
              String attribute_copy[]=new String[Attributename.length+1];
              String attribute_name[]=new String[Attributename.length];
              String attribute_name1[]={"Fee"};
              //String[] Attributename.copyTo(attribute_name1,0);
              //String[] attribute_name1 = (String[]) Attributename.Clone();
              //String fees;
              String array_copy1[]=new String[Attributename.length];
              int len =Attributename.length;
              for(int y=0;y<len;y++){
              array_copy1[y]=Attributename[y];
              if(Fees[0]!=null)
                   if(Fees[0].equals("ZB0"))
                   Fees[0]="01";
                   else if(Fees[0].equals("ZB5"))
                   Fees[0]="02";
                   else if(Fees[0].equals("ZB6"))
                   Fees[0]="03";
                   else if(Fees[0].equals("ZB9"))
                   Fees[0]="04";
                   else if(Fees[0].equals("ZA1"))
                   Fees[0]="05";
                   else if(Fees[0].equals("ZA2"))
                   Fees[0]="06";
              try{
                   if((Fees[0]=="01")||(Fees[0]=="02")||(Fees[0]=="03")||(Fees[0]=="04")||(Fees[0]=="05")||(Fees[0]=="06"))
                        int j=0;
                        for(int a=0;a<=len;a++)
                             if(j==0&&attribute_copy[j]==null)                                   
                                  attribute_copy[j]="Fee";
                             else
                                  //int b=-1;
                                  for(int i=0;i<=len;i++)
                                       if(i==j)
                                       //i=i-1;
                                       attribute_copy[j]=array_copy1[i-1];
                                       break;
                                       else{
                                       continue;}
                        result.addValue(attribute_copy[j]);
                        j+=1;
                   else
                        for(int i=0;i<=len;i++)
                             attribute_name<i>=Attributename[i+1];
                             result.addValue(attribute_name<i>);
              }catch(Exception e)
              {e.printStackTrace();}
    and the result in queue is
    SUPPRESS
    [FEE]
    [NOTIFICATION]
    [NOTIFICATION]
    [OVERSIZE]
    [OVERSIZE]
    [OVERWEIGHT]
    [OVERWEIGHT]
    [SIGNATURE]
    [SIGNATURE]
    [RTS]
    [RTS]
    but in the output i m getting
    <ATTRIBUTEPAIR>
    <REF_HANDLE>0001</REF_HANDLE>
    <PAIR>
    <NAME>Fee</NAME>
    <VALUE>04</VALUE>
    </PAIR>
    <PAIR>
    <NAME>OVERSIZE</NAME>
    <VALUE>8</VALUE>
    </PAIR>
    <PAIR>
    <NAME>OVERWEIGHT</NAME>
    <VALUE>108</VALUE>
    </PAIR>
    <PAIR>
    <NAME>SIGNATURE</NAME>
    <VALUE>294</VALUE>
    </PAIR>
    <PAIR>
    <NAME>RTS</NAME>
    <VALUE>8</VALUE>
    </PAIR>
    </ATTRIBUTEPAIR>
    Notification is missing.

  • In LR6CC, after using the merge to HDR and the photo returns to LR as a DRG, it is not automatically put into a previously set up stack. For example a stack of three photos. If I use NIK HDR and the photo returns to LR, the stack is automatically changed

    In LR6CC, after using the merge to HDR and the photo returns to LR as a DRG, it is not automatically put into a previously set up stack. For example a stack of three photos. If I use NIK HDR and the photo returns to LR, the stack is automatically changed from 3 to 4. When LR's HDR merge brings a photo back into LR's library, the stack number does not change and the DRG version isn't included in the stack.

    Hi,
    The Ps CS6 public beta version contains the same camera support as found in Ps CS5/5.5 compatible CR 6.6. There will be future updates to CR 7 for Ps CS6 to pick up more camera support. The Nikon D800 NEF files are not supported, yet.
    If you like to work with your D800 files in the public beta build now, you'll have to get the DNG Converter 6.7 from here: http://labs.adobe.com/technologies/cameraraw6-7/
    and convert your files to DNG.
    regards,
    steve

  • Is it normal for a waveform graph to truncate arrays of values that are longer than others when displaying multiple waveforms on the same graph?

    I am reading back values of several waveforms that were saved to disk using the write to spreadsheet vi. Some of the data sets are longer than others eg. 35 seconds vs 45 seconds. All have the same sample rate.
    See the code segment below. If I select the larger files first then all the data will show. If I select a smaller file first the larger ones will be truncated to the size of the small file. I am using LV 7.0.
    Attachments:
    codesnippet.vi ‏41 KB

    I needed to make some grammatical/ nomelclature changes, But, Could not edit the previous post.
    so posting again
    "Thats because you are inserting into an array of a predefined size.
    For ex,
    When you try inseting a 1D array 'A' of 50 elements as row 1 of a  2 D array of 40 elements(in row 0 ), only only the first 40 elements will get insetred into 2 D array. You lose the last 10 elements of array 'A'
    To avoid this, I suggest you use XY graph( of course you have to create an x axis with the index of each element in the inserted array and plot on xy graph).
    Any doubts, do get back"
    regards
    Dev

  • Why don't I see the "Show Merged TOC in Child Project" setting?

    I have read about the "Show Merged TOC in Child Project" setting in RoboHelp 8 and have seen a screen shot of the build properties page where that check box is. But, when I go to build WebHelp, I don't see the same window. A number of the settings are different, and there is no "Show Merged TOC in Child Project" setting. I am using RoboHelp 8 (version 8.0.2.208 to be exact). I have pasted in a screen shot of the window that I see.
    The first screen I see when I build WebHelp looks the same as the screen shot in Peter Grainge's article on Merged Help. The screen above is the second one I see.
    Can anyone help? I'm mystified!

    Hi there
    Looks like you experimented with enabling Section 508. When you do that and toggle it back off, you are left with the Traditional style - no skin WebHelp. So back up a screen and choose a skin. Then you will see the option.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • I have two albums (RCA Sweeny Todd 2 discs set and RCA Into the Woods 1 disc) where the songs are listed as being on the same album on the list view, but do not group together on the iPod, so the songs can't play consecutively, or in the proper order.

    I have two albums (RCA Sweeny Todd 2 discs set and RCA Into the Woods 1 disc) where the songs are listed as being on the same album on the list view, but do not group together on the iPod, so the songs can't play consecutively, or in the proper order. The "Apply Sort Field" and "Same album does not work, but ti is only these two RCA albums that do this. All other albums remain intact. Need help with this minor problem. Thanks.

    UPDATE: This behavior (to an extent) still happens when "Repeat Album" is off. Instead of an infinite loop, it goes through all the tracks on the album (unsuccessfully) and kicks me out to the Album overview screen. Going back to list of Albums and tapping the Album again brings up "No Content: You can download music from the iTunes Store" but that screen immediately kicks me back to list of Albums.
    So I am just even more confused now.

  • Photomatix plug-in's HDR merged image has suddenly stopped showing up as part of the stack, yet when I repeat the merge it warns that these images are already merged. I have the merged image labeled with a HDR suffix.

    Photomatix plug-in's HDR merged image has suddenly stopped showing up as part of the stack, yet when I repeat the merge it warns that these images are already merged. I have the merged image labeled with a HDR suffix. Worked fine until now. Thanks

    I am not sure what's happening with IE9 (no live site) but I had real problems viewing your code in Live View - until I removed the HTML comment marked below. Basically your site was viewable in Design View but as soon a I hit Live view, it disappeared - much like IE9. See if removing the comment solves your issue.
    <style type="text/css">
    <!-- /*Remove this */
    body {
        margin: 0;
        padding: 0;
        color: #000;
        background:url(Images/websitebackgroundhomee.jpg) repeat scroll 0 0;
        font-family: David;
        font-size: 15px;
        height:100%;

  • HT4528 I loaded the iphone update and now my gmail does not sync.  I get a message that imap cannot connect.  All my setting are the same and correct.  Thoughts.

    After loading the iphone update, I get a message that imap.gmail.com is not resopnding.  All my setting are the same and are correct.  My gmail works on my ipad. Thoughts.

    Same thing happened to me.  Called Verizon, they had me run updates and resync to the local tower (*228, option2).  Took about 15 minutes over the phone to correct.

  • HT1296 I am facing a problem with my iPhone 4. I applied the first syncing with outlook 2007 by choosing the "merge" option. At the end of the process, some contacts are correctly sync, but most are only sync with the names. Numbers are lost. Any suggesti

    I am facing a problem with my iPhone 4. I applied the first syncing with outlook 2007 by choosing the "merge" option. At the end of the process, some contacts are correctly sync, but most are only sync with the names. Numbers are lost. Any suggestion?

    I would love to do this as well. All I need is my calendar appts from outlook. Right now I am using google calendar sync, but I would like to move to the cloud and away from google. I find it hard to believe there isn't an option to do this.

  • Strange issue with POF: byte array with the value 94

    This is a somewhat strange issue we’ve managed to reduce to this test case. We’ve also seen similar issues with chars and shorts as well. It’s only a problem if the byte value inside the byte array is equal to 94! A value of 93, 95, etc, seems to be ok.
    Given the below class, the byte values both in the array and the single byte value are wrong when deserializing. The value inside the byte array isn’t what we put in (get [75] instead of [94]) and the single byte value is null (not 114).
    Pof object code:
    package com.test;
    import java.io.IOException;
    import java.util.Arrays;
    import com.tangosol.io.pof.PofReader;
    import com.tangosol.io.pof.PofWriter;
    import com.tangosol.io.pof.PortableObject;
    public class PofObject1 implements PortableObject {
         private byte[] byteArray;
         private byte byteValue;
         public void setValues() {
              byteArray = new byte[] {94};
              byteValue = 114;
         @Override
         public void readExternal(PofReader reader) throws IOException {
              Object byteArray = reader.readObjectArray(0, null);
              Object byteValue = reader.readObject(1);
              System.out.println(Arrays.toString((Object[])byteArray));
              System.out.println(byteValue);
              if (byteValue == null) throw new IOException("byteValue is null!");
         @Override
         public void writeExternal(PofWriter writer) throws IOException {
              writer.writeObject(0, byteArray);
              writer.writeObject(1, byteValue);
    Using writer.writeObjectArray(0, byteArray); instead of writer.writeObject(0, byteArray); doesn't help. In this case byteArray would be of type Object[] (as accessed through reflection).
    This is simply put in to a distributed cache and then fetched back. No EPs, listeners or stuff like that involved:
         public static void main(String... args) throws Exception {
              NamedCache cache = CacheFactory.getCache("my-cache");
              PofObject1 o = new PofObject1();
              o.setValues();
              cache.put("key1", o);
              cache.get("key1");
    Only tried it with Coherecne 3.7.1.3.
    Cache config file:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
         <caching-scheme-mapping>
              <cache-mapping>
                   <cache-name>my-cache</cache-name>
                   <scheme-name>my-cache</scheme-name>
              </cache-mapping>
         </caching-scheme-mapping>
         <caching-schemes>
              <distributed-scheme>
                   <scheme-name>my-cache</scheme-name>
                   <service-name>my-cache</service-name>
                   <serializer>
                        <class-name>
                             com.tangosol.io.pof.ConfigurablePofContext
                        </class-name>
                        <init-params>
                             <init-param>
                                  <param-type>string</param-type>
                                  <param-value>pof-config.xml</param-value>
                             </init-param>
                        </init-params>
                   </serializer>
                   <lease-granularity>thread</lease-granularity>
                   <thread-count>10</thread-count>
                   <backing-map-scheme>
                        <local-scheme>
                        </local-scheme>
                   </backing-map-scheme>
                   <autostart>true</autostart>
              </distributed-scheme>
         </caching-schemes>
    </cache-config>
    POF config file:
    <?xml version="1.0"?>
    <pof-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://xmlns.oracle.com/coherence/coherence-pof-config"
         xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-pof-config coherence-pof-config.xsd">
         <user-type-list>
              <!-- coherence POF user types -->
              <include>coherence-pof-config.xml</include>
              <user-type>
                   <type-id>1460</type-id>
                   <class-name>com.test.PofObject1</class-name>
              </user-type>
         </user-type-list>
    </pof-config>

    Hi,
    POF uses certain byte values as an optimization to represent well known values of certain Object types - e.g. boolean True and False, some very small numbers, null etc... When you do read/write Object instead of using the correct method I suspect POF gets confused over the type and value that the field should be.
    There are a number of cases where POF does not know what the type is - Numbers would be one of these, for example if I stored a long of value 10 on deserialization POF would not know if that was an int, long double etc... so you have to use the correct method to get it back. Collections are another - If you serialize a Set all POF knows is that you have serialized some sort of Collection so unless you are specific when deserializing you will get back a List.
    JK

  • Use boolean array to perform set operations

    I am currently taking a computer science class that uses Java as the language of choice. I have no prior experience with Java. We have a homework assignment in which we are supposed to use a boolean array to implement set operations. We have to create a method that inserts an integer into the array, another that deletes an integer element, and several others. I am confused as how to do this with integers, as it is a boolean array. The datr for this class is:
    private boolean base[];The constructor is:
    public largeset(int size){ }We then have to create a method that inserts an integer into the array:
    public void insert(int i){ }And one that deletes the element:
    public void delete(int i) { }I am unsure how to do this using a boolean array. If it were an integer array I would not have any trouble, but I get an error when trying to insert/delete an integer from the boolean array. Can anyone help point me in the right direction? I would prefer advice only, not the actual code, as this is a homework assignment, and I would like to create the code myself so I actually know what I am doing. Thanks.

    This is the assignment exactly as posted on the course website:
    In this homework, we will use a boolean array to implement various set operations. Please create a class called largeset that supports set operations of any number of elements. The data of this class is
    private boolean[] base;The constructor of the class is
    public largeset(int size);  // create a boolean array of size "size" and store it in "base"The methods of the class are:
    public void insert(int i);  // insert number i into the current set, where 0 <= i < base.length
    public void delete(int i);  // delete number i from the current set, where 0 <= i < base.length
    public boolean member(int i); // test if i is in the set
    public largeset union(largeset B); // return the union of two sets
    public largeset interset(largeset B); // return the intersection of two sets
    public largeset subtract(largeset B); // return the subtraction of two sets
    public largeset complement(); // return the complement of the current set
    public boolean subset(largeset B); // test if the current set is a subset of set B
    public int cardinality();  // return the number of elements in the current set
    public String toString();  // return a string which is a printing of the current setThen create another class called testset that uses the largeset class. At first, please create the following two sets:
    X = { 1, 3, 5, 7, ..., 999 };
    Y = { 9, 18, 27, 36, ..., 999 };
    Please perform the following tests:
    1. display the cardinalities of X and Y, respectively.
    2. display the content of substraction of Y by X.
    3. display the square root of the sum of all the elements of X (Math.sqrt(x) will return the square root of x in double type).
    4. For every pair of distinct elements x and y in Y, compute the sum of (Math.max(x, y) - Math.min(x, y)) (or equivalently, Math.abs(x - y)), and report this sum.

  • Merging different arrays as one long array

    Hi there, I have some problem with merging of array.
    Because of the natural of my VI, I will need to merge arrays together to form a single long array.
    I have designed a VI using For loop and case-switching but the current array keep over-writing the previous array. I had enable auto-indexing on the For loop but it couldnt work.
    I have attached two VI for further illustration.
    Trying to merge arrays togther.vi  is the program i am working on.
    Desired output of program.vi  is the actual thing i would like to obtain at the output.
    Thanks for all the help.
    Keith Tan
    Solved!
    Go to Solution.
    Attachments:
    Trying to merge arrays together.vi ‏27 KB
    Desired Output of program.vi ‏15 KB

    Hi Keith,
    it's the magic of shift registers
    You should always note which LV version you're using!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    Desired Output of program.vi ‏17 KB
    Trying to merge arrays together.vi ‏28 KB

  • How do I cerate an array with a set of numbers lets say 1 through 12 random order but no repeating.

    How do I cerate  an
    array with a set of numbers lets say 1 through 12 random order but no
    repeating.
    I know this should be easy but my brain wont work
    right now
    Solved!
    Go to Solution.

    OK, here's the handmade version.
    It is useful to know that arrays of clusters are sorted by the cluster order of the elements. Simply bundle random numbers with numbers 1-12 in a loop, create an array at the output tunnel, sort the array by the random number, and extract the number array. It will be shuffled.
    Message Edited by altenbach on 06-04-2007 09:20 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    shuffleArray.png ‏5 KB

  • Select X# of variables from array at the furthest possible intervals.

    Ok, I've been working on this one for a while and I'm thinking I'm either missing something really stupidly simply because of it, or I've got my equation wrong still. 
    Basically, what I'm trying to do is select X number of items out of an array.  The only catch is, these items need to be as far apart from each other as possible.  So for example, one time I might have an array with 93 items in it which I need to grab 36 of them, evenly spaced through the array (so the first one would be the first one in the array, and the last one would be the last in the array.
    How would I go about telling the script to grab the correct array values (the most evenly spaced ones), ending up with only the X amount of output values?
    Thanks!
    dgolberg

    Hmm, this is kind of a different perspective than what I was originally thinking, but it might work.  I'll have to test it out, though it would require me running the array twice; the first time picking out the specific ones and splicing them out of the array, the second simply grabbing the remainder.
    To put it a little differently, what I was originally thinking is cycling through an array (this array's length and content varries depending on the input), and would grab the the "masters" out of the array at the set intervals (these intervals are where I'm having the most trouble), and anything it finds matching a set range for the current loop cycle that isn't considered a "master" is placed under the master as a "slave" (or essentially, a duplicate).  Below is an example of one of the loops I'm using (I have 3 nested loops in order to cycle through 3 "dimensions" of values) with my last attempt at this issue (which is only correct in certain ranges rather than all ranges like I need).
    var DF = tA.length / mNum;  //tA.length is the array length, mNum is the number of masters desired from that array.  For example, array length of 100, mNum of 75; DF = 1.333333....
    var master = 0;
    for(var z=range[1];z<range[2]+2;z=z+5) { //Cycles through the array 5 units at a time (to speed up the script)... There are 2 other loops above this using the y and z variables seen in the if statements below.
         for(var i=0;i<tA.length;i++) { //Cycles through the tempArray to find matches to the current cycle of the above loops, +/- 2
               if(tA[i][0] <= x + 2 && tA[i][0] >= x - 2 && tA[i][1] <= y + 2 && tA[i][1] >= y - 2 &&tA[i][2] <= z + 2 && tA[i][2] >= z - 2 && master < 1) { //Checks for a match, and if the master is less than 1, it sets the match as a master.
                   master = master + DF; //Adds the DF (short for Dupe Frequency) to the current master number.
                   outArray.push(tA[i]); //Set the match as a master
              } else if(tA[i][0] <= x + 2 && tA[i][0] >= x - 2 && tA[i][1] <= y + 2 && tA[i][1] >= y - 2 &&tA[i][2] <= z + 2 && tA[i][2] >= z - 2 && master >= 1) { //Checks for a match, and if the master is greater than 1, it sets a duplicate.
                   master = master - 1;
                   outArray[outArray.length-1].push(tA[i][3]); //Set the match's name as a slave under the last master
    Basically, using the code above; I need it to somehow (while cycling through the tA.length loop), figure out how often it should grab either a slave or a master (depending on which there are more of), and then the next X number of matches are either a master or a slave (again, depending on which there are more of).  So, for example, if there are 25 masters, out of 100 total items in the array, it would pick one master, the next 3 matches would be slaves, and then it would pick another master, 3 more slaves, etc. etc.  Where things start getting out of whack is when the intervals start ending up in fractions (say every 1.5 is a slave).  Obviously, you can't grab half of one, so you'd need to do a pattern more like: 1 master, 1 slave, 1 master, 2 slaves, 1 master, 1 slave; etc.
    The part I'm having trouble with is getting a working equation that knows how often to pick the (in the example above) slaves based on this varying pattern, and do so accurately regardless of the array length to master/slave ratio (the above method seems to get further off as the mNum gets closer to the tA.length).
    I guess, more than anything really, I'm just having trouble getting the math to work out right as I'm apparently using the wrong equation in my code.  If anyone has any ideas though, let me know.

  • My iPhone is merging different contacts with the same firstname into one contact. How can i resolve this.

    My Bosses iPhone is merging different contacts with the same firstname into one contact. How can i resolve this? He seems very disturbed and thinks i don't know what i'm doing. I've set up all his devices to sync across and now its messed up on his iPad, and two iPhones.
    E.G Contacts with firstname 'Adams' and different numbers are synced into one account.
    Now i have no clue how many contacts are this way cos he has a huge number of contacts (he's the ceo).
    Please i need a suggestion on how to fix this.
    Thanks for the help.

    Janie Mac wrote:
    Cannot find settings to then go to general then about.
    How do I edit the device in iTunes?
    Double-click on the name.
    My screen shot shows both devices because I sync wirelessly.  Right now I can change the iPod name but not the iPad name because the iPod is idle while the iPad is syncing.  In another minute or two, I'll be able to change the iPad name.

Maybe you are looking for

  • How to disable the "turn page" event triggered by the scroll/swipe function?

    The problem is as follows. The default behaviour of Acrobat Reader (both stand alone and browser plug-in) is to allow scrolling/swiping with the mouse wheel/trackpad. This is useful when the pdf's page length is greater than the screen's own length,

  • Is there any way to read XML directly from a Web Page ??

    i have a url, which on sending request, shows XML in browser. Now i need to read this XML in browser and then manipulate it according to my need and display it on another page. actually the process is. : 1) i have to first retrieve an xml from other

  • Restrictions at store location with 311

    When we run T-code: - MB1B with 311 movement type There mention two store location One for source Second for destination We need restrict one way stock transfer. That means 1) Store A to store B to be approve with 311 2) Store B to store A not approv

  • Worth installing compared to 10.1.3?

    Hi there, We've installed ZCM 10.1.3 and the ZCM database on a separate SLES box. We've upgraded the single Primary server to 10.2. Is it worth scrapping the "old" database server and installing 10.2 Reporting Server? We haven't done much configurati

  • Export a Playlist

    I do a fair amount of editing in many of the available fields for most of my tracks. I use almost all of the fields (most notably 'comments', 'show', 'description'). I also find it helpful (and fun) to export my entire library using the export playli