Math.atan2 Code Explanation Help

Hello guys
This is a piece of code from AS3 Making Things Move
I tried to understand how this code works, but failed
Please explain this code
Thanks in advance

There are two fetches to deal with the no records found situation.
the basic idea is
fetch
while found loop
... do some processing ...
fetch
end loop
If the first fetch doesn't result in a record the loop is not being executed,inside the loop the %notfound situation doesn't have to be trapped anymore.
This is why the if inside the loop is redundant.
Other than that this code is an example of slow by slow processing, introducing 3GL techniques, processing records, instead of SETS.
The person responsible for this code ought to be fired.
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • Code explanation help

    Declare
    CURSOR curEMP is
         Select Empno,Fname,Lname,Sal From Emp;
    varEmpno Emp.Empno%type;
    varFname Emp.Fname%type;
    varLname Emp.Lname%type;
    varSal   Emp.Sal%type;
    varUname Emp.Uname%type;
    varpwd   Emp.pwd%type;
    Begin
    Open curEMP;
    If curEmp%ISOPEN Then
    Fetch curEMP
      INTO varEmp,varfname,varLname,varSal;
    While curEMP%FOUND
    LOOP
      Exit When curEMp%NOTFOUND;
      IF curEMp%FOUND THEN
      varUname:=SUBSTR(varFname,-2,2);
      varPwd:=Substr(varLname,2,2);
    Update EMP set  Uname=varUname,pwd=varPwd where Empno=varempno;
    Fetch curEMP INTO varEMpNo,varFname,varLname,varSal;
    End IF;
    End Loop;
    commit;
    Else
    Dbms_Output.Put_line('No recd found');
    End IF;
    Close curEmp;
    End;
    Could you help me why do "fetch statements" in this code used  twice.
    Thanks & Regard
    pallis                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    There are two fetches to deal with the no records found situation.
    the basic idea is
    fetch
    while found loop
    ... do some processing ...
    fetch
    end loop
    If the first fetch doesn't result in a record the loop is not being executed,inside the loop the %notfound situation doesn't have to be trapped anymore.
    This is why the if inside the loop is redundant.
    Other than that this code is an example of slow by slow processing, introducing 3GL techniques, processing records, instead of SETS.
    The person responsible for this code ought to be fired.
    Sybrand Bakker
    Senior Oracle DBA

  • Improvements to status code explanations requested

    There are some status code explanations in the 9.0.4.x
    CSDK that could probably use some refinement to be more
    useful to application developers.
    Two examples:
    1."CAPI_STAT_LIBRARY_INTERNAL_DATA = There was a corruption of data in the library."
    This might not always indicate that data in the
    calendar store is corrupted - which is the way we
    initially interpreted this error - but rather that
    data provided to be stored is in some way invalid.
    Example: calling storeEvents() with an
    iCalendar whose DTSTART property was after
    DTEND (i.e. start date after ending date),
    returned the status "CAPI_STAT_LIBRARY_INTERNAL_DATA".
    Example: calling Session.storeEvents() with an iCalendar
    whose start and end dates are in a non-UTC TZ in a format
    similar to "DTSTART;TZID=US/Pacific:20040517T101500",
    that method returned "CAPI_STAT_LIBRARY_INTERNAL_DATA".
    Fix: include an appropriate VTIMEZONE component
    for that timezone in the submitted iCalendar.
    2. Any of the explanations below, which begin with
    "Information about ..."
    These often seem to indicate that a data format error
    has occurred, and that the application developer
    needs to modify the format of the data to have it
    accepted. The "Information about ..." explanation
    doesn't adequately convey that.
    Examples:
    When calling storeEvents() with an iCalendar with a
    missing CR/LF between VEVENT components, that method
    returned the status "CAPI_STAT_DATA_ICAL".
    Some of the relevant status explanations include:
    CAPI_STAT_DATA_COOKIE = Information about the supplied cookie.
    CAPI_STAT_DATA_DATE = Information about a date.
    CAPI_STAT_DATA_EMAIL = Information about email.
    CAPI_STAT_DATA_ENCODING = Information about the encoding of supplied data.
    CAPI_STAT_DATA_HOSTNAME = Information about a hostname.
    CAPI_STAT_DATA_ICAL = Information about iCalendar data.
    CAPI_STAT_DATA_MIME = Information about MIME data.
    CAPI_STAT_DATA_UID = Information about a UID.
    CAPI_STAT_DATA_USERID = Information about a userID.
    In contrast, explanations like the following are much
    clearer:
    CAPI_STAT_DATA_USERID_FORMAT = The format of the UserId string was wrong.
    CAPI_STAT_DATA_USERID_ID = There was a problem with the Id part of the UserId string.
    Any improvements such as these in the status code
    explanations returned would be welcome, and might help
    save debugging time for those new to the CSDK.

    Thanks Aaron,
    Some notable improvements are coming in the next version of the Oracle Calendar application developer's guide, and your comments will be added for consideration.
    Best regards,
    Product Management

  • Program for t-codes -kindly help

    dear friends,
    i am in need to know abap programs to the t-codes. for example for creation of sales order (va01), there is a program called SAPMV45A. similar to that i want programs for t-codes in mm.
    creation of material master- mm01/mm02/mm03
    vendor master  xk01/xk02/xk03
    info record me01/me02/me03
    RFQ   ME41/ME47/ME49
    purchase request me51n/me52n/me53n
    po       me21n/me22n/me23n
    GR   MIGO
    INVOICE VERIFICATION :- MIRO
    is there any other method to see the program for the corresponding t-codes.
    kindly help.how to see the programs in sap
    regards,
    flemmings

    Hi,
    If u want to see the program enter the t code in command field and then go to system (on top) and then status u will get details of program.
    Thanks
    suresh

  • I have a compilation problem with my mini iPod that is preventing my volume from increasing. I can't get the compilation code, please help me

    MY mini iPod version number1.1.3 pc robs iPod ,4GB is having volume limit problem ,the volume is very low compare to how it was playing before I mistakenly touch the combination code. I have forgotten the combination code, please help me out.. I have tried to reset settings but it wouldn't work.

    i can get the combination code please

  • File missing (file\BCD error code 0Xc0000034 help need for work!

    file missing (file\BCD  error code 0Xc0000034 help need for work!    what can i do?
    have an p 2000 notebook pc

     Hi bobkunkle, welcome to the HP Forums. I understand you cannot boot passed the error you are receiving.
    What is the model or product number of your notebook? What version of Windows is installed?
    Guide to finding your product number
    Which Windows operating system am I running?
    TwoPointOh
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom to say “Thanks” for helping!

  • My macbook is blocked by pin code, please help, I dont know what to do!

    My macbook is blocked by pin code, please help, I dont know what to do!

    When you enter iTunes on the PC and the iPod icon pops up, right click on it and select "Options". Then click on the Music tab. Once you're in the Music tab check the box that says "Enable Disc Use". This means that you've just turned your iPod into a portable hard drive. Click "Ok" and move your iPod from the PC to the Mac. From there, your iPod should show up on the Mac's desktop right under the Hard Drive icon. Click "File" at the top of the screen and select "Add to Library". Find the iPod hard drive in the selection screen and choose the music folder that's on it. Then just click Ok and all your music will be downloaded. That should do the trick, but you might want to do a Google search on the subject to get a second opinion. Best wishes!

  • I don't know how to use the canlendars function and the notes are kind of messy code,anyone help me

    i don't know how to use the canlendars function and the notes are kind of messy code,anyone help me

    Step by step:
    1. On your main vi Front Panel, create your boolean indicator.
    2. On the block diagram, right click the new boolean indicator and select Create - Reference.
    3. On sub-vi front panel, create boolean indicator (or use one that is already created).
    4. On sub-vi front panel, create a reference (Controls Palette - Refnum - Control Refnum).
    5. Right click on the newly created Refnum and select Select Vi Server Class - Generic - GObject - Control - Boolean. The refnum label changes to BoolRefnum.
    6. On sub-vi block diagram, create Property Node (Functions - Application Control - Property Node). Find the BoolRefnum and move it close to the new Property Node.
    7. Wire the BoolRefnum to the reference input of the property node.
    8.
    Right click on the property node and select Change to All Write.
    9. Move mouse to point to Visible inside property node box, left click and select Value.
    10. Wire the boolean indicator from step 3 to the Value input of the property node.
    11. On sub-vi front panel, right click on icon and select Show Connector.
    12. Click on empty connector spot then click on the new BoolRefnum. Save your sub-vi.
    13. On main vi block diagram, connect refernece created in step 2 to the new connector terminal of sub-vi.
    14. Save and run.
    Here are the modified vi's.
    - tbob
    Inventor of the WORM Global
    Attachments:
    Pass_a_Reference.vi ‏20 KB
    GL_Flicker_mod.vi ‏83 KB

  • Window freezes when Product category selected via match-code (search help)

    Hello Experts,
    I am using SRM 7.0 Extended Classic Scenario.
    I maintained a product category hierarchy in the SRM environment.
    I maintained the GL Accounts related, the tax determination, the source system etc.
    I did all this customizing in a Development environment where everything was working fine.
    Now I just transported all this to a Quality environment.
    And in the Quality I am facing the following issue :
    If I select a product category via the match-code (search help), after the category is selected, the window freezes.
    I have to shut it down manually using the Windows Close button.
    However, when I type the category number, everything works fine.
    Do you have any idea what could be causing this issue, and how to fix it ?
    Thanks in advance,
    Sofiane

    Hello,
    We have the exact same issue in SRM 7.0 Extented Classic Scenario. This was working fine before we installed the latest support package 11. Which support package do you have?
    The same problem occurs with every drop down menu (search help) in EBP. For example when creating a new shopping cart, if I try to add approver, the same thing happens. After clicking 'Approval Process: Display / Edit Agents' > 'Add Approver', the window freezes. Same thing happens with IE8 and Firefox 3.6.13. Could you also try the same?
    Could it be a new bug in SP11?
    Thanks and best regards,
    Matti Hokkanen
    Edited by: Matti Hokkanen on Nov 4, 2011 10:30 AM
    Edited by: Matti Hokkanen on Nov 4, 2011 10:43 AM

  • How to explicitely write PLSQL code for "Help - Display Error"? [SOLVED]

    I'm using menu DEFAULT&SMARTBAR and I'd like to write command in PLSQL code for "Help - Display Error" to display error. Has anyone any idea how to do this? I can not find syntaks in form help for this.
    Message was edited by:
    marussig

    Display_Error;

  • I have tried everything to correct Error Code 16  Help!

    I have tried everything to correct Error Code 16  Help!

    Hi leolion,
    You might want to refer the KB Doc: http://helpx.adobe.com/x-productkb/policy-pricing/configuration-error-cs5.html
    Regards,
    Rave

  • HT201304 ello my little brother has developed lock my iPhone and I could not see the unlocking code Please help and thank you

    Hello
    ello my little brother has developed lock my iPhone and I could not see the unlocking code Please help and thank you
    edited by host

    Hi Omar_a983,
    If you are having an issue with the passcode on your iPhone, you may find the following article helpful:
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    Regards,
    - Brenden

  • I can't find my redemption code, please help!

    I can't find my redemption code, please help!

    You have purchased Creative Cloud Photography plan on Sept. 26, 2014.
    If the CC is asking for serial number then please follow the steps in http://helpx.adobe.com/creative-cloud/kb/ccm-prompt-serial-number.html
    To download the CC purchased you need to install &activate it. Please refer to
    http://helpx.adobe.com/creative-cloud/help/install-apps.html
    Download and Installation Help
    Hope it resolves your issue.
    Regards
    Rajshree

  • BADI FOR WITHHOLDING TAX CODES SEARCH HELP

    HI,
    Is there any BADI for witholding tax code search help. i want to make some changes in it.
    field: WITHT
    Pls help.

    Please find the following BADIs which are called during the transaction FB60.
    BADI_FDCB_SUBBAS01
    BADI_FDCB_SUBBAS02
    PPA_CUST_BADI
    BADI_FDCB_SUBBAS03
    BADI_FDCB_SUBBAS04
    BADI_FDCB_SUBBAS05
    What release are you on? I have the same issue for 1042s, but here are some helpful links for turning on the extended withholding tax:
    http://help.sap.com/saphelp_erp2005/helpdata/en/e5/0780914acd11d182b90000e829fbfe/frameset.htm
    Defining withholding tax codes:
    http://help.sap.com/saphelp_erp2005/helpdata/en/e5/0780914acd11d182b90000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/e5/0780914acd11d182b90000e829fbfe/frameset.htm
    Reward points if found helpful....
    Cheers,
    Chandra Sekhar.

  • Am having problems buying app from App Store ... It's not recognizing my credit card security code... It's says " incorrect code" any help pls wot do I do

    Am having problems buying app from App Store ... It's not recognizing my credit card security code... It's says " incorrect code" any help pls wot do I do

    This can be caused by a few things.
          Make sure the billing card address, the one on the statement is the exact
                 same as in iTunes.
          Note even the zip code being off can cause this.
           Try a different CC
          and the way the always works
              An iTunes GC.

Maybe you are looking for

  • MAC SLOW WHEN PLAYING GAMES

    Hi if anyone can help me with the problem I have I will jump for joy. I have a Mac desk top 27 inch screen that is 4 months old.  It has Mountain Lion installed.  The problem I am having is when I first log into a particular game my mac is extremely

  • Document type controll with respect to plant

    Hi, I have created two document type NB & ZB for purchase requisition , my requirement is whenever i select plant 1 in item level it should select N document type and for plant 2 ZB doc type, if  end user select wrong document type for plant for ex:

  • Homeshared songs won't sync!!

    Hi, so recently a member of my family bought an album on iTunes. I imported it to my iTunes library using Homeshare and tried to get it onto my iPad Mini... to no avail.. Does anyone know how to fix this? I've done this many times before with no issu

  • There is no button to resolve my limitation

    Hello. I got email asking me to provide more information about transactions, but I cant solve it. I had this request on my other account, and there was a button, i clicked it and I solved it. In this account there is no button at all. I have no idea

  • How we can arange the personnal actions in PA40 ?

    Hi SAP HR Experts . Plz Explain me How we arrange the personnal actions in PA40 ? can we change thier order or delete perticular action ? or it is managed through some config settings ???? Kind Regards : rajneesh