Breaking out of a for-in-a-for-in-a-for

I have a question about how the break statement works. Take this:
for (int i = 0; i < 10; i++) {
     for (int j = 0; j < 10; j++) {
          for (int k = 0; k < 10; k++) {
               if (something) {
                    break;
}Am I right in saying this will only break out of the very inner for loop? What I want is a way to break out the very inner and second inner for loops, but NOT the outer. Is there a way to do this? Thanks!

Darryl.Burke wrote:
I would prefer to factor that out into its own method.private void method() {
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10; j++) {
for (int k = 0; k < 10; k++) {
if (something) {
return;
}db(Being not bright enough to think in three dimensions concurrently, let alone four) I hate deep-nested-loops.
class Cube ....
  private boolean contains(T target) {
    for (int y=0; y<NUM_ROWS; y++) {
      if (rowContains(target, y)) return true;
  private boolean rowContains(T target, int y) {
    for (int x=0; x<NUM_COLS; x++) {
      if (colContains(target, y, x)) return true;
    return false;
  private boolean colContains(T target, int y, int x) {
    for (int z=0; z<CELL_SIZE; z++) {
      if (cube[y][x][z].equals(target)) return true;
    return false;
  }... and hows about a CellVisitor to encapsulate all that nasty repeated for-x-for-y-for-z code.... a tad slower but (unless you're algoracing) who really gives a flying toss.
Just another alternative.
;-) Keith.

Similar Messages

  • "Break out" black and pms for prepress?

    Help please?
    I am working in Illustrator CS4, and finished a 2-sided mailer/postcard for a client in cmyk. After emailing the final PDF to the client, the client responded back to me with their print provider's request for— "native file, with black and PMS broken out". 
    First—the file was set up as CMYK, so I am asuming it was partly a lazy reponse/request? (not realizing it was set up as CMYK).
    Second—I typically I send files to commercial print providers as a PDF (Press Quality or PDF/X:1a)—is this not sufficient for them—and why?
    I appreciate any insight on this for my own edification, and I'd like to know if they asked for this beacuse they don't have certain "break out" capabilities on their end? ...OR if it's because PDF's do not provide them with editability (which I thought they did)?
    Lastly, I would specifically like to know what steps I should take to prepare CMYK colors "broken out".  (Step by step please?)
    Thank you VERY much in advance.
    Chemol

    Jet,
    Thanks for your feedback.
    Given that this "separations request" came from the print sales rep—versus the prepress department, I am inclined to think it was "partly a lazy reponse/request (not realizing it was set up as CMYK)."  ....as I stated in my initial posting. Hence, this whole discussion could be moot.
    That said, I do have the Adobe Print Publishing Guide, but not much insight on file separations/what to actually look for. Also, the book does not suggest "separations" for print vendor file prep procedure—just save as PDF/X-1 or PDF/x-3.
    I have tried to research this topic and I am not finding much on "real world" reasoning or situational application—ie: why some print vendors ask for it, while others do not. When is it expected, what is good practice? Are separations for PMS only? Situationally speaking—would a designer actually send a file to a printer broken down/separated by colour—translating a 2 spot colour, 2 sided card (2 pages) into 4 pages—one page per colour? Is that done in the native program ie: illustrator, or is there a SAVE feature that breaks it out for you? questions, questions......
    Yes I have Acrobat Pro and have viewed it already via that method, though I am not sure what I am supposed to gain by it, it or look for specifically?
    Yes, I also have a colour laser printer—I printed the separations (Host Based) instead of Composite—all 4 sheets came out in various degrees of black (similar to viewing an image via individual Channels in Photoshop). Again, not sure what I need to look for here, beyond the cool effect of an infrared appearance. ??
    Yes, I stated in my original message that I was using Ilustrator CS4.
    2-sided postcard:
    I know not to use a "multicolour black" for text, and as I mentioned in my first response to you colour question:
    1 background black (C50, M40, Y40, K100)
    black text ink (K100)
    There are no spot colours, and the commerical printer is a highly reputable large printing company.
    Good suggestion about uploading it for evaluation, and perhaps I will look for a site like that.
    Thx.

  • Indesign CS3 what script for Break Out Text Frame ??

    hi expert,
    Indesign CS3 can Break Out Text Frame or Have Script ??
    like this...
    http://img402.imageshack.us/img402/905/20080517085017hb3.jpg
    thank for tell

    you mean - convert/split multicolumn TextFrame to separated TextFrames ?
    for PC or MAC ?
    robin
    www.adobescripts.com

  • Adding a domain user to the admin role within the local user management breaks all metro apps for all users!!

    Hi,
    I have posted this in another large thread under the "Windows 8 General" group but have not had any appropriate feedback from MS.
    After hours of testing and working with other users I have managed to isolate a simple situation that breaks all metro ui applications within Windows 8 for all users on the machine. Here are my exact steps and notes.
    Before continuing if you are running Avast then your solution may be to turn of the behaviour shield functionality as this also breaks metro apps. This is NOT the problem we are having!
    I have performed 3 cleans installs after isolating the problem and am able to reproduce the issue every time using the same steps on two different machines. 
    First thing to say is that for us it has nothing to do with simply joining the domain, domain/group policies nor does it appear to have anything to do with the software we installed, the problem here is much more simple but the result is pretty terrible.
    Here are my exact steps of what I did to reproduce our problem:
    Complete format of HDD in preperation for a clean install
    Clean install performed
    Set up the machine initially with a local account
    Test metro apps - all working fine
    Open control panel from the desktop, click on System, change the system to join the domain, click reboot
    Log into the system using my domain account
    Test metro apps - all working fine
    Here's were the problem starts. I need my domain account to have admin rights on the local machine so I can install programs without the IT men having to come over and enter their password every 5 mins.
    I go to control panel via the desktop and click on User Accounts. From with here I then click on "Manage User Accounts". This requires the IT guys to enter their details to give me access to such functionality. This is fine
    In the dialog box that opens I can only see the local user that was initially created during setup. The "Group" for this local account shows as "Administrators" - Image included below (important to note that metro apps are working at this point)
    I click add and then add my domain account - also giving it administrator access
    Sign off or reboot to ensure the new security is applied
    Sign back in to the domain account
    Test metro - ALL BROKEN
    Sign out
    Sign in as local account
    Test Metro - NOW ALL BROKEN FOR THIS USER ALSO
    So as soon as I add my domain account to the local user accounts and set it as admin it breaks all metro apps for all users. This is on a totally clean install with nothing at all installed other than the OS.
    Annoyingly if I go back and change the domain account to a standard user or if I totally remove the domain account from the local account management system the problem does not go away for either user. basically it is now permanently broken. The only fix I
    could fathom was a full re install and not giving the domain user admin access to the local  machine.
    Screen one - this is the local user accounts window AFTER joining the domain and logging in with my domain account (All metro apps working at this point)
    Screen 2: User accounts AFTER joining the domain and AFTER adding domain account to local user management (METRO BROKEN)
    I have isolated my machine from all group policies so nothing like that is affecting me. Users I have spoken to in different companies have policies that automatically add users to the local user management. This means that metro apps break as
    soon as they join the domain which leads them to wrongly think it is group policies causing the error. Once they isolate themselves from this they can reproduce following my steps.
    Thanks

    Hi Juke,
    Thank you for the response and apologies for the delay in getting back to you. My machine was running a long task so I couldn't try your suggested solution.
    I had already tried running the registry merge suggested at the top of the thread to no avail. I had not tried deleting the OLE key totally so I did that and the problem still exists. I will post all the errors I see in event viewer below. For
    your info, since posting my initial comment I have sent out my steps to 7 different people and we can all reproduce the problem. This comes to 10 different machines (3 of them mine then the other guys) in 3 different businesses / domains. We see the same errors
    in event viewer.
    Under "Windows Logs" --> "Application" : I get two separate error events the first reads "Activation of app winstore_cw5n1h2txyewy!Windows.Store failed with error: The app didn't start. See the Microsoft-Windows-TWinUI/Operational log for additional
    information." The second arrives in the log about 15 seconds after the first and reads "App winstore_cw5n1h2txyewy!Windows.Store did not launch within its allotted time."
    Under "Windows Logs" --> "System" : I get one error that reads "The server Windows.Store did not register with DCOM within the required timeout."
    Under "Applications And Services Logs" --> "Microsoft" -->  "Windows" --> "Apps" --> "Microsoft-Windows-TWinUI/Operational" : I get one error that reads "Activation of the app winstore_cw5n1h2txyewy!Windows.Store for the
    Windows.Launch contract failed with error: The app didn't start."
    If you require any further information just let me know and I will provide as much as I can.
    Thanks

  • Print out in MB90 for GRN is not coming in English

    Dear Friends,
    While taking the print out in MB90 for GRN document, it is not coming in English.It is coming in some unreadableformat.
    In MN21 I have mentioned the language as EN.
    In the configuration of output type WE03 I have mentioned the language as EN intransaction code M706.
    A reply will be highly appreaciated.
    Regards
    Rutabhadra Panda

    hi
    check whether the printer you installed is having the proper driver.

  • HT5035 I have a credit from an Apple gift card. I want to buy itunes. When I go to check out it asks for my credit card info. How do I use the credit I have?

    How do I use the itunes credit I have on my MAC? I received a gift card and loaded it on my MAC. I want to buy itunes. When I go to check out it asks for my credit card info. How do I use the credit?

    Purchase and Redeem an iTunes Gift Card.
    How to Redeem a Code  >  http://support.apple.com/kb/ht1574

  • How to find out the reason for blocking locks?

    PB Application try to create data in ASE 12.5. With this operation, there are sql, sp, trigger involved. Most of the it is okay. With lock of sleeping or sync sleeping lock. User wait for a short time to get the result.
    but some time, there are blocking lock.
    If spid for the app is 1. then looks like this app also generate another spid, say it is 2. and 2 is blocking by 1. spid 1 holding lock!
    then all user is frozen because of spid 1 holding lock!!!  How to figure it out the reason for blocking locks?

    Thanks, Mark. Yes, sp_lock, sp_who, ... are common tool I used.
    I found out one case like:
    I have a SP which call a View for data.
    When I run this SP, suppose the sipd is 1. then it will create another spid 2 because of access view and it gone very quick. This cause spid 1 block spid 2 within a short time.
    If the are many user run the app, the app will be  frozen and everyone is waiting. Finally it release, no dead lock, but the performance is not acceptable.
    That why I have this question.

  • I recently purchased a TV season on Apple TV with my own personal Apple ID.  Is there a way to transfer that TV season to my husbands computer so that he can watch it when he's out of town for work?

    I recently purchased a TV season on Apple TV with my own personal Apple ID.  Is there a way to transfer that TV season to my husbands computer so that he can watch it when he's out of town for work?

    You can't transfer to another Apple ID. You would have to sign in under your account on the computer and then download the content.

  • I am trying to find out how to sync my outlook calendar, which is my default calendar, with my gmail calendar so that I can share it with my wife so she knows when I am going to be out of town for work.

    My primary calendar that I use on my iPhone 5 is my outlook calendar.  In the past, on other phones, I would sync this with my gmail calendar so that I could share it with my wife so that she would know when I am out of town for work.  Any suggestions for doing this or is there a better method to accomplish the same thing?

    Hello SMEvans32
    You can use iCloud to share the Calendar, that way she will always be up to date on that particular section of your work calendar. If you want to use iCloud, I would recommend backing up so you have a safe copy of your data.
    iCloud: Calendar sharing overview
    http://support.apple.com/kb/PH2689
    iCloud Setup
    http://www.apple.com/icloud/setup/
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • Request timed out while waiting for response!!

    Hi All,
    My scenario is PROXY to SOAP. I am getting below error while posting to WEBSERVICE.
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  XML Validation Inbound Channel Response
      -->
      <ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">Failed to deliver inbound WS message, code=503 and reason=Request timed out while waiting for response. at com.sonicsw.net.http.ws.WSHttpProtocolHandler$HttpInBrokerHandler.invoke(WSHttpProtocolHandler.java:833) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453) at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281) at com.sonicsw.net.http.ws.WSHttpProtocolHandler.sendToSOAPStack(WSHttpProtocolHandler.java:630) at com.sonicsw.net.http.ws.WSHttpProtocolHandler.dispatch(WSHttpProtocolHandler.java:537) at com.sonicsw.net.http.ws.WSHttpProtocolHandler.servicePost(WSHttpProtocolHandler.java:284) at com.sonicsw.net.http.ws.WSHttpProtocolHandler.service(WSHttpProtocolHandler.java:609) at com.sonicsw.net.http.HttpProtocolHandler.handle(HttpProtocolHandler.java:471) at progress.message.net.http.server.HttpConnectionHandler.handle(HttpConnectionHandler.java:170) at progress.message.net.https.server.SonicHttpsConnection.service(SonicHttpsConnection.java:156) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831) at progress.message.net.https.server.SonicHttpsServer.handleConnection(SonicHttpsServer.java:449) at progress.message.net.https.server.SonicHttpsServer.handle(SonicHttpsServer.java:364) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)</ns1:stackTrace>
    Any Idea ? Do I need to change anything in my SOAP Channel or BAsis should change the Time Parameter?
    Thanks,
    Pushkar Patel

    Hi,
    >>>>>>>Request timed out while waiting for response.
    See the below link, it might be helpful to you for timed out issue.
    [Link1|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c059d583-a551-2c10-e095-eb5d95e03747?quicklink=index&overridelayout=true]
    Regards,
    Rajesh

  • The latest iTunes wiped out my apps for my 2G iPod Touch by overwriting updates which are no longer compatible with iOS 4.2.  I tried to restore to an earlier version with no success.  Is there any way to download the older versions of apps which are comp

    The latest iTunes software wiped out my apps for my 2G iPod Touch by overwriting newer releases of the apps which are not compatible with iOS 4.2.1.  I tried to restore the iPod to an earlier version without success.  Is there any way to download older versions of my apps which are compatible with my older iPod?

    Your only way is if you have the version that was compatible on your computer such as in the recycle bin/trash or in a computer file backup. In that case delete the current version that is in your iTunes App library and replace it with the older version. Then sync.
    Also see:
    Recover Older Versions of iPhone Apps After Updating — Apple News, Tips and Reviews

  • How to find out the Tcodes for the exits

    Hi All,
    how to find out the Tcodes for the exits. i have a list of exits (customer, user, badi ). i need to find out what are the Tcode affected by this exits.
    Customer Exits: EXIT_RFEBBU10_001
                              EXIT_RFEKA400_001
                              EXIT_RFFOEXIT_100
    User-Exits:  USEREXIT_DELETE_DOCUMENT
                       USEREXIT_FIELD_MODIFICATION
                       USEREXIT_MOVE_FIELD_TO_VBAK
                       USEREXIT_PRICING_PREPARE_TKOMP
    BADI: CUSTOMER_ADD_DATA_CS
              HISTORICAL_VALUES
              MD_ADD_ELEMENTS
              MD_CHANGE_MRP_DATA
              MD_PIR_FLEX_CONS
              MD_PLDORD_POST
              ME_REQ_POSTED
              NOTIF_EVENT_SAVE
    Can anyone help on this <urgency factor removed>.
    Regards
    Ksihore
    Edited by: Suhas Saha on Feb 20, 2012 12:58 PM

    i have just started reading about all these-user exits ,customer exits etc.
    i have read somewhere that:call to customer exits are triggered by function modules exits.
    the structure of function modules are like this:
    EXIT_RFEBBU10_001
    MEANS
    Keyword EXIT followed by program name fllowed by three digits.
    and the call is like this:
    call customer function 0001.
    From above we can conclude that this customer exit must be used in program RFEBBU10.
    GOTO SE38 andenter prog name RFEBBU10.check for above function module.
    for the rest i stick to the same method for user exits and BADI that we can findthe corresponding TCODES
    using Where used lists.
    please Tell me if i m wrong!

  • How to find out the infoProvider for a given dimension table?

    Experts:
    In RSA1, I want to find out the infoProvider for a given dimension table.
    But I am not sure how to display the tables linked to a given infoProvider.
    Could you provide a way to display all tables linked to a given infoProvider?
    Thanks a lot!

    See, The dimension table starts with Dcubename1 and incremental Dcubename2 .... so on
    Ex.ZSD_C01 is your cube name
    Dim tables starts for this is /BIC/DZSD_C011 /BIC/DZSD_C012 ...
    Goto - LISTSCHEMA  - derive cube name from given dim table and enter cube name  - execute - will show you all the tables

  • How to find out the description for the given field?

    Hi All,
    How to find out the description for the given field?
    I mean ETTYP  Desription is VTEXT. This we can find in TVEPT  Table. So, How canwe find this?
    Thanks in Advance
    Sri...

    Hi  Avi,
    If i want to disply the  fields like   AUART and 'Description of AUART',
    Suppose based on my query i will take AUART from T184 table. And the description of AUART is available in TVAKT table.
    my question is if i have given T184-AUART  and how do u find out AUART Description ?(How do u know which table is having Description of AUART)?
    Thanks in Advance
    Sri...

  • URGENT: How to find out the Tables for Routines  in BW.

    Hi BW Gurus,
    How to find out the Tables for Routines  in BW.
    I have this routine id <b>45XFAEI7LKIFIRDUKQG127YWW</b> and it is in inactive state and i want to activate it.
    thanks in advance,
    points will be rewarded.
    Regards,
    Maruthi.

    Hi Maruthi,
    Check table RSUPDROUT using the routine id as input for the field CODEID. You will get the technical name of the update rule.
    Cheers,
    Praveen.

Maybe you are looking for

  • Content Server error on LINUX (HTTP error: 404 Not Found)

    Hi All, While checking the status of content sever by using the T-code CSADMIN I am getting the following error message. <b>*********************************************************** Error : - HTTP error: 404 Not Found Message no. CMS025 Diagnosis E

  • Multiple hide one 1 screen in an interactive report.

    Dear All, I wish to do Hide tab1-fld1. hide tab1-fld2. Now when the user clicks on the fld1 my program will pick up data from one table and display it and when the user clicks on fld2 my program will pick up data from 2nd table and display it. How do

  • Can I create a link in a text cell that will open another file?

    I am creating a template in Numbers that I can use to log meeting session data, such as length, date, notes of the meeting content, action items and then also have a field (cell) for links to outside documents relevant to the meeting or client.  I se

  • Clusterware Installation (Nodes not reachable....) 10G R2 on Windows

    Hello Guys, I am struck with this problem for quite a long time... I am installing Oracle Clusterware 10G R2 on windows 2000 operating system. Well i have setup my public, private and virtual IP correctly, i can ping anyone of them. During installati

  • Can you change the format of text in Track Text Edits?

    My client wants changed text to be blue double-underlined. I can apply a character tag to changed text to create the double underline, but it will not change the color to blue from the default forest green. Is there a way to customize the format of t