How to insert element in a Queue as the nth item

Hi Gurus,
Please can anyone help with a method or algorithm that inserts item into the queue as the nth element (counting from front, which is element 1)?
I have already spent a week on it...i can't seem to knock it out.
Thanks in advance.

If the array has enough space
void insertIntoArray(int n, int value){
     int temp, temp2;
     temp = arrayQueue[n];
     arrayQueue[n] = value;
     for(; n < arrayQueue.lenght; n++){
          temp2 = arrayQueue[n+1];
          arrayQueue[n] = temp;
          temp = temp2;
}If not
void insertIntoArray(int n, int value){
     int[] arrayQueue2 = new int[arrayQueue.length];
     for(int i = 0; i < n; i++){
          arrayQueue2[i] = arrayQueue;
     arrayQueue2[n] = value;
     for(++n; n < arrayQueue2.length; n++){
          arrayQueue2[n] = arrayQueue[n+1];
arrayQueue = arrayQueue2;

Similar Messages

  • *Urgent*How to insert data from MS SQL to the table that create at the adobe form?

    Hi,
    I'm using Adobe life cycle designer 8 to do my interactive form. I would like to ask how to insert data from MS SQL to the table that i have created in my adobe interactive form?
    I really need the information ASAP as i need to hand in my project by next week... i really appreciate any one who reply this post.
    Thanks

    Tou need to do a couple of things
    1. On the Essbase server, set up an odbc system connection to your MySQL database
    2. In the load rule , go to the file menu and select open SQL data source and in the data source put in your SQL statement . A couple of hints. Where it says Select, don't put in the word select and where it say from don't put in from. The system adds them for you. The easiest way ti enter a SQL statement is to do it all in the select area So if your SQL would normanlly say select * from mytable just enter the code as * from mytable in the select area
    The click ol/retrieve and enter in your connection info. Itshould bring data back into the load rule. Save the load rule and use it

  • Is it possible to enqueue multiple elements in a queue at the same time

    I want to know that is it possible to add mutiple elements in a queue at the same time, i am able to do one element at a time if i want iw ill be using for loop, but is it possible without for loop????
    nilesh

    You can't, but if you may redefine the  queue datatype as an array.
    Paolo
    LV 7.0, 7.1, 8.0.1, 2011

  • Inserting a new extension field in the line item details page

    Hi!
    Is it possible to insert an extension field/collection in the line item details page of the master agreement? I have tried supplying several Field ID found on that page on the DISPLAY AFTER field of the extension, but nothing works - the new field still gets displayed at the header page.
    Thanks in advance.

    Hi,
    Line Item is an independent class. You cant add an extension to Line Item through Master Agreement. This is the reason why the extension you add appears on the header tab of Master Agreement.
    When I go to create an extension definition, I don't find Line Item in the drop down of Extended Class Name. So, my guess would be that we cannot create an extension definition for Line Items.
    Let us know if you, or anybody, has a way to achieve it.
    Thanks
    Devesh

  • How to insert elements into an array after each iteration of a for loop

    I am new to labview and working on an application where I am supposed to store an element into an array (without overwriting) after each iteration in a for loop. I have tried using Build Array Function keeping the indicator outside the for loop and played with indexing but didn't work. Please suggest me an idea how to do it.
    Thanks
    Solved!
    Go to Solution.

    Thank you for your suggestion.Here is my actual application attached . In the first image, a difference in time is evaluated and an enum const of insert into array is passed to the shift register where it takes to Insert element into array phase (Second image). I need to enter the time difference into an array after every loop iteration. Please have a look and could you let me know where I am mislead.
    Attachments:
    Image 1.JPG ‏88 KB
    Image 2.JPG ‏71 KB

  • How to insert into two differents tables at the same time

    Hi
    I'm newer using JDev, (version 3.1.1.2 cause the OAS seems to support just the JSP 1.0)
    and I want to insert into two differents tables at the same time using one view.
    How can I do that ?
    TIA
    Edgar

    Oracle 8i supports 'INSTEAD OF' triggers on object views so you could use a process similar to the following:
    1. Create an object view that joins your two tables. 'CREATE OR REPLACE VIEW test AS SELECT d.deptno, d.deptname, e.empname FROM DEPT d, EMP E'.
    2. Create an INSTEAD OF trigger on the view.
    3. Put code in the trigger that looks at the :NEW values being processed and determines which columns should be used to INSERT or UPDATE for each table. Crude pseudo-code might be:
    IF :NEW.deptno NOT IN (SELECT deptno FROM DEPT) THEN
    INSERT INTO dept VALUES(:NEW.deptno, :NEW.deptname);
    INSERT INTO emp VALUES (:NEW.deptno, :NEW.empname);
    ELSE
    IF :NEW.deptname IS NOT NULL THEN
    UPDATE dept SET deptname = :NEW.deptname
    WHERE deptno = :NEW.deptno;
    END IF;
    IF :NEW.empname IS NOT NULL THEN
    UPDATE emp SET empname = :NEW.empname
    WHERE deptno = :NEW.deptno;
    Try something along those lines.
    null

  • How to insert system date in Session of the page

    Greetings,
    I am stuck at one thing and need guidline.
    I created date parameter "From Date" - "to Date" . Item Type Date Picker.
    - Set Default Value : Sysdate;
    - Default Value Type : PL/SQL Expression.
    When i run the page it shows current date , but when i see session state report of that page there Item Value is Empty and Status is also Empty.
    The result in impact is that i created linked on data that displays, That link doesnt Work because of Item Value is Empty and Status is also Empty.
    Kindly guide how i inserted value in Item Value and in status.
    Pls

    Hi,
    >
    I am stuck at one thing and need guidline.
    I created date parameter "From Date" - "to Date" . Item Type Date Picker.
    - Set Default Value : Sysdate;
    - Default Value Type : PL/SQL Expression.
    When i run the page it shows current date , but when i see session state report of that page there Item Value is Empty and Status is also Empty.
    The result in impact is that i created linked on data that displays, That link doesnt Work because of Item Value is Empty and Status is also Empty.
    Kindly guide how i inserted value in Item Value and in status.
    >
    When you set the value of an item in the source, the value is set in the HTML DOM not the session state.
    To set value in session state use Computation or Process.
    Cheers,

  • How to insert single colon xml text in the xml table

    Dear Sir,
    how to insert special characters like single colon text example (don't) xml text in to the xml table
    please see the following example its giving me error quoted string is not ended properly
    SQL> insert into ftr_ctl values (1,
    2 xmltype('<po:root xmlns:po="http://www.oracle.com/FC.xsd"
    3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    4 xsi:schemaLocation="http://www.oracle.com/FC.xsd
    5 http://www.oracle.com/FC.xsd">
    6 <row>
    7 <UniqueIdentifier>urn:x-gcs:def:featureType:GFDD::FT_DFDD_100565</UniqueIdentifier>
    8 <AlphaCode>ZB032</AlphaCode>
    9 <Name>Baseline Point</Name>
    10 <Status>Submitted</Status>
    11 <Definition>A location that serves as a point on, and which partially defines a segment
    of, a national boundary baseline.</Definition>
    12 <Description>May be monumented or unmonumented. A national boundary baseline is used fo
    r defining the landward edge or margin of a nation's various contiguous zones such as the 3 and 12 n
    autical mile limits and the Exclusive Economic Zone (EEZ).</Description>
    13 </row>
    14 </po:root>'));
    ERROR:
    ORA-01756: quoted string not properly terminated
    how to solve single quotation like (nation's) in xml data insertion
    please give me reply as soon as possible
    Thanks
    Kabeer

    Hi,
    Use &#x7B;code} tags to post formatted code on the forum.
    That way, your code will be more readable for everyone, and more importantly here, everyone will be able to clearly see what's bothering you :
    &apos;sThe single quote was encoded with the character entity reference "&amp;apos;".
    The conversion is not mandatory but it happens Oracle is doing it in this case.
    It shouldn't be a problem though.
    If you want to extract the value afterwards, it'll come as expected :
    SQL> create table ftr_ctl (id number, doc xmltype);
    Table created
    SQL> insert into ftr_ctl values (1,
      2  xmltype('<po:root xmlns:po="http://www.oracle.com/FC.xsd"
      3  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      4  xsi:schemaLocation="http://www.oracle.com/FC.xsd
      5  http://www.oracle.com/FC.xsd">
      6  <row>
      7  <UniqueIdentifier>urn:x-gcs:def:featureType:GFDD::FT_DFDD_100565</UniqueIdentifier>
      8  <AlphaCode>ZB032</AlphaCode>
      9  <Name>Baseline Point</Name>
    10  <Status>Submitted</Status>
    11  <Definition>A location that serves as a point on, and which partially defines a segment of, a national boundary baseline.</Definition>
    12  <Description>May be monumented or unmonumented. A national boundary baseline is used for defining the landward edge or margin of a nation''s various contiguous zones such as the 3 and 12 nautical mile limits and the Exclusive Economic Zone (EEZ).</Description>
    13  <Alias xsi:nil="true"></Alias>
    14  <SourceItemIdentifier>100565</SourceItemIdentifier>
    15  <SourceReference>DGIWG DFDD BL 2011-1.00</SourceReference>
    16  <SourceURL>https://www.dgiwg.org/FAD/fdd/view?i=100565</SourceURL>
    17  </row>
    18  </po:root>'));
    1 row inserted
    SQL> select extractvalue(doc, '/po:root/row/Description','xmlns:po="http://www.oracle.com/FC.xsd"')
      2  from ftr_ctl
      3  where id = 1
      4  ;
    EXTRACTVALUE(DOC,'/PO:ROOT/ROW/DESCRIPTION','XMLNS:PO="HTTP://WWW.ORACLE.COM/FC.
    May be monumented or unmonumented. A national boundary baseline is used for defi
    ning the landward edge or margin of a nation's various contiguous zones such as
    the 3 and 12 nautical mile limits and the Exclusive Economic Zone (EEZ).
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to send payload to error queue if the transaction is rolled back.

    Hey,
    If we get a error then the transaction needs to be rolled back. I need to send the input payload to a errored Queue if the transaction is roled back (not to the actual Queue from which input payload is consumed). Can any body tell how to do it.
    Thanks,
    Rakes.

    Hi Rakes,
    When a transaction is rolled back, the message (input payload ) will roll back to the "exception queue" of the initial queue. You may think of it as an error bucket inside the JMS queue. AIA provides manual scripts to resumbit this message once error is fixed.
    If you are using AQ, you could specify your own queue as exception queue. You could have a custom SQL solution to move messages from initial exception queue to your custom queue.
    Regards
    Rohit

  • How to insert a dialog box which prompt the user enter the general information in the SDI application?

    Im using the SDI application to build a system and now i would like to insert a dialog box which allow the user to enter the general information about themselves and then it will be saved into a text file. How to insert the dialog box and show the dialog box at the beginning of the program.

    Hi Lee,
    The easyest way to achieve this is to declare an object of your dialog box derived class (e.g. CUserInfo, public CDialog) into the InitInstance method of the main application class.
    Depending on the behavior you want you can place the code before dispatching the commands from command line (in which case the main frame of the SDI application will not be shown), or after, in which case the UserInfo dialog box will be shown over the main application window as modal.
    The code snipped bellow can be more helpfull:
    BOOL CSDIApp::InitInstance()
    AfxEnableControlContainer();
    // Parse command line for standard shell commands, DDE, file open
    CCommandLineInfo cmdInfo;
    ParseCommandLine(cmdInfo);
    //prompt user for data
    CUserInfo dlg;
    if (dlg.DoModal() == IDOK)
    //do something here with the data
    else
    return FALSE;//i.e. quit the application if the user presses the 'Cancel' button
    // Dispatch commands specified on the command line
    if (!ProcessShellCommand(cmdInfo))
    return FALSE;
    // The one and only window has been initialized, so show and update it.
    m_pMainWnd->ShowWindow(SW_SHOW);
    m_pMainWnd->UpdateWindow();
    return TRUE;
    Hope this helps,
    Silvius
    Silvius Iancu

  • HT1689 How can I stop multiple automatic downloads of the same item?

    Why does iTunes keep wanting to download the same item over and over again? How do I stop this without turning off the automatic download function.

    You may click on the "+" button to the right of the first multiple choice box to add more in the same line. When you hover over the button, the tooltip says "insert item beside".

  • How to insert element to a HashMap while iterating it ?

    Hi all,
    I have a HashMap having <key, value> as <file name, size of file>.
    Before iterating HashMap is loaded with some <key, value> pairs.
    While iterating it I'm trying to find all files matching particular key (Pattern created from file name) and insert to the same HashMap.
    This ends with a "ConcurrentModificationException".
    Is there an alternative way of doing this within one loop ?
    Thanks

    cybertechsum wrote:
    you can try this approach
    Create two threads one for iterating through the list and one for adding items to the list
    then synchronize the method so that only one thread can access hashmap at one timeThat's pointless overkill. He never said anything about needing two threads, and creating an additional thread just for this, but then syncing, will lead to sequential (i.e., single-threaded) behavior anyway.
    This will avoid errorThis is more complex than the other solutions suggested, and therefore more error-prone.

  • How to insert a link of file in the form and view it at any time i need

    Hi
    I'm using developer 2000/Form designer form version 4.5
    how i can insert a link of any file Word, Excel, PDF, JPG in the form run time
    and open it from the form at any time i need
    example
    i have employ table which contain details of the employ and i want to attach a link of his photo which i already saved it in local drive
    so when i have a new employ i enter his details and brows of his photo and when i select the link of the photo will be with his other details
    and when i need to view the details of the employ just enter the emp_no and i will get details including the photo link and when i want to open the photo just double click the link
    any body can help me on this
    regards

    Hi,
    I think you should investigate in how to upload the information into the database. If the employee keeps the photo on the local drive then this isn't realy for everyone to use
    Your options are : Upload to the database as ImageItem
    Frank
    Ps.: Forms 4.5 is desupported

  • How to insert an array of number in the array of cluster

    hello, I have a question. How to put an array of numeric into an array of clusters which have different types of element?
    Could you please show me in my vi?
    Attachments:
    program1.vi ‏7 KB

    It appears you didn't actually try anything. Have you done any LabVIEW tutorials? You can autoindex the array of clusters and use Bundle by Name. This assumes, of course, that the number of elements in the two arrays is the same. I would write it for you, but you will learn far more if you try it yourself first. If you don't know what autoindexing is, check the LabVIEW Help and the examples. Don't know what Bundle By Name is? Again, check the LabVIEW Help and the examples.
    To learn more about LabVIEW it is recommended that you go through the introduction material, tutorial(s), and other material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. There are also several Technical Resources. You can also take the online courses for free.

  • How to insert a sql query statement in the table

    I have a stored procedure which has different insert,update statements on different tables. I am writing a trigger on these tables such that when the record is updated or inserted in these tables a trigger should fire and should write the old value,new value and the query (insert or update) that caused the trigger to fire in the seperate table. Is there any way to find out the exact query statement that fired the trigger?

    Rather than inventing your own demi-donkeyed solution I recommend you consider using Oracle's Fine-Grained Auditing which does precisely this.
    Cheers, APC

Maybe you are looking for

  • CO posting statistical (11) and actual (04)

    Hi all Normally, when you post in CO with two or more objects one item is witten as actual the others as statistical, and nomrally is the cost center to be written as statistical. Example for a posting with cost center and internal order, the cost ce

  • OIM DB Recon Error

    I trying to do DB Reconciliation. In reconciliation manage getting "Event Received" message and after clicking on "Create User" button, I am getting following error. Using OIM 9.1 and 9.0.4.1 connector. DB is trusted source. Error Keyword: DOBJ.GEN_E

  • Should I purchase a Macbook Pro 15" Retina Display?

    Yeah so I've been saving up all my money from work (or w/e I have left) into buying myself a Macbook Pro Retina for video editing and graphics design but now I'm reading about this whole Image Retention/Ghosting issue. I'm just not sure if it's worth

  • Multiple Shared Content Stores in App-V 5

    Just wanted to see if it's possible to have a Shared Content Store (SCS) per site when we have an RDS Solution across two connected data centres? We are planning on implementing the App-V 5.0 client for RDS on the Session Hosts (2012 R2) at both site

  • TreeControl & Grid Control

    Q1 TreeControl I have this TreeControl in the frame along with several TextFieldContrl, GridControl My application can only play once (run once) for the frame with tree control each time I run it. It display OK in the first run. If I pay the 2nd visi