Quicksort with Median of Medians Method.

I am trying to test the MM, (Median of Medians method), to see that it has O(n) complexity. I can not get it to work, it is in part because I don't understand how to incorperate the MM code in to the Quicksort Method. Also note that there is an error in my Quick sort, the list sorts to some extent. I am trying to figure that out. So, all in all I have two problems... Here is what I have:
public class MMQuickSort
     private static long comparisons = 0;
     private static long exchanges = 0;
     static final int numberofgroups = 5;
     private static int groupsize = 0;
          public static void Quicksort(int[] a)
               // shuffle(a);           // to guard against worst-case and makes average = best = O(nlogn) without MM.
                groupsize = a.length / numberofgroups;
          QuickSort(a, 0, a.length);
     public static void QuickSort(int[] inarray, int low, int high)
          int thepivot, position = 0;
               if (low < high)
                    thepivot = Partition(inarray, low, high, high - 1);
                    QuickSort(inarray, low, thepivot - 1);
                    QuickSort(inarray, thepivot + 1, high);
     public static int Partition(int[] inarray, int low, int high, int pivot)
          int v = inarray[low];
          int j = low;
          int temp;
          //int moveleft = high + 1;
          //int v = inarray[low];
          for (int i = low + 1; i < high; i++)
               if (inarray[i] < v)
                    j++;
                    temp = inarray;
                    inarray[i] = inarray[j];
                    inarray[j] = temp;
               pivot = j;
               temp = inarray[low];
               inarray[low] = inarray[pivot];
               inarray[pivot] = temp;
          return pivot;
     public static int Select(int a[], int n, int k)
          int pivot= 0;
          if (n <= numberofgroups)
               Quicksort(a);
          else
               pivot = Select(a, a.length / numberofgroups, ((int)Math.ceil(a.length / numberofgroups / 2)));
          if (k == pivot)
               return k;
          else if (k < pivot)
               return Select(a, pivot - 1, k);
          else
               return Select(a, n - pivot, k - pivot);
To get it to work I call:
Quicksort(data) 
where "data" is a dis-ordered array of n elements.
Any thoughts would be much appreciated.
Thank you,
Brian                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

it would be good if you posted the exception next time
the exception occurs in the partition() method, on the line
while (less(a[++i], v)) ;it appears that l = 13 and r = 12, and a[++i] = a[13], a[14], a[15]... are all less than v = a[12]
"l" probably shouldn't be greater than "r"
on closer examination, it appears that your quicksort() algorithm has no base case. it keeps partitioning and making recursive calls until the subarray you are partitioning over has negative size (?)

Similar Messages

  • Payment with currency GBP, payment method Q: No valid payment procedure

    Hi,
    We  have a vendor, which is coming into error in the payment run .The error is as below.
    'Payment with currency GBP, payment method Q: No valid payment procedure'
    In FBZP, for the company code XXXX Payment method Q is defined.
    in Vendor master Payment method Q is defined. Vendor exists in the company code XXXX.
    In the invoice line, the payment method Q is there .
    Then where else, we are missing eny configuration, because of which this error is occuring.
    As Q means cheque payment, no need to provide bank details in vendor master, correct me if I am wrong.
    Please let me know the reason of this error.

    Dear Rudra,
    please run FBZP --> bank determination -->and check if You customized all the steps for Your Paying Company code  like:
    ranking order, bank accounts, available amounts for Your relevant payment method Q.
    Then please delete the proposal and run it again.
    Mauri

  • How to print a string with out using main method??

    how to print a string with out using main method??
    if we can tell me with example?
    thanks in adavance
    raja

    Hi,
    actually there's none. The UITableView class needs to "know" the tableView's height so either it can calc <number of rows> times <row height> or it has to sum the height of each single row.
    If the row which needs to be of different size always is the first or the last row you can user a tableHeader or tableFoot view.
    Regards
    Dirk

  • Problem extending standard ViewReceiptsSearchVO view object with logic on get method

    Hi All,
    EBS 12.1.3
    Database 11.2.0.3
    I am trying to extend the 3 VOs related to ViewReceiptsSearch.  I extended a seeded ViewReceiptsSearchVO view object.  I haven't made any changes yet, no columns added, nothing altered.  When I run this substitution, the "Received" column is null.  This column in the view used for the view object only selects NULL and uses the getter method for the attribute to populate the value.  The generated extension getter calls getAttributeInternal and skips the logic in the standard getter and the substituted view object is displaying the null in the screen.  The below discussion explains the problem very well except that the original posted had the issue in 11.5.10.2.  I am having this issue with 12.1.3.
    Problem extending standard view object with logic on get method
    The 3 VOs that I am having the problem are:
    ViewReceiptsSearchVO
    ViewReceiptsSearchReqVO
    ViewReceiptsSearchSupplierVO
    What do I need to do to get the "Received" column populated?  Please let me know any additional information you want to troubleshoot the issue.
    Thanks.

    Hi,
    Can you Please Share Extended ViewReceiptsSearchVO.xml and .jpx File?
    Thanks,
    Dilip

  • Problem with File obj renameTo() method

    I need help, I can't get the renameTo() method of the File object to work.
    I have 2 File objects, one is an existing file, and one I just performed the .delete()
    method on. Now I want to rename the existing file to the name of the one I
    just deleted. According the the java documentation the syntax is
    FileObject.renameTo(FileObject with desired name);
    This method is acting peculiar. The file is getting renamed, however
    after the rename, if i run the File object method .getName()
    it returns its old name before it was renamed. So the file is sitting in
    my filesystem newly renamed, but its getName() method returns the
    name that it held before I renamed it.
    WHy is this ?
    This is happening in the context of a JPanel, and I am stuffing the name
    into the title, since it fails, the title after the rename is of the original "temp"
    file.
    Here is my code.
    // tmp file is created and populated
    // old file is deleted
    // now rename tmp file to old file
    // Rename tmp file to correct name
                                    newTmpFile.renameTo(newFile); // Rename tmp file to file object selected from dialog
                                    originalFileName = newTmpFile.getName(); // Now grab the name
                                    setTitle("Editing - " + originalFileName); // Update the title

    Here's the entire routine...
            public void saveAsFileIO() {
                    // (pull up Save As Dialog) Prompt for new File Name
                    final JFileChooser fcSaveAs = new JFileChooser();
                    fcSaveAs.addChoosableFileFilter(new CDBFileFilter());
                    int returnVal = fcSaveAs.showSaveDialog(this);
                    if (returnVal == JFileChooser.APPROVE_OPTION) {
                            File newFile = fcSaveAs.getSelectedFile(); // Grab file from dialog
                            String strNewTmpPath = newFile.getParent() + "\\save.tmp"; // Use its path but add a different filename
                            File newTmpFile = new File(strNewTmpPath); // Create a new tmp file from this new path and name
                            int x, y;
                            try {
                                    FileWriter cdbWriter = new FileWriter(newTmpFile);
                                    BufferedWriter br = new BufferedWriter(cdbWriter);
                                    for (x = 0; x < cellList.listModel.getSize(); x++) {
                                            // FOR EACH Item in JList
                                            String[] arCells = (String[]) cellArrayList.get(x); // Grab array of values
                                            for (y = 0; y < arCells.length; y++) {
                                                    // Create string for this JList item
                                                    if (line == "") {
                                                            line = arCells[y]  + ",";
                                                    } else {
                                                            line += arCells[y] + ",";
                                            //System.out.print(line + "\n");
                                            // Write string to tmp file
                                            br.write(line);
                                            br.newLine();
                                            line = "";
                                    br.close();
                                    // Delete old file
                                    if (originalFileName != "") { // When saving an exisiting file as a new one, this runs
                                            String strOldPath = originalPath + "\\" + originalFileName;
                                            File oldFile = new File(strOldPath);
                                            oldFile.delete();
                                    // Rename tmp file to correct name
                                    newTmpFile.renameTo(newFile); // Rename tmp file to file object selected from dialog
                                    originalFileName = newTmpFile.getName(); // Now grab the name
                                    setTitle("CDB Editor - " + originalFileName); // Update the title
                            } catch (FileNotFoundException fnf) {
                                    System.err.println("Unable to open file for writing: " + fnf.getMessage());
                            } catch (IOException ioe) {
                                    System.err.println("unable to buffer write file: " + ioe.getMessage());
            }

  • Creating MEDIANIF and MEDIANIFS in Numbers '09

    Does anyone know how to create a MEDIANIF or MEDIANIFS similar to the available functions AVERAGEIF or AVERAGEIFS.
    I would like to take the median price of homes built on or after 1970, but there is no function: MEDIANIFS(SOLDPRICE, Year,">=1970") like there is for AVERAGEIFS.
    Thanks--

    DR,
    Let's say your sale date is in Column A and your selling price is in Column B. Add an auxiliary column containing the expression:
    =IF(YEAR(A)>1970, B, "")
    Now find the MEDIAN of the auxiliary column.
    Jerry

  • How to make set up with first call of method of a custom class?

    Hello
    I have build a custom class with a few custom methods.
    Method1 is called per every record of internal table. I need to set up certain parameters tha are the sme for all the calls  (populate the range , to fill the internal table , etc). This should be done only once.
    call method ZBW_CUSTOM_FUNCTIONS=>METHOD1
            exporting
              I = parameter1
            importing
              O = parameter2.
    Loop at ....
       <itab>-record1 = parameter2
    endloop.
    Methods2, 3 , 4 dont need any set up.
    Can somebody tell me how to do it within class?
    Thanks

    Instance methods (as opposed to static methods) are called on an object, which is an instance of a class. Broadly, think of the class as a template for the creation of objects. The objects created from the class take the same form as the class, but have their own state -- their own attribute values. In pseudo-ABAP (this won't even close to compile), let's say you have the following class:
    CLASS cl_class.
         STATICS static_attr TYPE string.
         DATA attr1 TYPE string.
         DATA attr2 TYPE i.
         CLASS-METHOD set_static_attr
              IMPORTING static_attr TYPE string.
              cl_class=>static_attr = static_attr.
         ENDMETHOD.
         METHOD constructor
              IMPORTING attr1 TYPE string
                                 attr2 TYPE i.
              me->attr1 = attr1.
              me->attr2 = attr2.
         ENDMETHOD.
         METHOD get_attr1
              RETURNING attr1 TYPE string.
              attr1 = me->attr1.
         ENDMETHOD.
    ENDCLASS.
    When you create an instance of the class (with CREATE OBJECT oref), the constructor is implicitly called. You can pass parameters to the constructor using: CREATE OBJECT oref EXPORTING attr1 = 'MyString' attr2 = 4.
    You then call methods on the instance you have created. So, oref-&gt;get_attr1( ) would return 'MyString'.
    The constructor is called when the object is created (so, when you call CREATE OBJECT). At this time, the setup is done, and any subsequent methods you call on the object will be able to use the attributes you set up in the constructor. Every object has its own state. If you had another object, oref2, changing its instance attribute values would not affect the values of oref.
    Static methods and attributes are different. A static attribute exists only once for all instances of the class -- they share a single value (within an internal session, I think. I'm not sure of the scope off-hand.) You also call static methods on the class itself, not on instances of it, using a different selector (=&gt; instead of -&gt;). So, if you called cl_class=&gt;set_static_attr( static_attr = 'Static string' ), 'Static string' would be the value of static_attr, which belongs to the class cl_class, and not instances of it. (You can also set up a class constructor, which is called when the class is loaded, but that's another subject.)
    To answer your question more succinctly: no, the constructor is not called before each method. It is only called when you create the object. Any subsequent methods called on the object can then access its attributes.
    Please have a look at [http://help.sap.com/saphelp_nw70ehp2/helpdata/en/48/ad3779b33a11d194f00000e8353423/frameset.htm] for a more thorough treatment of basic object concepts. (The rest of that documentation is very thin, but it'll get you started. Also, it doesn't appear to deal with statics. You'll have to look elsewhere for that.)

  • Mx.services.WebService() fails with Can't Find Method in Service

    When I test in debug mode, my webservices fail with can't
    find method or can't find URL. When I test on the very same
    webservice with the SWF file embedded in an HTML file, it all works
    fine!
    This all worked before I updated to Windows Vista last week!
    Any ideas? How can I troubleshoot this?? (I'm using a
    mx.services.Log when running in Debug)
    TIA,
    geo

    Some further info from the trace log:
    Error opening URL "
    http://desktop.mydomain.local/MyCompany/WebServices/MyServices.asmx"
    ObligationMet.Fault: undefined, Unable to connect to
    endpoint:
    http://desktop.mydomain.local/odoclub/WebServices/MyServices.asmx

  • Send message with the standard communication method of the vendor

    Hi,
       In the transaction XK02 I change the standard communication method to email. When I create a new PO with ME21N I want the message to be create auto. with the std. comm. method define in the XK02. I don't want to use MN05 to define for each vendor a condition record.
      I want to use it like the communication language of the vendor work.
    If you need more info. let me know.
    Best reagrds

    Hi Tim,
    Could you please tell me step by step to configure what you are saying?
    I need to send messages by standard communication informed in vendor master data.
    Many thanks
    Regards
    Patrícia

  • Abstract class with set and get methods

    hi
    how to write set and get methods(plain methods) in an abstartc class
    ex: setUsername(String)
    String getUsername()
    and one class is extending this abstract class and same methods existing in that sub class also..... how to write......plz provide some ideas
    am new to programming....
    asap
    thnx in advance

    yes... as i told u.... i am new to coding......
    and my problem is ..... i have 2 classes one is abstract class without abstract methods.. and another class is extending abstract class.....
    in abstract class i have 2 methods...one is setusername(string) and getusername() ..... how to write these two methods.... in abstract class i have private variables username...... when user logins ..... i need to catch the user name and i need to validate with my oracle database and i need to identify the role of that user and based on role of that user i need to direct him to appropriate jsp page.......
    for that now i am writing business process classes..... the above mentioned two classes are from business process.....
    could u help me now
    thnx in advance

  • Avoid Duplicate Named Ranges when copying a sheet from one wb to another with the worksheet.copy method

    I have a template monthly report with about 30 pages and 50+ users. Each user makes some modifications to their copy so they are loathe to adopt any new version. My solution is to migrate their data, etc across to the new version. I've solved many of
    the problems, but the current one has me stumped. Using OldWS.Copy After:=newWB.Sheets(newWB.Sheets.Count) I get a copy of new sheets in the old workbook and paste them at the end of the new workbook. So far ok. Problem is it duplicates named ranges. I added
    Application.DisplayAlerts = False, and that stops the dialog boxes, but the names get added as local sheet scope variables. The .Copy method doesn't seem to have any parameters except the choice of before or after. I've been searching for a week now to no
    avail. TIA for any help or suggestions.
    Question: How can I avoid duplicating the named ranges if there is already a global (workbook scope) named range in the workbook?

    Hi rdperkins,
    Base on my test, the result is the same to you, it will keep the same named range in the new worksheet.
    As far as I know, we can’t avoid the duplicate named range if there is already exist in the workbook.
    Base on my test, we can’t create the same named range through UI, but we can do it through the code.
    I suggest that you could delete the range in the target worksheet after copy a worksheet. (Name.Delete)
    # Names Object (Excel)
    http://msdn.microsoft.com/en-us/library/office/ff841280(v=office.15).aspx
    Best Regards
    Starain
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • CMP Entity Bean with ejb-ql finder methods and INFORMIX database

    Hi,
    I have some CMP Entity Beans with finder methods defined in ejb-ql. In my ejb-jar, within <entity> definitions I have something like:
        <entity>
          <abstract-schema-name>BeanName</abstract-schema-name>
          <cmp-field><field-name>fieldOne</field-name></cmp-field>
          <cmp-field><field-name>fieldTwo</field-name></cmp-field>
          <query>
            <query-method>
              <method-name>findAll</method-name>
              <method-params></method-params>
            </query-method>
            <ejb-ql>SELECT OBJECT(o) FROM BeanName o</ejb-ql>
          </query>
        <entity>
    And in persistent.xml:
    <db-properties>
         <data-source-name>datasource_name</data-source-name>
    </db-properties>
    <entity-bean>
         <ejb-name>BeanName</ejb-name>
         <table-name>table_name</table-name>
         <field-map key-type="NoKey">
         <field-name>fieldOne</field-name>
         <column><column-name>column_one</column-name></column>
          </field-map>
         <field-map key-type="NoKey">
         <field-name>fieldTwo</field-name>
         <column><column-name>column_two</column-name></column>
          </field-map>
          <finder-descriptor>
              <method-name>findAll</method-name>
              <method-params/>
         </finder-descriptor>
    Once deployed, on server side, I can found a java source file (with corresponding compiled class file) in path:
    j2ee/cluster/server0/apps/companyName/MyEARApp/EJBContainer/temp/temp38837373733/route/to/package/
    with names:
    BeanName0_0pm.java
    BeanName0_0PM.class
    and the generated java file contains this code:
      public java.util.Enumeration ejbFindAll() throws javax.ejb.FinderException, javax.ejb.EJBException  {
        TransactionContext tc = pm.getTransactionContext();
        Connection conn = null;
        PreparedStatement pSt = null;
        ResultSet ejb_rs = null;
        int status = javax.transaction.xa.XAResource.TMSUCCESS;
        try {
          conn = pm.getConnectionForFindMethod();
          pSt = conn.prepareStatement("SELECT \"O\".\"COLUMN_ONE\",\"O\".\"COLUMN_TWO\", FROM \"TABLE_NAME\" \"O\"");
          ejb_rs = pSt.executeQuery();
    I'm trying to call this method but it throws a SQLException when preparing the statement.
    It seems that Informix does not like this SQL syntax because of upper case names, doble quotes on table alias, or something else.
    When editing persistent.xml in netweaver, I can define the element <datasource-vendor> as ORACLE, SAPDB, MS_SQL_SERVER, DB2_UDB_AS400 or DB2_UDB_OS390 but INFORMIX is not an accepted value.
    Is there any way to define how this SQL query is build?
    Thanks in advance.

    The return type of the finder method defined in the remote home interface is either the entity bean's remote interface or a collection of objects implementing the entity bean's remote interface. The return type of the finder method defined in the local home interface is either the entity bean's local interface or a collection of objects implementing the entity bean's local interface

  • Problem with updating a record method in a database

    I've searched for the forums for info on this to no avail.
    I am connecting to Access database, using the sun.jdbc.odbc.JdbcOdbcDriver.
    I'm trying to be able to update 2 fields in a record (cost & quantity).
    I have an addrecord method, an update method.
    I can use the addrecord and it works great.
    But (yep, there's always a but!), when I try to update only the 1 or 2 fields on a record, I get a message that says "syntax error in UPDATE statement"
    I've written, deleted and re-written code & I'm going nuts.
    Here are my database methods and the actionPerformed where it calls those methods. Is the error message regarding my UPDATE (sql) syntax?
    Why does it work for adding, but not updating?? It seems my 1st if statement under my "update button" is never gone to... so maybe it's just a problem with my "if" statement.
    Please help me before I go crazy! Thanks!
    //flags
    //snippet of code
    private void enableButtons(boolean flag1)
        boolean flag2 = false;
        if (flag1 == false)
           flag2 = true;
        jbtUpdate.setEnabled(flag2); // was flag1 wouldn't work.
        jbtDelete.setEnabled(flag1);
        jbtAdd.setEnabled(flag1);
        jbtFirst.setEnabled(flag1);
        jbtNext.setEnabled(flag1);
        jbtPrev.setEnabled(flag1);
        jbtLast.setEnabled(flag1);
    //...actionperformed(ActionEvent e)
    else if (e.getSource() == jbtAdd)
        jtfItem.requestFocus();
        enableButtons(false);
        jtfItem.setText("");
        jtfDescription.setText("");
        jtfQuantity.setText("");
        jtfCost.setText("");
        addFlag = true;
      else if (e.getSource() == jbtUpdate)
        double quantity1 = parseInt(jtfQuantity.getText());
        double cost1  = parseCurrency(jtfCost.getText());
        Item itemUpdate = new Item(jtfItem.getText(), jtfDescription.getText(),
        cost1, (int)quantity1);
        System.out.println("update button was clicked");
        //first "if"
        if ((jbtUpdate.isEnabled()) && (addFlag == false))
          InventoryDB.updateField(itemUpdate);
          currentItem = itemUpdate;
          System.out.println("it's going to first if stmt");
        //2nd "if"
        if (addFlag == true)
          InventoryDB.addRecord(itemUpdate);
          currentItem = InventoryDB.moveFirst();
          addFlag = false;
          System.out.println("it's going to 2nd if stmt");
        currentItem = itemUpdate;
        performItemDisplay();
        enableButtons(true);
        System.out.println("it's going to last of update code");
    //method snippets  for database manipulation
    public static void addRecord(Item item) throws SQLException
        String query = "INSERT INTO Items (ItemNumber, ItemDescription, UnitCost, Quantity)  " +
            "VALUES ('" + item.getItem() + "', " +
               "'" +        item.getDescr() + "', " +
            "'" +         item.getCost() + "', " +
               "'" +     item.getQuantity() + "')";
        Statement statement = connection.createStatement();
        statement.executeUpdate(query);
        statement.close();
        close();
        open();
      public static void updateField(Item item) throws SQLException
        String query = "Update Items SET " +// Items (ItemNumber, ItemDescription, UnitCost, Quantity) " +
          "VALUES ('" + item.getCost() + "', " +
          "'" +     item.getQuantity() + "', " ;
    //      "WHERE ItemNumber  = " ItemNumber "'"
    //       "WHERE ItemDescription = " ItemDescription "', ";
          Statement statement = connection.createStatement();
          statement.executeUpdate(query);
          statement.close();
          close();
          open();
       public static void updateRecord(Item item) throws SQLException
        String query = "UPDATE Items SET " +
            "ItemNumber  = '" +      item.getItem() + "', " +
            "ItemDescription = '" + item.getDescr() + "', " +
               "UnitCost =  '" +        item.getCost() + "', " +
            "Quantity = '" +     item.getQuantity() + "', " +
            "WHERE ItemNumber = '" + item.getItem() +  "'";
        Statement statement = connection.createStatement();
        statement.executeUpdate(query);
        statement.close();
        close();
        open();
      public static void deleteRecord(String ItemNumber) throws SQLException
        String query = "DELETE FROM Items " +
            "WHERE ItemNumber = '" + ItemNumber + "'";
        Statement statement = connection.createStatement();
        statement.executeUpdate(query);
        statement.close();
        close();
        open();

    not familiar with this syntax,
    public static void updateField(Item item) throws
    s SQLException
    String query = "Update Items SET " +// Items
    ems (ItemNumber, ItemDescription, UnitCost, Quantity)
    " +
    "VALUES ('" + item.getCost() + "', " +
    "'" + item.getQuantity() + "', " ;
    // "WHERE ItemNumber = " ItemNumber "'"
    // "WHERE ItemDescription = " ItemDescription
    public static void updateRecord(Item item) throws
    ws SQLException
    String query = "UPDATE Items SET " +
    "ItemNumber = '" + item.getItem() + "', " +
    "ItemDescription = '" + item.getDescr() + "', " +
    "UnitCost = '" + item.getCost() +
    etCost() + "', " +
    "Quantity = '" + item.getQuantity() + "', " +one ',' too many
    "WHERE ItemNumber = '" + item.getItem() + "'";

  • Fast free shipping = shipping in ~5 days with a slow ground method?

    I may be pleasantly surprised here, since I know ship and delivery times are conservative estimates, but I am finding it strange that the iPad I just purchased won't ship for up to 5 days and appears to be using a slow ground method that may tack 5+ days on top of that. I wasn't expecting anything better than say Tuesday 3/15, but the 18th-25th seems like a really, really long time to wait. I'd have chosen a faster method, but only Standard was available.

    I am not sure what you lot are complaining about. The US online store is the same for everyone. There was plenty of notification of what the FREE option consisted of, including the delivery estimate dates. Plus there were plenty of other options from which to choose for faster delivery.
    I buy three to four times a year from the Apple Store online. Tonight was identical to every other time. So anyone who says that this delivery time frame is all a surprise are being dishonest with themselves or was not paying attention.
    Dah•veed

  • Webutil_c_api with user32.dll (ShowWindow method) crashes

    Hello,
    I am trying to hide a window by using the method ShowWindow of user32.dll.
    So I use the package webutil_c_api.
    It works, my window becomes hidden, but just after that, the Forms applet crashes with Internet Explorer.
    Here is the code :
    declare
         v_args webutil_c_api.ParameterList;
         v_param webutil_c_api.ParameterHandle;
         v_res pls_integer;
    begin
      v_args := webutil_c_api.create_parameter_list;
      v_param := webutil_c_api.add_parameter(v_args, webutil_c_api.C_LONG, webutil_c_api.PARAM_IN, 66152);
      v_param := webutil_c_api.add_parameter(v_args, webutil_c_api.C_INT, webutil_c_api.PARAM_IN, 0);
      v_res := webutil_c_api.invoke_long('user32.dll', 'ShowWindow', v_args);
      MESSAGE('ShowWindow -> ' || v_res);
    EXCEPTION
         WHEN OTHERS THEN
           message('Error code: '||to_char(sqlcode)||'  Txt: '||sqlerrm);
           PAUSE;
           raise form_trigger_failure;
    end;Notice : I had to hardcode the Window Handler 66152 because I'm not able to find it (there is another problem).
    Do you have some hints?
    Thanks,
    Nicolas.

    When it crashes, it produces a file that is placed on my desktop :
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x2
    Function name=(N/A)
    Library=(N/A)
    NOTE: We are unable to locate the function name symbol for the error
          just occurred. Please refer to release documentation for possible
          reason and solutions.
    Current Java thread:
         at oracle.forms.webutil.cApi.CFunc.callInt(Native Method)
         at oracle.forms.webutil.cApi.CApiFunctions.invokeCApi(CApiFunctions.java:837)
         at oracle.forms.webutil.cApi.CApiFunctions.getProperty(CApiFunctions.java:144)
         at oracle.forms.handler.UICommon.onGet(Unknown Source)
         at oracle.forms.engine.Runform.onGetHandler(Unknown Source)
         at oracle.forms.engine.Runform.processMessage(Unknown Source)
         at oracle.forms.engine.Runform.processSet(Unknown Source)
         at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
         at oracle.forms.engine.Runform.onMessage(Unknown Source)
         at oracle.forms.engine.Runform.processEventEnd(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Dynamic libraries:
    0x00400000 - 0x00419000      C:\Program Files\Internet Explorer\IEXPLORE.EXE
    0x77F50000 - 0x77FF7000      C:\WINNT\System32\ntdll.dll
    0x77E60000 - 0x77F46000      C:\WINNT\system32\kernel32.dll
    0x77C10000 - 0x77C63000      C:\WINNT\system32\msvcrt.dll
    0x77D40000 - 0x77DCC000      C:\WINNT\system32\USER32.dll
    0x77C70000 - 0x77CB0000      C:\WINNT\system32\GDI32.dll
    0x77DD0000 - 0x77E5D000      C:\WINNT\system32\ADVAPI32.dll
    0x78000000 - 0x78086000      C:\WINNT\system32\RPCRT4.dll
    0x70A70000 - 0x70AD5000      C:\WINNT\system32\SHLWAPI.dll
    0x71700000 - 0x71849000      C:\WINNT\System32\SHDOCVW.dll
    0x71950000 - 0x71A34000      C:\WINNT\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.10.0_x-ww_f7fb5805\comctl32.dll
    0x773D0000 - 0x77BC2000      C:\WINNT\system32\SHELL32.dll
    0x77340000 - 0x773CB000      C:\WINNT\system32\comctl32.dll
    0x771B0000 - 0x772D1000      C:\WINNT\system32\ole32.dll
    0x74720000 - 0x74764000      C:\WINNT\System32\MSCTF.dll
    0x71500000 - 0x715FD000      C:\WINNT\System32\BROWSEUI.dll
    0x72430000 - 0x72442000      C:\WINNT\System32\browselc.dll
    0x75F40000 - 0x75F5F000      C:\WINNT\system32\appHelp.dll
    0x76FD0000 - 0x77048000      C:\WINNT\System32\CLBCATQ.DLL
    0x77120000 - 0x771AB000      C:\WINNT\system32\OLEAUT32.dll
    0x77050000 - 0x77115000      C:\WINNT\System32\COMRes.dll
    0x77C00000 - 0x77C07000      C:\WINNT\system32\VERSION.dll
    0x76670000 - 0x76757000      C:\WINNT\System32\SETUPAPI.dll
    0x5AD70000 - 0x5ADA4000      C:\WINNT\System32\UxTheme.dll
    0x63000000 - 0x63096000      C:\WINNT\system32\WININET.dll
    0x762C0000 - 0x76348000      C:\WINNT\system32\CRYPT32.dll
    0x762A0000 - 0x762B0000      C:\WINNT\system32\MSASN1.dll
    0x76F90000 - 0x76FA0000      C:\WINNT\System32\Secur32.dll
    0x10000000 - 0x1012D000      c:\program files\google\googletoolbar1.dll
    0x1A400000 - 0x1A47A000      C:\WINNT\system32\urlmon.dll
    0x71AD0000 - 0x71AD8000      C:\WINNT\System32\WSOCK32.dll
    0x71AB0000 - 0x71AC5000      C:\WINNT\System32\WS2_32.dll
    0x71AA0000 - 0x71AA8000      C:\WINNT\System32\WS2HELP.dll
    0x76C30000 - 0x76C5B000      C:\WINNT\System32\WINTRUST.dll
    0x76C90000 - 0x76CB2000      C:\WINNT\system32\IMAGEHLP.dll
    0x76B40000 - 0x76B6C000      C:\WINNT\System32\WINMM.dll
    0x76380000 - 0x76385000      C:\WINNT\System32\MSIMG32.dll
    0x6D510000 - 0x6D58D000      C:\WINNT\System32\DBGHELP.DLL
    0x71C20000 - 0x71C6E000      C:\WINNT\System32\netapi32.dll
    0x71B20000 - 0x71B31000      C:\WINNT\system32\MPR.dll
    0x75F60000 - 0x75F66000      C:\WINNT\System32\drprov.dll
    0x71C10000 - 0x71C1D000      C:\WINNT\System32\ntlanman.dll
    0x71CD0000 - 0x71CE6000      C:\WINNT\System32\NETUI0.dll
    0x71C90000 - 0x71CCC000      C:\WINNT\System32\NETUI1.dll
    0x71C80000 - 0x71C86000      C:\WINNT\System32\NETRAP.dll
    0x71BF0000 - 0x71C01000      C:\WINNT\System32\SAMLIB.dll
    0x76EE0000 - 0x76F17000      C:\WINNT\System32\RASAPI32.DLL
    0x76E90000 - 0x76EA1000      C:\WINNT\System32\rasman.dll
    0x76EB0000 - 0x76EDB000      C:\WINNT\System32\TAPI32.dll
    0x76E80000 - 0x76E8D000      C:\WINNT\System32\rtutils.dll
    0x75F70000 - 0x75F79000      C:\WINNT\System32\davclnt.dll
    0x722B0000 - 0x722B5000      C:\WINNT\System32\sensapi.dll
    0x75A70000 - 0x75B15000      C:\WINNT\system32\USERENV.dll
    0x76990000 - 0x769B4000      C:\WINNT\System32\ntshrui.dll
    0x76B20000 - 0x76B35000      C:\WINNT\System32\ATL.DLL
    0x76170000 - 0x761F8000      C:\WINNT\System32\shdoclc.dll
    0x74770000 - 0x747FF000      C:\WINNT\System32\mlang.dll
    0x63580000 - 0x63830000      C:\WINNT\System32\mshtml.dll
    0x75E90000 - 0x75F37000      C:\WINNT\System32\SXS.DLL
    0x6B700000 - 0x6B790000      C:\WINNT\System32\jscript.dll
    0x746F0000 - 0x74716000      C:\WINNT\System32\msimtf.dll
    0x746C0000 - 0x746E7000      C:\WINNT\System32\MSLS31.DLL
    0x76390000 - 0x763AC000      C:\WINNT\System32\IMM32.DLL
    0x76620000 - 0x7666E000      C:\WINNT\System32\cscui.dll
    0x76600000 - 0x7661B000      C:\WINNT\System32\CSCDLL.dll
    0x325C0000 - 0x325D2000      C:\Program Files\Office2003\OFFICE11\msohev.dll
    0x71A50000 - 0x71A8B000      C:\WINNT\system32\mswsock.dll
    0x71A90000 - 0x71A98000      C:\WINNT\System32\wshtcpip.dll
    0x76F20000 - 0x76F45000      C:\WINNT\System32\DNSAPI.dll
    0x76FB0000 - 0x76FB7000      C:\WINNT\System32\winrnr.dll
    0x76F60000 - 0x76F8C000      C:\WINNT\system32\WLDAP32.dll
    0x02C70000 - 0x02C83000      C:\Program Files\Labtec\Labtec Mouse Software\2.0\MOUDL32A.DLL
    0x76FC0000 - 0x76FC5000      C:\WINNT\System32\rasadhlp.dll
    0x6D350000 - 0x6D35D000      C:\Program Files\Oracle\JInitiator 1.3.1.18\bin\npjinit13118.dll
    0x6D130000 - 0x6D15B000      C:\Program Files\Oracle\JInitiator 1.3.1.18\bin\beans.ocx
    0x6D300000 - 0x6D316000      C:\Program Files\Oracle\JInitiator 1.3.1.18\bin\jpishare.dll
    0x6D3F0000 - 0x6D4C7000      C:\PROGRA~1\Oracle\JINITI~1.18\bin\hotspot\jvm.dll
    0x6D220000 - 0x6D227000      C:\PROGRA~1\Oracle\JINITI~1.18\bin\hpi.dll
    0x6D380000 - 0x6D38D000      C:\PROGRA~1\Oracle\JINITI~1.18\bin\verify.dll
    0x6D250000 - 0x6D268000      C:\PROGRA~1\Oracle\JINITI~1.18\bin\java.dll
    0x6D390000 - 0x6D39D000      C:\PROGRA~1\Oracle\JINITI~1.18\bin\zip.dll
    0x6D020000 - 0x6D12B000      C:\Program Files\Oracle\JInitiator 1.3.1.18\bin\awt.dll
    0x73000000 - 0x73023000      C:\WINNT\System32\WINSPOOL.DRV
    0x6D1E0000 - 0x6D21C000      C:\Program Files\Oracle\JInitiator 1.3.1.18\bin\fontmanager.dll
    0x5ED00000 - 0x5EDC6000      C:\WINNT\System32\OPENGL32.dll
    0x68B20000 - 0x68B3E000      C:\WINNT\System32\GLU32.dll
    0x73760000 - 0x737A4000      C:\WINNT\System32\DDRAW.dll
    0x73BC0000 - 0x73BC6000      C:\WINNT\System32\DCIMAN32.dll
    0x0DD70000 - 0x0DFA2000      C:\WINNT\System32\ialmgicd.dll
    0x0DFB0000 - 0x0E02B000      C:\WINNT\System32\ialmgdev.dll
    0x6D340000 - 0x6D348000      C:\Program Files\Oracle\JInitiator 1.3.1.18\bin\net.dll
    0x0FFA0000 - 0x0FFC1000      C:\WINNT\System32\dssenh.dll
    0x6D370000 - 0x6D37A000      C:\Program Files\Oracle\JInitiator 1.3.1.18\bin\packager.dll
    0x0E860000 - 0x0E870000      C:\Program Files\Oracle\JInitiator 1.3.1.18\bin\JNIsharedstubs.dll
    0x76BF0000 - 0x76BFB000      C:\WINNT\System32\PSAPI.DLL
    Local Time = Tue Aug 29 08:53:29 2006
    Elapsed Time = 4
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.3.1_04-b02 mixed mode)
    #

Maybe you are looking for