Question regarding Records and Collection

HI All,
I have a record/Collection say rec_t
For i in rec_t.FIRST..rec_t.Last
Loop
-- i need to have a condition with which i can find out, if in the loop i am at the last record
if rec_t.last is true --I know this is not working but do we have something to get t
END LOOP;

padders wrote:
Well at least we're all consistent :-DYeah, I saw that.. :-)
But I would have posted:
if i = rec_t.Count then ...Cannot recall ever using the +.last()+ and +.first()+ methods for normal array processing. Using
for i in 1..array.Count loop .... is a lot safer as it deals with array variables with no value (null) just fine. No need for additional code to check for a null state prior to entering the FOR loop.

Similar Messages

  • Question regarding generics and collections

    Hi,
    I am stuying the Sierra and Bates book for SCJP.
    One particular answer to a question in it is puzzling me at the moment:
    Given a method as
    public static <E extends Number> List<E> process(List<E> nums)
    A programmer wants to use this method like this:
    //INSERT DECLARATION HERE
    output = process(input)
    which pairs of delcarations could be placed at //INSERT DECLARATION HERE to allow this to compile.
    Correct answers given as :
    ArrayList<integer> input = null;
    List<Integer> output = null;
    List<Number> input = null;
    List<Number> output = null;
    List<Integer> input = null;
    List<Integer> output = null;
    My main problem is understanding what this line means:
    public static <E extends Number> List<E> process(List<E> nums)
    How do I read this? I assume <E extends Number>List<E> all relates to the return type?
    If it just said List<E> I would read it as saying the return type must be a List than can only accept objects of type E but I'm confused by the extra
    part before it.
    Hope someone can help.
    Thanks

    Have you seen generics before? E is a type variable. If the method had the simpler definition:
    <E> List<E> process(List<E> nums)This would mean that E could be replaced by any type, like you had an unbounded number of definitions:
    List<A> process(List<A> nums)
    List<B> process(List<B> nums)
    List<C> process(List<C> nums)
    ...For every possible type: A, B, C, ...
    But E has the bound "extends Number" which mean that this is like have the definitions:
    List<Number> process(List<Number> nums)
    List<Integer> process(List<Integer> nums)
    List<Long> process(List<Long> nums)
    ...For Number and every subclass of Number.

  • Question regarding roaming and data usage

    I am currently out of my main country of service, and as such I have a question regarding roaming and data usage.
    I am told that the airplane mode is sufficient from keeping the phone off from roaming, but does this apply to any background data usage for applications and such?
    If the phone is in airplane mode, are all use of the phone including wifi and application use through the wifi outside of all extra charges from roaming?

    Ann154 wrote:
    If you are getting charged to use the wifi, then it is possible.  Otherwise no
    Just to elaborate here, Ann154 is referring to access charges for wifi, which is nothing to do with Verizon, so if you are using it in a plane, hotel, an internet cafe etc that charges for Wifi rather than being free .   Verizon does not charge you (or indeed know about!) wifi usage, or any other usage that is not on their cellular network (such as using a foreign SIM for example in global phones)  So these charges, if any, will not show up on the verizon bill app.  Having it in airplane mode prevents all cellular data traffic so you should be fine

  • Question regarding MM and FI integration

    Hi Experts
    I have a question regarding MM and FI integration
    Is the transaction Key in OMJJ is same as OBYC transaction key?
    If yes, then why canu2019t I see transaction Key BSX in Movement type 101?
    Thanks

    No, they are not the same.  The movement type transaction (OMJJ) links the account key and account modifier to a specific movement types.  Transaction code (OBYC) contains the account assignments for all material document postings, whether they are movement type dependent or not.  Account key BSX is not movement type dependent.  Instead, BSX is dependent on the valuation class of the material, so it won't show in OMJJ.
    thanks,

  • **question regarding 3G and wif**.

    I have a question regarding 3G and wifi. I have #G activated as well as wifi, when I go to retrieve mail for example I get a pop up asking me if I want to connect to a wifi network…should I have wifi and 3G activated at the same time, and why am I getting the pop up…
    Thanks

    You can have them on at the same time, but they will not be used at the same time for data. The order of preference for data is WiFi > 3G > EDGE > GPRS. You're getting the pop up, most likely, because you have Settings > Wi-Fi > Ask to Join Networks set to ON. You can set that to OFF, and the iPhone will still join known (i.e. previously used) WiFi networks automatically.

  • Question regarding Dashboard and column prompt

    My question regarding Dashboard and column prompt:
    1) Dashboard prompt usually work with only for columns which are in subject area. In my report I've created some of the columns which are based on other columns. Like I've daysNumber column that is based on two other columns, as it calculates the difference of two dates. When I create dashboard prompt I can't find this column there. I need to make a prompt on this column.
    2)For one of the column I've only two values 1 and 0. When I create prompt for this column, is it possible that in drop down list It shows 'Yes' for 1 and 'No' for 0 and still filter the request??

    Hi Toony,...
    I think there was another way of doing this...
    In the dashboard prompt go to Show option > select SQL Results from dropdown.
    There you need to write your Logical SQL like...
    SELECT CASE WHEN 1=0 THEN PERIODS.YEAR ELSE difference of date functionality END FROM SubjectAreaName
    Here.. Periods.Year is the column which is already exists in repository's presentation layer..
    and difference of date functionality is the code or formula of column which you want to show in drop-down...
    Also write the CASE WHEN 1=0 THEN PERIODS.YEAR ELSE difference of date functionality END code in fx of that prompt.
    I think it helps you in doing this..
    Just check and inform me if it works...
    Thanks & Regards
    Kishore Guggilla
    Edited by: Kishore Guggilla on Oct 31, 2008 9:35 AM

  • Question regarding homehub and Open reach router -...

    Hi all,
      I had infinity installed earlier this month and am happy with it so far. I do have a few questions regarding the service and hardware though.
      I run both my BT openreach router and BT Home hub from the same power socket. The problem is, if I turn the plug on so both the Homehub and Openreach Router start up at the same time, the home hub will never get an Internet connection from the router. To solve this I have to turn the BT home hub on first and leave it for a minute, then start the router up and it all works fine. I'm just curious if this is the norm or do I have some faulty hardware?
      Secondly, I appreciate the estimated speed BT quote isn't always accurate, I was quoted 49mbits down but received 38mbits down - Which I was happy with. Recently though it has dropped to 30. I am worried this might continue to drop over time. and as of present I am 20mbits down on the estimate . For the record 30mbits is actually fine and probably more than I would ever need. If I could boost it some how though I would be interested to hear from you.
    Thanks, .

    Just a clarification: the two boxes are the HomeHub (router, black) and the modem (white).  The HomeHub has its own power switch, the modem doesn't.
    There is something wrong if the HomeHub needs to be turned on before the modem.  As others have said, in general best to leave the modem on all the time.  You should be able to connect them up in any order, or together.  (For example, I recently tripped the mains cutout, and when I restored power the modem and HomeHub went on together and everything was ok).
    Check if the router can connect/disconnect from the broadband using the web interface.  Leaving the modem and HomeHub on all the time, go to http://192.168.1.254/ on a browser on a connected computer, and see whether the Connect/Disconnect button works.

  • Question Regarding MIDI and Sample Accuracy

    Hi,
    I have 2 questions regarding MIDI.
    1. MIDI is moved by ticks. In the arrange window however, you can move a region by samples. When doing this, you can move within values of the ticks (which you can see on your position box that pops up) Now, will this MIDI note actually be played back at that specific sample point, or will it round the event to the closest tick? (example, if I have a MIDI note directly on 1.1.1.1, and I move the REGION in the arrange... will that MIDI note now fall on the sample that I have moved the region to, or will it be rounded to the closest tick?)
    2. When making a midi template from an audio region, will the MIDI information land exactly on the sample of the transient, or will it be rounded to the closest tick?
    I've looked through the manual, and couldn't find any specific answer to these questions.
    Thanks!
    Message was edited by: Matthew Usnick

    Ok, I've done some experimenting, and here are my results.
    I believe those numbers ARE samples. I came to this conclusion by counting (for some reason it starts on 11) and cutting a region to be 33 samples long (so, minus 11, is 22 actual samples). I then went to the Audio Bin window, and chose to view region length as samples. And there it said it: 22 samples. So, you can in fact move MIDI regions by samples!
    Second, I wanted to see if the MIDI notes in the region itself would be quantized to the nearest tick. I cut a piece of audio, so it had a 1 sample attack (zoomed in asa far as I could in the sample editor, selected the smallest portion, and faded in, and made the start point, the region start position). I saved the region as a new audio file, and loaded it up in the exs sampler.
    I then made a MIDI region, with and triggered the sample on beat 1 (quantized, on the money). I then went into the arrange window, made a fixed cycle length, and bounced the audio. I then moved the MIDI region by one sample to the right. I did this 22 times (which is the number of samples in a tick, at 120, apparently). After bouncing all of these (cycle position remained fixed, only the MIDI region was moving) I imported all the audio into the arrange on new tracks, and YES!!! The sample start was cascaded by a sample each time!
    SO.
    Not only can you move MIDI regions by sample, but the positions are NOT quantized to Logics ticks!
    This is very good news, and glad I worked this out!
    (if anyone thinks this sounds wrong, please correct me, but I'm pretty sure I proved it, in my test)
    Message was edited by: Matthew Usnick

  • Question regarding IWDTree and context Value Node naming

    Hi,
    I have a question regarding the IWDTree / IWDTreeNodeType components.
    I have a context looking like this:
    Context
      + ResponseNode
        + PersonNode (1..1)
          + PersonAddressNode                    (empty node, placeholder)
          | + AdresNode (0..n)
          + PersonChildNode                      (empty node, placeholder)
          | + PersonNode (0..n)
          |   + PersonAddressNode                (empty node, placeholder)
          |     + AddressNode (0..n)
          + PersonParentsNode                    (empty node, placeholder)
            + PersonNode (0..n)
              + PersonAddressNode                (empty node, placeholder)
                + AddressNode (0..n)
    The context represents a person, a person's address, and a person's children and parents with their respective addresses.
    As a result, on different branches, a PersonNode and AddressNode can appear.
    And for some strange reason, all PersonNodes and AddressNodes link to the same ResponseNode.PersonNode.PersonParentsNode.PersonNode and ResponseNode.PersonNode.PersonParentsNode.PersonNode.PersonAddressNode.AddressNode respectively, irregardless of their branch...
    Is it illegal to have multiple PersonNode and AddressNode node names, and should they be named uniquely?

    Generally, node names need to be unique inside the context, attributes in different nodes can have same names. I wonder if the context structure you described will result in code without compile errors.
    The WD Tree can only be used with recursive context nodes or with a hierarchy of non-singleton child nodes.
    Can you give an example how your tree should look like at runtime?

  • Few questions regarding Training and event management

    Dear All,
    Can you please help me with the following queries regarding Training and Event Management:
    1. How to freeze a completed business event so that no changes to its record (like delete/update attendee details or event detail) is possible?
    2. How to get feedback from attendee/faculty with a predefined format with rating (1-4 scale)
    3. How to maintain department and category wise training man/hrs or training man/days?
    Any help will be appreciated.
    Regards,
    Toa

    Hi Toa,
    1. Run report RHHISTO0 via SA38. Once the business event is flagged as "historical" no further changes can be done.
    3. SM30 - T77S0 - Make the following swtiches active:
    SEMIN AINST
    SEMIN APART
    Then when events are followed up, these training data is recorded to employee 2002 infotype. You can report on it via PT90 (for department-based selection use "Further selections")
    Regards,
    Dilek

  • Help: Using Record and Collection Methods

    I have created a record and I have to loop for as many records in the "RECORD". However if I attempt using any of the Collection Methods, I get the following error:
    ERROR at line 1:
    ORA-06550: line 41, column 14:
    PLS-00302: component 'EXISTS' must be declared
    ORA-06550: line 41, column 4:
    PL/SQL: Statement ignored
    ORA-06550: line 47, column 26:
    PLS-00302: component 'COUNT' must be declared
    ORA-06550: line 47, column 7:
    PL/SQL: Statement ignored
    Here is the SQL I am trying to execute:
    DECLARE
    TYPE Emp_Rec is RECORD (
    Emp_Id Emp.Emp_no%TYPE
    , Name Emp.Ename%TYPE
    ERec Emp_Rec;
    Cursor C_Emp IS
    SELECT
    Emp_No, Ename
    From Emp;
    begin
    OPEN C_Emp;
    LOOP
    FETCH C_Emp INTO Erec;
    EXIT WHEN C_Emp%NOTFOUND;
    END LOOP;
    IF Erec.Exists(1) THEN
    dbms_output.Put_line('exists' );
    else
    dbms_output.Put_line('does not exists');
    end if;
    CLOSE C_Emp;
    FOR I IN 1..ERec.COUNT
    LOOP
    dbms_Output.Put_Line( 'Row: ' || To_Char(I) || '; Emp: ' || ERec(i).Name) ;
    END LOOP;
    end;
    Can anyone help, please?
    Thanking you in advance,

    You only defined a Record and not a collection, therefore you cannot use .EXISTS
    This is how you would use record, collection and exists together
    DECLARE
    TYPE Emp_Rec is RECORD
             (Emp_Id Emp.Empno%TYPE,
              EName Emp.Ename%TYPE );
    TYPE Emp_tab is table of emp_rec index by binary_integer;
    ERec Emp_tab;
    Idx  INTEGER;
    Cursor C_Emp IS
         SELECT EmpNo, Ename    From Emp;
    begin
    IDX := 1;
    OPEN C_Emp;
    LOOP
           FETCH C_Emp INTO Erec(IDX);
                     EXIT WHEN C_Emp%NOTFOUND;
           IDX := IDX + 1;
    END LOOP;
    IF Erec.Exists(1) THEN
           dbms_output.Put_line('exists' );
    else
           dbms_output.Put_line('does not exists');
    end if;
    CLOSE C_Emp;
    FOR I IN 1..ERec.COUNT  LOOP
            dbms_Output.Put_Line( 'Row: ' || To_Char(I) || '; Emp: ' || ERec(i).eName) ;
    END LOOP;
    end;I hope you realize that this is only an example of how to use RECORD, COLLECTIONS and Collection Methods (.EXISTS, .COUNT)
    and not the best way to display the contents of a table.

  • Question regarding battery and warranty

    Hi all! I have a quick question about how and if my warranty applies to my battery. After about a year and a half of ownership (I have the three-year extended warranty), my battery has gone completely down the toilet. It wasn't a problem before, but this year I have to lug my T61p around a lot for lab work. My battery is now rated at... 39.75Wh when it shipped at 84.24Wh. This is a pretty drastic difference. In any case, I don't think that this is covered by warranty, but figured that I'd ask before I drop $180 on a new battery (ouch). And, speaking of, if my suspicions are correct, does anybody know where I might find a 9-cell battery for the T61p? All I'm seeing on Lenovo's website is the one for the N100... which doesn't... match very well. Yaknow.
    Thanks a lot!
    ThinkPad T61p [June 2008]: 2.5Ghz Penryn Core 2 Duo, 4GB DDR2 RAM, NVidia Quadro FX 570m 256MB, 160GB 7200RPM Fujitsu HDD, 1920x1200 WUXGA Matte LCD, Windows 7 RC1

    Is either of these appropriate? I'm wary of the one on Amazon, as there are other (off-brand) batteries that are advertised as being Lenovo ones (though those generally sell for  a lower price). The other one just looks like I'll have to call up to buy it.
    http://www.amazon.com/Lenovo-43R9255-ThinkPad-Notebook-Battery/dp/B001DX9EKA
    http://affordablepcsupply.com/products/IBM/REF/42T4511.html
    Thoughts?
    ThinkPad T61p [June 2008]: 2.5Ghz Penryn Core 2 Duo, 4GB DDR2 RAM, NVidia Quadro FX 570m 256MB, 160GB 7200RPM Fujitsu HDD, 1920x1200 WUXGA Matte LCD, Windows 7 RC1

  • Question regarding selectOneMenu and PROCESS_VALIDATIONS(3) phase

    Hi im a bit lost regarding selectOneMenu and how validation phase all works together.
    The thing is that i have a simple selectOneMenu
    <h:form id="SearchForm">                                                  
         <h:panelGrid columns="3"  border="0">
              <h:outputLabel id="caseTypeText" value="#{msg.searchCaseCaseType}" for="caseType" />                         
              <h:selectOneMenu id="caseType" value="#{searchCaseBean.caseType}" style="width: 200px;" binding="#{searchCaseBean.caseTypeSelect}">     
                   <f:selectItem itemValue="" itemLabel="#{msg.CommonTextAll}" />                                             
                   <f:selectItems value="#{searchCaseBean.caseTypes}"  />                              
              </h:selectOneMenu>
              <h:message for="caseType" styleClass="errorMessage" />
              <h:panelGroup />
              <h:panelGroup />
              <h:commandButton action="#{searchCaseBean.actionSearch}" value="#{msg.buttonSearch}" />
         </h:panelGrid>
    </h:form>Now when i hit submit button i can see that the bean method searchCaseBean.caseTypes (used in the <f:selectItems> tag) is executed in the PROCESS_VALIDATIONS(3) phase. How come? I dont whant this method to be executed in phase 3, only in phase 6.
    If i add the this in the method if (FacesContext.getCurrentInstance().getRenderResponse())
    public List<SelectItem> getStepStatuses(){
         List<CaseStep> caseSteps = new ArrayList<CaseStep>();
         if (FacesContext.getCurrentInstance().getRenderResponse()) {
              caseSteps = getCaseService().getCaseStep(value);     
         List<SelectItem> selectItems = new ArrayList<SelectItem>(caseSteps.size());
         for(int i=0; i < caseSteps.size(); i++){
              CaseStep step = caseSteps.get(i);               
              String stepStatus = step.getStatus() + "_" + step.getSubStatus();           
              selectItems.add(new SelectItem(stepStatus, step.getShortName()));
         return selectItems;
    } Now i get a validation error (javax.faces.component.UISelectOne.INVALID) for the select field and only phase1, phase2, phase 3 and phase 6 is executed.
    Im lost?

    I see. Many thanxs BalusC. Im using your blog very often, and its very helpfull for me.
    I changed now to use the constructor load method instead. But know im getting problem of calling my service layer (Spring service bean). Its seems they havent been init when jsf bean is calling its constructor.
    Can i init the spring service bean from the faces-config file?
    JSF Bean
        public SearchCaseBean() {
              super();
                    //caseService need to be init
              if(getCaseService() == null){
                   setCaseService((CaseService)getWebApplicationContextBean("caseService"));
              fillCaseTypeSelectItems();
              fillCaseStatusSelectItems();
    .....faces-config
    <managed-bean>
              <managed-bean-name>searchCaseBean</managed-bean-name>
              <managed-bean-class>portal.web.SearchCaseBean</managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>          
              <managed-property>
                   <property-name>caseService</property-name>
                   <value>#{caseService}</value>
              </managed-property>
         </managed-bean>

  • [GE70]A few question regarding mSATA and BIOS

    I just recently equiped my MSI GE70 0ND with a mSATA SSD Hard Drive, the ADATA XPG SX300 to be precise. Mainly because I do a lot of video recording/editing and a very fast Hard Drive was required for higher bitrate recording and apparently my SSD is supposed to have 505 Mb/s write and 550 Mb/s read but I only get 180 write and 450 read. Tried to check my BIOS (which is stock btw, haven't updated it yet) for a possible answer but I have little to no parameters at all. Also checked the manual to see at what my mSATA slot was capped but no valuable info are written in there. Any info on why is my SSD is running at such a slow speed?

    My CrystalDiskMark results were :
    CrystalDiskMark 3.0.2 x64 (C) 2007-2013 hiyohiyo
                               Crystal Dew World :
    * MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s]
               Sequential Read :   453.929 MB/s
              Sequential Write :   152.232 MB/s
             Random Read 512KB :   404.035 MB/s
            Random Write 512KB :   150.712 MB/s
        Random Read 4KB (QD=1) :    27.061 MB/s [  6606.7 IOPS]
       Random Write 4KB (QD=1) :    77.075 MB/s [ 18817.3 IOPS]
       Random Read 4KB (QD=32) :   120.845 MB/s [ 29503.2 IOPS]
      Random Write 4KB (QD=32) :   148.627 MB/s [ 36285.9 IOPS]
      Test : 1000 MB [F: 21.4% (25.5/119.1 GB)] (x5)
      Date : 2013/04/22 10:51:59
        OS : Windows 7 Ultimate Edition SP1 [6.1 Build 7601] (x64)
    Results with BlackMagicDesign Disk Speed Test (Recording Device Software):

  • Question regarding sequences and fragmented data

    Hi all,
    I plan to implement two identical database schemas on two different oracle database servers. The two databases will then be linked via a Database Link and a View will be used to show the data from both db's using 1 sql statement.
    My question is this:
    If 5 records are inserted into the table on the first database and then 10 records are inserted into the matching table on the second database, how would the sequence for the table in the first database know that the next value should be 16 and not 6.
    I hope this makes sense, any questions just ask.
    Thanks,
    Martin

    Ok, I am not sure if I fully undserstand the question but let's give it a go. In the first place a sequence is stored in the data dictionary of a database. Te fact that you have two servers (and two databases : is that correct ?) means that you have two sequences also. The sequence is local to each db.
    If you want the tables to be aware of each other so that the next record takes into account also the records in the other db you may have to manually generate the sequence. I don't know if you can share the sequence between two dbs but let's see if anyone else does.
    Regards

Maybe you are looking for

  • Email receiver qpac-SAX Parsing Error

    Hi, Iam working on a project which needs to receive email from an external person and the workflow will continue from that point. >>I have put a email receiver qpac to accomplish the above task. I use the sender's(from) email address as a filter for

  • Oracle Text with Hibernate & Spring.

    Hi, I am looking for some code samples of Oracle text based search using Hibernate & Spring. Can the three of these technologies be used in a J2EE application. --Irshad.                                                                                 

  • Reports Services getting down when running reports using in process server

    Hi, I have applied patchset 3829014 (Containers for J2EE: Patchset PLACE HOLDER FOR OC4J STANDALONE RELEASE 9.0.4.1) to fix the Bug No. 2670561 CPU usage becomes 100% when there is a new HTTP connection request in the queue. Now after reploying the *

  • Sql syntax inside java

    I am having a terrible time with the sql syntax INSIDE a java program. Is there somewhere online that has this information (in easy english!) For example I am trying to insert information in an access table. This is my sql query that works in access.

  • I am unable to compose new emails in Gmail while in Firefox. Works fine on IE.

    I sign into Gmail and am able to read new emails and go into my folders, but when I try to compose a new email it just says loading at the top and never comes up. It has to be Firefox because it works fine in IE. I do not want to use IE anymore due t