Loop in a loop

Hello!
How do you feel is it ok to use a loop in a loop in a web application?
for (Iterator i = collection1.iterator(); i.hasNext();)  {
      for (Iterator l = collection2.iterator(); l.hasNext();) {
           collection3.add(l.next());
}

Hello!
How do you feel is it ok to use a loop in a loop in a web application?Sure, why not? A loop in the body of another loop is fine ...
> for (Iterator i = collection1.iterator(); i.hasNext();)  {
for (Iterator l = collection2.iterator(); l.hasNext();) {
collection3.add(l.next());
}But in this particular case you can rewrite the above as:for (Iterator i= collection1.iterator(); i.hasNext(); )
   collection3.addAll(collection2);kind regards,
Jos

Similar Messages

  • Installed Jam Pack but see no new loops in Garageband loop browser. Why not?

    I successfully installed Jam Pack but don't see new loops in Garageband loop browser. Is there some extra step I'm supposed to do? Before, I had about 57 Rock/Blues loops, and I still have just that. I had 14 instruments under All Drums, and guess what? Still only 14.
    I know the install completed successfully - it said so, anyway.
    Clues?

    Have you filters set on the Loop Browser?  Make sure the GarageBand Preference "Loops > Keyword Browsing > Filter for more relevant content" is off.  Otherwise you will  see a fraction of the available loops.
    To see, if the JamPack has been installed, set the pop-up meu at the top of the Loop Browser to "Rhythm Section". Is that available?
    Did you reindex your Loops after installing the Jam Pack? And did you restart the Mac? In Mt. Lion only restarting a Mac will ensure, that an application is not resumed from a cache, when you launch it again.Restarting the Mac will terminate GarageBand for sure.
    If restarting the Mac does not make the JamPack Loops show, rebuild the Loop index.  See:  Rebuilding the Loop Index in GarageBand 6 or earlier - Apple Support

  • When I Drag Loops To The Loop Browser...

    All my loops are in the folder /Library/Application Support/GarageBand/Apple Loops. I dragged them over from the finder to the loop browser in GB, and it looks like it copied all of them to another folder user/Library/Audio/Apple Loops/User Loops/GarageBand/Apple Loops. ***?! What a mouthful. Is this the new default location for all of my loops? Can I change that? Can I erase the Application Support/Garageband folder now? I would like to reclaim the 12+ GB of space.

    As far as I can make out GB needs to store your loops in both Application Support and Audio. The Application Support/GB folder also contains other resources, such as software instruments and channel presets etc., so DON'T DELETE IT!!
    In the Audio folder the GB loops will normally be stored in Apple Loops/Apple/Apple Loops for GarageBand, not in the User Loops Folder. When you dragged them to the browser, GB thought they were a new set of loops and put them in User Loops; so as long as they are still in Apple Loops/Apple/Apple Loops for GarageBand, go ahead and delete them from the User Loops folder. Like I said above, GB seems to store the loops in two locations by default (no Idea why), and I think it's best not to screw around with stuff in the Library under OSX.
    BTW, why did you drag them to the browser in the first place? Had they not appeared there when you installed?

  • Adding loops to the loop browser.

    I'm using mac os 10.4.11. I have placed all my loops on an external hard drive.
    1) Are only apple loops allowed to be added or aiff loops in general as well?
    2) when adding loops to the loop browser should one add an entire folder if they are in a folder or just the files within a folder? I added a folder of flutes but can not find flutes anywhere in the loop browser file list.
    3) As I didn't want the loops within the jam pack voices, and rhythm section installer packages to be added to garageband I removed the loops folders from the packages, and dropped them onto the loop browser. When looking in the jam pack management it shows the rhythm section but not the voices. When I again attempted to drop the voices folder it said it was already there, although I still can't see it.
    4) Once I understand how to do this correctly should I trash the loop browser apple loops index file and re-drop all the loops on the browser again to get everything cataloged correctly?
    Thank you,
    Robert

    Select "Add to Loop Library" from the Edit menu!

  • Apple Loops and the Loop Browser

    maybe I'm missing something here, but whenever I save an edited audio file (or loop) with Apple Loops I can never seem to find the same file in the Loop Browser.
    (unless that is how the app is suppose to behave ...)
    I assumed the Loop Browser behaves somewhat like Logic's Project Manager, referencing and finding files that are associated with Logic Sessions.
    Long story shot, how can i save my edited Apple Loop files and still find them using the Loop Browser
    Thanks.

    The additional content is not just the loops. It is also all the samples for the instruments etc.
    You are correct, however, in the method of moving the loops.

  • How do you turn third-party midi loops into Apple Loops?

    Does anyone know how to turn third-party midi loops into Apple Loops? I've got hundreds of short midi files that I purchased, and I would like to be able to use them in the loop browser of Logic Studio. I tried some of the obvious ways of doing this, like using Apple Loop Utility, but it doesn't seem to recognize .mid files. Seems like .mid files would be right up its alley, so maybe I'm doing something wrong...

    Yes, have the same problem but with wav loops. i have 75000 wav loops from third part and do not find how to "logicized" it. For the moment i can use them into a project but they are not adapting when i change the bpm of the projetc for exemple.
    If you know the solution i would be rescued

  • Smart form - loop inside a loop

    Dear Techies,
      I am new to smartforms. I have a query, in one of the code examples there is a context menu on the main window called "complex selection", but i dont find the same in my editor, what is the reason.
      I want this because i have data in two internal tables. Different tables are generated from secondary depending on the entries in first table. how do i achieve this on the main window.
    Similar to loop inside a loop, depending on my first table entries, all the entries belonging to that entry are to be put in table of second entry. i will have tables equal to the entries in first internal table. hope my question is clear.
    Please help.
    Regards
    imran.

    Hye..
      Loop in main area will fill only the current table, but i want several tables depending on entries in the first internal table.  The number of tables in the main window will be the number records in the first table.
    Regards
    imran.

  • While loop and for loop condition terminal

    Hello friends,
    I am using labview 8.6. The condition terminal of the while loop and conditional for loop is behaving in just the opposite way.
    When i wire a true to the condition terminal of my loop, the while loop continues to run when I click on run. when I wire a FALSE, it stops.
    Is there any setting change that I have to make it to get it work properly.
    Please suggest on this.
    Thanks and regards,
    Herok

    Please do NOT attach .bmp images with the extension changed to .jpg to circumvent the forum filters!
    Herok wrote:
    I am sending you the VI. I am not sure if this would help you because only in 2 computers this behaviour is seen. In others, it works as it is supposed to work.
    Whatever you are seeing must be due to some corruption or folding error. It all works fine here.
    To make sure there are no hidden objects, simply press the cleanup button which would reveal any extra stuff (which is obviously not there). Does it fix itself if you click the termination terminal an even number of times? What if you remove the bad loop and create a new one?
    Could it be you have some problems with the graphics card and the icon of the conditional terminal does not update correctly?
    Whay happens if you connect a control instead of a diagram constant?
    What is different on the computers where it acts incorrectly (different CPU (brand, model), #of cores, etc.) 
    LabVIEW Champion . Do more with less code and in less time .

  • For j in (select a, (select 1 from dual),c ) loop ..end loop;...... error

    declare
    begin
    for cur in (select (select 1 from dual) col from dual)
    loop
      null;
    end loop;
    end;in TOAD, OK, BUT IN FORM ERROR!
    Edited by: indoracle on Feb 23, 2012 2:38 AM
    Edited by: indoracle on Feb 23, 2012 2:40 AM

    A couple of things.
    First, please take a few minutes to review the following:
    <ul>
    <li>Oracle Forums FAQ
    <li>Before posting on this forum please read
    <li>10 Commandments for the OTN Forums Member
    <li>How to ask questions the smart way
    </ul>
    Following these simple guidelines will ensure you have a positive experience in any forum; not just this one! ;-)
    Using the formating information in the Oracle Forms FAQ, it is always recommended that you put your code samples in the ... tags (use lower case "code") so your code is more readable.
    Second, the use of all capital letters is concidered YELLING. I'm sure you did not intend to YELL at anyone, so please only use capital letters when they are needed, not for everything. :)
    Third, what is your Forms Version? If you look at the *10 Commandments for the OTN Forums Member* you'll see that it is always best to give program version information. Depending on your Forms version, the subquery in your SQL statement may not be supported or it could simply be the Cursor For Loop construct [ FOR j IN ( SQL Statement)...] that is not supported. You may have to declare an explicit cursor and reference the explicit cursor in place of your SQL Statement.
    Forth, your FOR LOOP doesn't do anything!
    LOOPEND LOOP; There is nothing between LOOP and END LOOP. I am going to assume that this is intented and just a point of sanatizing your code because what happens in the loop is not relevant to the error.
    ERROR 103.. This is a Forms internal PL/SQL error; meaning the Forms PL/SQL engine can not parse your code. Again, this is probably because the subquery or cursor FOR loop with (SQL Statement versus explicit cursor) is not supported by your Forms version.
    Please, what is your Forms version and any other information that might be helpful.
    Craig...

  • Multiple loop in one loop

    Dear experts,
    Please find the code below.This is text variable customer exit.Can u ple help me to put these multiple loops into one loop.Do u suggest this code is ok?
    Appreciate your help.
    WHEN 'ZSTXTPE01AA'or 'ZSTXT0FISCPER305AA'or 'ZSTXT0FISCYEAR01AA'
    INCLUDE Z_VARIABLES_TEXT
    DATA: vtype i,
          fisper i,
          fisyear i
    IF I_STEP=2.
    LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0VTYPE01AA'
    vtype=LOC_VAR_RANGE-LOW
    ENDLOOP.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW= vtype.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0FISCPER305AA'
    fisper=LOC_VAR_RANGE-LOW
    ENDLOOP.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW= fisper.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0FISCYEAR01AB'
    fisyear=LOC_VAR_RANGE-LOW
    ENDLOOP.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW= fisyear.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    Rgds
    ACE

    LOOP AT I_T_VAR_RANGE INTO loc_var_range
    WHERE VNAM IN('ZS0VTYPE01AA', 'ZS0FISCPER305AA','ZS0FISCYEAR01AB')
    vtype=LOC_VAR_RANGE-LOW.
    endloop.
    L_S_RANGE-LOW= vtype.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    L_S_RANGE-LOW= fisper.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    L_S_RANGE-LOW= fisyear.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    try the above code
    also
    What u r doing inside ur loop endloop?

  • Multiple loops in one loop for text variables

    Dear experts,
    Please find the code below.This is text variable customer exit.Can u ple help me to put these multiple loops into one loop.Do u suggest this code is ok?
    Appreciate your help.
    WHEN 'ZSTXTPE01AA'or 'ZSTXT0FISCPER305AA'or 'ZSTXT0FISCYEAR01AA'
    INCLUDE Z_VARIABLES_TEXT
    DATA: vtype i,
          fisper i,
          fisyear i
    IF I_STEP=2.
    LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0VTYPE01AA'
    vtype=LOC_VAR_RANGE-LOW
    ENDLOOP.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW= vtype.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0FISCPER305AA'
    fisper=LOC_VAR_RANGE-LOW
    ENDLOOP.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW= fisper.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0FISCYEAR01AB'
    fisyear=LOC_VAR_RANGE-LOW
    ENDLOOP.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW= fisyear.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    Rgds
    ACE

    Hi ACE BW,
    You can try to use the SELECT statement and then include the LOOP inside it.
    Thanks,
    Daniel

  • How to avoid the loop inside the loop? as it reduces the performance.

    hi masters,
    i have 2 internal tables having 1 same field. eg table itab having f1, f2, f3 fields and itab1 having f1, f4 and f5 fields. let us consider the data in the itab and itab1 is like below given
    itab-f1   itab-f2   itab-f3                 itab1-f1     itab1-f4   itab1-f5
    10        aa         11                      10             abc       456
    10        bb         15                      10             def        655
    10        ff           13                      10             ghi        456
    11        dd         16                      10             tre         455
    11        zz         24                      11             ftr          256
    11        ii           54                      11             kjh         556
    12        hh         24                      12             fjk          751
    now i want the result in final table like below
    f1         f2       f3         f4         f5
    10        aa      11      abc      456
    10        aa      11      def       655
    10        aa      11      ghi       456
    10        aa      11      tre       455
    10        bb      15      abc      456
    10        bb      15      def       655
    10        bb      15      ghi       456
    10        bb      15      tre       455
    10        ff        13      abc      456
    10        ff        13      def      655
    10        ff        13      ghi      456
    10        ff        13      tre       455
    11        dd      16      ftr        256
    11        dd      16      kjh      556
    11        zz      24      ftr       256
    11        zz      24      kjh      556
    11        ii        54      ftr       256
    11        ii        54      kjh      556
    12        hh      24      fjk       751
    i can get this result using the
    Loop at itab.
    loop at itab1 where f1 = itab-f1.
    process....
    endloop.
    endloop.
    but it is very slow. i want to avoid this loop inside the loop and i want to implement the same program using read table.. like below..
    Loop at itab.
    Read table itab1 with key ....
    process...
    endloop.
    Is it possible? to get multiple records from itab2 using read statement or with READ statement that using CASE Statement or IF statemetnt.
    Plz help me...

    hi,
    please try the following code
    TYPES:
      begin of ty_itab2,
       f1
       f2
       f3
       f4
       f5
      end of ty_itab2.
    DATA:
      lw_tab2tmp type ty_itab2,
      lt_tab2tmp type standard table of ty_itab2.
    sort it_itab by f1.
    loop at it_itab into lw_itab.
      at new f1.
        CLEAR lt_tab2tmp[].
        loop at it_itab1 into lw_itab1 where f1 = lw_itab-f1.
          CLEAR lw_tab2tmp.
          move-corresponding lw_itab1 to lw_tab2tmp.
          append lw_tab2tmp into lt_tab2tmp.
        end loop.
        "while there is no data with f1 in it_itab1
        if lt_tab2tmp is initial.
          lw_tab2tmp-f1 = lw_itab-f1.
          append lw_tab2tmp into lt_tab2tmp.
        endif.
      end at.
      CLEAR lw_tab2tmp.
      MOVE-CORRESPONDING lw_itab to lw_tab2tmp.
      modify lt_tab2tmp from lw_tab2tmp TRANSPORTING f2 f3 where not f1 is initial.
      append lines of lt_tab2tmp into lt_itab2.
    end loop.
    lt_itab2 is the final table.
    There may be some syntactically errors.
    I have not a system to test it now, please test it.

  • Change a non-looping track to looping

    I'm using STP 2.0.2
    I also just started reading Apple Pro Training Series 'Soundtrack Pro' by Mary Plummer.
    It seems my interface is not the same as what she shows in the book. Doesn't state what version STP it's referencing.
    Questions and confusion so far are:
    1. I can't find anywhere a way to change a non-looping track to looping. It's not in the clip drop-down or when I right-click the clip in the timeline.
    2. I can't find the format button (it's not on the top tools bar next to the sample rate selector). I can only change beats/time-based from the Multitrack drop-down.

    That book is from 2006. I'm sure it's version 1. You should update to v3 anyway. It's being more stable, especially under Snow Leopard.

  • Need help w/ for loop, a do loop, and a do-while loop.

    Hello I have been trying to write a program that uses a for, do, and a do-while loop, but I am having trouble. I need the program that will prompt the user to enter two numbers. The first number must be less than the second number. I need to use a "for loop", a "do loop", and a "do-while loop" to display the odd numbers between the first number and the second number. For example, if the user entered 1 and 8, the program would display 3,5,7 three different times (one for each of the loops). Please help if you can. Thanks.

    boolean2009 wrote:
    Thank all of you all for responding.Youre welcome.
    Yes this is my homework, but my major does not even involve java i just have to take the class.Not our problem.
    And yes we are suppose to have all three in one program I do not know why,So you can learn all three types of loops (there is also an enhanced for loop to learn later on).
    but I just do not understand programming nor do i really want to.Once again not our problem.
    If anybody could help it would be much appreciated. thanks.Yes, a lot of people are willing to help you. No, none of them will do it for you. What you need to do is attempt the code and when you get stuck, post your code using the code button, include error messages, indicate which lines in your code genereate those error messages and ask specific questions.

  • FPGA - Synchroniz​ation between two loops with different loop rates.

    Hi all,
    I am trying to implement an Analog and Quadrature Decoder. Simply put, I have two loops:  LOOP 1 with an Analog Input (AI) which is a slower loop rate. Another loop: LOOP 2 has a digital input (input) and counts the Quadrature counts. I understand that Analog conversion is slower, and as a result,  LOOP 1 will have a slower higher tick rate. I want to pass the "counts" from LOOP 2 into LOOP1, so that I can synchronize the Analog Input with the number of quadrature counts. My issue at hand is: since LOOP 2 updates at a higher rate. Will the "counts" value that I pass/tunnel from LOOP 2 to LOOP 1 refresh at the LOOP 2's rate or at LOOP 1's rate.
    Thanks,
    Herrick Chang

    hlchang wrote:
    Hi all,
    I am trying to implement an Analog and Quadrature Decoder. Simply put, I have two loops:  LOOP 1 with an Analog Input (AI) which is a slower loop rate. Another loop: LOOP 2 has a digital input (input) and counts the Quadrature counts. I understand that Analog conversion is slower, and as a result,  LOOP 1 will have a slower higher tick rate. I want to pass the "counts" from LOOP 2 into LOOP1, so that I can synchronize the Analog Input with the number of quadrature counts. My issue at hand is: since LOOP 2 updates at a higher rate. Will the "counts" value that I pass/tunnel from LOOP 2 to LOOP 1 refresh at the LOOP 2's rate or at LOOP 1's rate.
    Thanks,
    Herrick Chang
    The only way to pass values between two parallel loops is by some sort of global variable (global or locals are fine, as are shared variables although I wouldn't recommend that for FPGA if you don't want to go outside of the FPGA target at all). Don't tunnel anything between two independant loops as they won't be independant anymore.
    The local variable will be updated at the rate the writing loop updates it, though your slower read loop will obviously not see every value. Note that the FPGA compiler will protect the local variable access in both loops in order to avoid race conditions. This protection is necessary but expensive in terms of runtime performance of each loop as well as FPGA gate usage.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

Maybe you are looking for