Need Help to see why the performance is not good

Hi,
We have an application that all process are developed in PL/SQL on Oracle 9i Database :
Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
PL/SQL Release 9.2.0.6.0 - Production
Why I have created this package. the application is a production management on chemical industries. I need to sometimes trace the Manufacturing order execution to eventually answer some incoherent data. If I analyze directly the data in the Table is not always responding because the origin of problem can be provide of some execution that perform some calculation.
In the procedure or function a use my package PAC_LOG_ERROR.PUT_LINE(xxxxxx) to save the information. This command save the information in the memory before. At the end of the procedure or function a perform the insert with the COMMIT calling PAC_LOG_ERROR.LOGS or PAC_LOG_ERROR.ERRORS on the catch exception.
This package is always call. On each routines performed I execute it. In the trace log of the database we have see a problem we the procedure GET_PROC_NAME in the package. We have identify that is called more that 800x and increase the performance. Who increase is this select command :
    SELECT * INTO SOURCE_TEXT
    FROM (SELECT TEXT FROM all_source
        WHERE OWNER = SOURCE_OWNER AND
              NAME=SOURCE_NAME AND
              TYPE IN ('PROCEDURE','FUNCTION','PACKAGE BODY') AND
              LINE <= SOURCE_LINE AND SUBSTR(TRIM(TEXT),1,9) IN ('PROCEDURE','FUNCTION ')
        ORDER BY LINE DESC)
    WHERE ROWNUM = 1;I use it to get the procedure or function name where my log proc is called. I now that I can pass in parameters, but I have think to use an automatic method, that can help to not have some problem with others developer team to make a copy/past and not update the parameters. Because the Log info is read by the Help Desk and if we have an error on the information, it not a good help.
COULD YOU PLEASE HELP ME TO OPTIMIZE OR SAID THE BETTER METHOD TO DO IT ?
Here my package :
create or replace
PACKAGE PAC_LOG_ERROR AS
-- Name         : pac_log_error.sql
-- Author       : Calà Salvatore - 02 July 2010
-- Description  : Basic Error and Log management.
-- Usage notes  : To active the Log management execute this statement
--                UPDATE PARAM_TECHNIC SET PRM_VALUE = 'Y' WHERE PRM_TYPE = 'TRC_LOG';
--                COMMIT;
--                To set the period in day before to delete tracability
--                UPDATE PARAM_TECHNIC SET PRM_VALUE = 60 WHERE PRM_TYPE = 'DEL_TRC_LOG';
--                COMMIT;
--                To set the number in day where the ERROR is save before deleted
--                UPDATE PARAM_TECHNIC SET PRM_VALUE = 60 WHERE PRM_TYPE = 'DEL_TRC_LOG';
--                COMMIT;
-- Requirements : Packages PAC_PUBLIC and OWA_UTIL
-- Revision History
-- --------+---------------+-------------+--------------------------------------
-- Version |    Author     |  Date       | Comment
-- --------+---------------+-------------+--------------------------------------
-- 1.0.0   | S. Calà       | 02-Jul-2010 | Initial Version
-- --------+---------------+-------------+--------------------------------------
--         |               |             |
-- --------+---------------+-------------+--------------------------------------
  PROCEDURE INITIALIZE;
  PROCEDURE CLEAN;
  PROCEDURE RESETS(IN_SOURCE IN VARCHAR2 DEFAULT NULL);
  PROCEDURE PUT_LINE(TXT IN VARCHAR2);
  PROCEDURE ERRORS(REF_TYPE IN VARCHAR2 DEFAULT 'SITE', REF_VALUE IN VARCHAR2 DEFAULT '99', ERR_CODE IN NUMBER DEFAULT SQLCODE, ERR_MSG IN VARCHAR2 DEFAULT SQLERRM);
  PROCEDURE LOGS(REF_TYPE IN VARCHAR2 DEFAULT 'SITE', REF_VALUE IN VARCHAR2 DEFAULT '99');
END PAC_LOG_ERROR;
create or replace
PACKAGE BODY PAC_LOG_ERROR
AS
  /* Private Constant */
  CR    CONSTANT CHAR(1)  := CHR(13);  -- Retour chariot
  LF    CONSTANT CHAR(1)  := CHR(10);  -- Saut de ligne
  CR_LF CONSTANT CHAR(2)  := LF || CR; --Saut de ligne et retour chariot
  TAB   CONSTANT PLS_INTEGER := 50;
  sDelay   CONSTANT PLS_INTEGER := 30;
  /* Private Record */
  TYPE REC_LOG IS RECORD(
    ERR_DATE TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
    ERR_TXT  VARCHAR2(4000)
  /* Private Type Table */
  TYPE TAB_VALUE IS TABLE OF REC_LOG INDEX BY PLS_INTEGER;
  TYPE TAB_POINTER IS TABLE OF TAB_VALUE INDEX BY VARCHAR2(80);
  /* Private Variables Structures */
  LOG_TRC PARAM_TECHNIC.PRM_VALUE%TYPE;
  LIST_PARAM TAB_POINTER;
  /* Private Programs */
  FUNCTION GET_PROC_NAME( SOURCE_OWNER IN all_source.OWNER%TYPE
                         ,SOURCE_NAME  IN all_source.NAME%TYPE
                         ,SOURCE_LINE  IN all_source.LINE%TYPE) RETURN VARCHAR2
  AS
    SOURCE_TEXT  all_source.TEXT%TYPE;
    TYPE RECORD_TEXT IS TABLE OF all_source.TEXT%TYPE;
    RETURN_TEXT     RECORD_TEXT;
  BEGIN
    SELECT * INTO SOURCE_TEXT
    FROM (SELECT TEXT FROM all_source
        WHERE OWNER = SOURCE_OWNER AND
              NAME=SOURCE_NAME AND
              TYPE IN ('PROCEDURE','FUNCTION','PACKAGE BODY') AND
              LINE <= SOURCE_LINE AND SUBSTR(TRIM(TEXT),1,9) IN ('PROCEDURE','FUNCTION ')
        ORDER BY LINE DESC)
    WHERE ROWNUM = 1;
    IF SOURCE_TEXT IS NOT NULL OR  SOURCE_TEXT != '' THEN
      SOURCE_TEXT := TRIM(SUBSTR(SOURCE_TEXT,1,INSTR(SOURCE_TEXT,'(')-1));     
      SOURCE_TEXT := LTRIM(LTRIM(TRIM(SOURCE_TEXT),'PROCEDURE'),'FUNCTION');
      SOURCE_TEXT := SOURCE_NAME||'.'|| TRIM(SOURCE_TEXT);
    ELSE
      SOURCE_TEXT := 'ANONYMOUS BLOCK';
    END IF;
    RETURN SOURCE_TEXT;
  END GET_PROC_NAME;
  PROCEDURE SELECT_MASTER(REF_TYPE IN VARCHAR2, PARAM_VALUE IN VARCHAR2, SITE OUT VARCHAR2, REF_MASTER OUT VARCHAR2)
  AS
  BEGIN
      REF_MASTER := '';
      SITE := '99';
      CASE UPPER(REF_TYPE)
        WHEN 'PO' THEN -- Process Order
          SELECT SITE_CODE INTO SITE FROM PO_PROCESS_ORDER WHERE PO_NUMBER = PARAM_VALUE;
        WHEN 'SO' THEN -- Shop Order
          SELECT P.SITE_CODE,P.PO_NUMBER INTO SITE,REF_MASTER FROM SO_SHOP_ORDER S
          INNER JOIN PO_PROCESS_ORDER P ON P.PO_NUMBER = S.PO_NUMBER
          WHERE S.NUMOF = PARAM_VALUE;
        WHEN 'SM' THEN -- Submixing
          SELECT SITE_CODE,NUMOF INTO SITE,REF_MASTER FROM SO_SUBMIXING WHERE IDSM = PARAM_VALUE;
        WHEN 'IDSM' THEN -- Submixing
          SELECT SITE_CODE,NUMOF INTO SITE,REF_MASTER FROM SO_SUBMIXING WHERE IDSM = PARAM_VALUE;
        WHEN 'PR' THEN -- Pourring
          SELECT B.SITE_CODE,P.NUMOF INTO SITE,REF_MASTER FROM SO_POURING P
          INNER JOIN SO_SUBMIXING B ON B.IDSM=P.IDSM
          WHERE P.IDSM = PARAM_VALUE;
        WHEN 'NUMSMP' THEN -- Pourring
          SELECT SITE_CODE,NUMOF INTO SITE,REF_MASTER FROM SAMPLE WHERE NUMSMP = TO_NUMBER(PARAM_VALUE);
--        WHEN 'MSG' THEN -- Messages
--          SELECT SITE_CODE,PO_NUMBER INTO SITE,REF_MASTER FROM CMS_INTERFACE.MAP_ITF_PO WHERE MSG_ID = PARAM_VALUE;
        ELSE
          SITE := sys_context('usr_context', 'site_attribute');
      END CASE;
  EXCEPTION
    WHEN OTHERS THEN
      REF_MASTER := '';
      SITE := sys_context('usr_context', 'site_attribute');
  END SELECT_MASTER;
  PROCEDURE ADD_LIST_PROC
  AS
  PRAGMA AUTONOMOUS_TRANSACTION;
  BEGIN
    MERGE INTO LOG_PARAM A
    USING (SELECT OWNER, TYPE
                 ,NAME PROC
                 , CASE NAME WHEN SUBNAME THEN NULL
                             ELSE SUBNAME
                   END SUBPROC
           FROM (
              SELECT owner,TYPE,UPPER(NAME) NAME,UPPER(trim(substr(substr(trim(text),1,instr(trim(text),'(')-1),instr(substr(trim(text),1,instr(trim(text),'(')-1),' ')))) SUBNAME
                     FROM ALL_SOURCE where owner in ('CMS_ADM','CMS_INTERFACE')
                                         and type in ('FUNCTION','PROCEDURE','PACKAGE BODY')
                                         and (instr(substr(trim(text),1,instr(trim(upper(text)),'(')-1),'FUNCTION') = 1 or instr(substr(trim(text),1,instr(trim(upper(text)),'(')-1),'PROCEDURE')=1)
           )-- ORDER BY OWNER,PROC,SUBPROC NULLS FIRST
    ) B
    ON (A.OWNER = B.OWNER AND A.TYPE = B.TYPE AND A.PROC=B.PROC AND NVL(A.SUBPROC,' ') = NVL(B.SUBPROC,' '))
    WHEN NOT MATCHED THEN
      INSERT (OWNER,TYPE,PROC,SUBPROC) VALUES (B.OWNER,B.TYPE,B.PROC,B.SUBPROC)
    WHEN MATCHED THEN
      UPDATE SET ACTIVE = ACTIVE;
    DELETE LOG_PARAM A
    WHERE NOT EXISTS (SELECT OWNER, TYPE
                 ,NAME PROC
                 , CASE NAME WHEN SUBNAME THEN NULL
                             ELSE SUBNAME
                   END SUBPROC
           FROM (
              SELECT owner,TYPE,NAME,upper(trim(substr(substr(trim(text),1,instr(trim(text),'(')-1),instr(substr(trim(text),1,instr(trim(text),'(')-1),' ')))) SUBNAME
                     FROM ALL_SOURCE where owner in ('CMS_ADM','CMS_INTERFACE')
                                         and type in ('FUNCTION','PROCEDURE','PACKAGE BODY')
                                         and (instr(substr(trim(text),1,instr(trim(text),'(')-1),'FUNCTION') = 1 or instr(substr(trim(text),1,instr(trim(text),'(')-1),'PROCEDURE')=1)
           ) WHERE A.OWNER = OWNER AND A.TYPE = TYPE AND A.PROC=PROC AND NVL(A.SUBPROC,' ') = NVL(SUBPROC,' '));
    COMMIT;
  EXCEPTION
    WHEN OTHERS THEN
      NULL;
  END ADD_LIST_PROC;
  PROCEDURE INITIALIZE
  AS
  BEGIN
    LIST_PARAM.DELETE;
    CLEAN;
--    ADD_LIST_PROC;
  EXCEPTION
    WHEN OTHERS THEN
      NULL;
  END INITIALIZE;
  PROCEDURE CLEAN
  AS
    PRAGMA AUTONOMOUS_TRANSACTION;
    dtTrcLog DATE;
    dtTrcErr DATE;
  BEGIN
    BEGIN
      SELECT dbdate-NUMTODSINTERVAL(to_number(PRM_VALUE),'DAY') INTO dtTrcLog
      FROM PARAM_TECHNIC WHERE PRM_TYPE = 'DEL_TRC_LOG';
    EXCEPTION
      WHEN OTHERS THEN
        dtTrcLog := dbdate -NUMTODSINTERVAL(sDelay,'DAY');
    END;
    BEGIN
      SELECT dbdate-NUMTODSINTERVAL(to_number(PRM_VALUE),'DAY') INTO dtTrcErr
      FROM PARAM_TECHNIC WHERE PRM_TYPE = 'DEL_TRC_ERR';
    EXCEPTION
      WHEN OTHERS THEN
        dtTrcErr := dbdate -NUMTODSINTERVAL(sDelay,'DAY');
      END;
    DELETE FROM ERROR_LOG WHERE ERR_TYPE ='LOG' AND ERR_DATE < dtTrcLog;
    DELETE FROM ERROR_LOG WHERE ERR_TYPE ='ERROR' AND ERR_DATE < dtTrcErr;
    COMMIT;
  EXCEPTION
    WHEN OTHERS THEN
      NULL; -- Do nothing if error occurs and catch exception
  END CLEAN;
  PROCEDURE RESETS(IN_SOURCE IN VARCHAR2 DEFAULT NULL)
  AS
    SOURCE_OWNER all_source.OWNER%TYPE;
    SOURCE_NAME      all_source.NAME%TYPE;
    SOURCE_LINE      all_source.LINE%TYPE;
    SOURCE_TEXT  all_source.TEXT%TYPE;
    SOURCE_PROC  VARCHAR2(32727);
  BEGIN
    OWA_UTIL.WHO_CALLED_ME(owner    => SOURCE_OWNER,
                           name     => SOURCE_NAME,
                           lineno   => SOURCE_LINE,
                           caller_t => SOURCE_TEXT);
    IF SOURCE_PROC IS NULL THEN
      SOURCE_PROC := SUBSTR(GET_PROC_NAME(SOURCE_OWNER,SOURCE_NAME,SOURCE_LINE),1,125);
    ELSE
      SOURCE_PROC := IN_SOURCE;
    END IF;
    LIST_PARAM.DELETE(SOURCE_PROC);
  EXCEPTION
    WHEN OTHERS THEN
      NULL;
  END RESETS;
  PROCEDURE PUT_LINE(TXT IN VARCHAR2)
  AS
    PRAGMA AUTONOMOUS_TRANSACTION;
    SOURCE_OWNER     all_source.OWNER%TYPE;
    SOURCE_NAME     all_source.NAME%TYPE;
    SOURCE_LINE     all_source.LINE%TYPE;
    SOURCE_TEXT all_source.TEXT%TYPE;
    SOURCE_PROC VARCHAR2(128); 
  BEGIN
    IF TXT IS NULL OR TXT = '' THEN
      RETURN;
    END IF;
    OWA_UTIL.WHO_CALLED_ME(owner    => SOURCE_OWNER,
                           name     => SOURCE_NAME,
                           lineno   => SOURCE_LINE,
                           caller_t => SOURCE_TEXT);
    SOURCE_PROC := GET_PROC_NAME(SOURCE_OWNER,SOURCE_NAME,SOURCE_LINE);
    IF LIST_PARAM.EXISTS(SOURCE_PROC) THEN
      LIST_PARAM(SOURCE_PROC)(LIST_PARAM(SOURCE_PROC).COUNT+1).ERR_TXT := TXT;
    ELSE 
      LIST_PARAM(SOURCE_PROC)(1).ERR_TXT := TXT;
    END IF;
  EXCEPTION
    WHEN OTHERS THEN
      NULL;   
  END PUT_LINE;
  PROCEDURE LOGS(REF_TYPE IN VARCHAR2 DEFAULT 'SITE', REF_VALUE IN VARCHAR2 DEFAULT '99')
  AS
    PRAGMA AUTONOMOUS_TRANSACTION;
    MASTER_VALUE ERROR_LOG.ERR_MASTER%TYPE;
    SITE PARAMTAB.SITE_CODE%TYPE;
    SOURCE_OWNER     all_source.OWNER%TYPE;
    SOURCE_NAME     all_source.NAME%TYPE;
    SOURCE_LINE     all_source.LINE%TYPE;
    SOURCE_TEXT all_source.TEXT%TYPE;
    SOURCE_PROC VARCHAR2(128);
    ERR_KEY NUMBER;
  BEGIN
--    NULL;
    OWA_UTIL.WHO_CALLED_ME(owner    => SOURCE_OWNER,
                           name     => SOURCE_NAME,
                           lineno   => SOURCE_LINE,
                           caller_t => SOURCE_TEXT);
    SOURCE_PROC := SUBSTR(GET_PROC_NAME(SOURCE_OWNER,SOURCE_NAME,SOURCE_LINE),1,128);
    LIST_PARAM.DELETE(SOURCE_PROC);
--    SELECT NVL(MAX(ACTIVE),'N') INTO LOG_TRC FROM LOG_PARAM WHERE TRIM(UPPER((PROC||'.'||SUBPROC))) = TRIM(UPPER(SOURCE_PROC))
--                                      AND OWNER =SOURCE_OWNER AND TYPE = SOURCE_TEXT ;
--    IF LOG_TRC = 'N' THEN
--      LIST_PARAM.DELETE(SOURCE_PROC);
--      RETURN;
--    END IF;   
--    SELECT_MASTER(REF_TYPE => UPPER(REF_TYPE), PARAM_VALUE => REF_VALUE, SITE => SITE, REF_MASTER => MASTER_VALUE);
--    ERR_KEY := TO_CHAR(LOCALTIMESTAMP,'YYYYMMDDHH24MISSFF6');
--    FOR AIX IN 1..LIST_PARAM(SOURCE_PROC).COUNT LOOP
--      INSERT INTO ERROR_LOG (ERR_KEY, ERR_SITE,ERR_SLAVE  ,ERR_MASTER  ,ERR_TYPE ,ERR_PROC,ERR_DATE,ERR_TXT)
--      VALUES (ERR_KEY,SITE,REF_VALUE,MASTER_VALUE,'LOG',SOURCE_PROC,LIST_PARAM(SOURCE_PROC)(AIX).ERR_DATE ,LIST_PARAM(SOURCE_PROC)(AIX).ERR_TXT);
--    END LOOP; 
--    UPDATE SESSION_CONTEXT SET SCX_ERR_KEY = ERR_KEY WHERE SCX_ID = SYS_CONTEXT('USERENV','SESSIONID');
--    LIST_PARAM.DELETE(SOURCE_PROC);
--    COMMIT;
  EXCEPTION
    WHEN OTHERS THEN
      LIST_PARAM.DELETE(SOURCE_PROC);
  END LOGS;
  PROCEDURE ERRORS(REF_TYPE IN VARCHAR2 DEFAULT 'SITE', REF_VALUE IN VARCHAR2 DEFAULT '99', ERR_CODE IN NUMBER DEFAULT SQLCODE, ERR_MSG IN VARCHAR2 DEFAULT SQLERRM)
  AS
    PRAGMA AUTONOMOUS_TRANSACTION;
    MASTER_VALUE ERROR_LOG.ERR_MASTER%TYPE;
    SITE         PARAMTAB.SITE_CODE%TYPE;
    SOURCE_OWNER all_source.OWNER%TYPE;
    SOURCE_NAME      all_source.NAME%TYPE;
    SOURCE_LINE      all_source.LINE%TYPE;
    SOURCE_TEXT  all_source.TEXT%TYPE;
    SOURCE_PROC  VARCHAR2(4000);
    ERR_KEY NUMBER := TO_CHAR(LOCALTIMESTAMP,'YYYYMMDDHH24MISSFF6');
  BEGIN
    OWA_UTIL.WHO_CALLED_ME(owner    => SOURCE_OWNER,
                           name     => SOURCE_NAME,
                           lineno   => SOURCE_LINE,
                           caller_t => SOURCE_TEXT);
    SOURCE_PROC := SUBSTR(GET_PROC_NAME(SOURCE_OWNER,SOURCE_NAME,SOURCE_LINE),1,125);
    SELECT_MASTER(REF_TYPE => UPPER(REF_TYPE), PARAM_VALUE => REF_VALUE, SITE => SITE, REF_MASTER => MASTER_VALUE);
   IF LIST_PARAM.EXISTS(SOURCE_PROC) THEN
      FOR AIX IN 1..LIST_PARAM(SOURCE_PROC).COUNT LOOP
        INSERT INTO ERROR_LOG (ERR_KEY,ERR_SITE,ERR_SLAVE,ERR_MASTER,ERR_PROC,ERR_DATE,ERR_TXT,ERR_CODE,ERR_MSG)
        VALUES (ERR_KEY,SITE,REF_VALUE,MASTER_VALUE,SOURCE_PROC,LIST_PARAM(SOURCE_PROC)(AIX).ERR_DATE, LIST_PARAM(SOURCE_PROC)(AIX).ERR_TXT,ERR_CODE,ERR_MSG);
      END LOOP; 
     LIST_PARAM.DELETE(SOURCE_PROC);
    ELSE
      INSERT INTO ERROR_LOG (ERR_KEY,ERR_SITE,ERR_SLAVE,ERR_MASTER,ERR_PROC,ERR_DATE,ERR_TXT,ERR_CODE,ERR_MSG)
      VALUES (ERR_KEY,SITE,REF_VALUE,MASTER_VALUE,SOURCE_PROC,CURRENT_TIMESTAMP,'Error info',ERR_CODE,ERR_MSG);
    END IF;
    UPDATE SESSION_CONTEXT SET SCX_ERR_KEY = ERR_KEY WHERE SCX_ID = sys_context('usr_context', 'session_id');
    COMMIT;
  EXCEPTION
    WHEN OTHERS THEN
      LIST_PARAM.DELETE(SOURCE_PROC);
  END ERRORS;
END PAC_LOG_ERROR;

This package is always call. On each routines performed I execute it. In the trace log of the database we have see a problem we the procedure GET_PROC_NAME in the package. We have identify that is called more that 800x and increase the performance. Who increase is this select command :
    SELECT * INTO SOURCE_TEXT
    FROM (SELECT TEXT FROM all_source
        WHERE OWNER = SOURCE_OWNER AND
              NAME=SOURCE_NAME AND
              TYPE IN ('PROCEDURE','FUNCTION','PACKAGE BODY') AND
              LINE <= SOURCE_LINE AND SUBSTR(TRIM(TEXT),1,9) IN ('PROCEDURE','FUNCTION ')
        ORDER BY LINE DESC)
    WHERE ROWNUM = 1;Complex SQL like inline views and views of views can overwhelm the cost-based optimizer resulting in bad execution plans. Start with getting an execution plan of your problem query to see if it is inefficient - look for full table scans in particular. You might bet better performance by eliminating the IN and merging the results of 3 queries with a UNION.

Similar Messages

  • TS3798 I get this error message"your operation could not be completed" I need help figuring out why I can not access the web page.

    I get this error message"your operation could not be completed" I need help figuring out why I can not access the web page.

    amarilysfl wrote:
    "Your disk could not be partitioned. An error occurred while partitioning the disk".
    https://www.apple.com/support/bootcamp/
    If you were using Apple's BootCamp and received this message, quit it and open Disk Uility in your Applicaitons/Utilities folder.
    Select the Macintosh HD partition on the left and select Erase and Erase Free Space > Zero option and let it complete (important) this will check the spare space for bad sectors that can cause issues formatting partitions.
    Once it's completed, try creating a partiton again in BootCamp.
    If that doesn't work, then hold command option r keys down while connected to a fast internet connection, Internet Recovery should load (spinning globe) and then in that Disk Utility, select your entire internal drive and click > First Aid > Repair Disk and Permissions.
    reboot and attempt Bootcamp again.
    If you still get a error, it might be that you have OS X data on the bottom area where BootCamp partition needs to go. This would occur if you had the drive or computer for a long time or wrote a large amount of files to the drive and nearly filling it up and then reduced some, but it left traces in the area BootCamp needs to go.
    To fix this
    BootCamp: "This disc can not be partitioned/impossible to move files."
    How to safely defrag a Mac's hard drive

  • Yosemite made my MacBook Pro so slow !! Need help ? what is the solution?

    Yosemite made my MacBook Pro so slow !! Need help ? what is the solution?

    I've ran a benchmark on my Mac (iMac early 2009). Performance of Yosemite in general was about the same as Mavericks. But that can be different on other Mac's of course. Safari is mostly a bit slower. It's recommended you clean your old internet-caches and then restart Safari. (you can use a little app called CCleaner to do that). That might make a difference. Speed-issues are usually solved in the first and second update of OS X.

  • Can someone else try to compile this and see why the program is returning..

    Can someone else try to compile this and see why the program is returning "false" when I try to delete the files on exit (at bottom of code)... I have the source code uploaded to the web as well as my 2 text test files inside a zip file(they need to be unzipped so you can try to test the program) and .class file... the program works the way i want it to, but i just can't seem to delete the 3 temporary files i use... why??? why does it return false???
    Thanks in advance,
    Disco Hristo
    http://www.holytrinity-holycross.org/DiscoHristo/Assemble.java
    http://www.holytrinity-holycross.org/DiscoHristo/Assemble.class
    http://www.holytrinity-holycross.org/DiscoHristo/tests.zip
    * Assemble.java 1.0 02/06/22
    * @author Disco Hristo
    * @version 1.0
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    public class Assemble
         public static void main(String args[]) throws IOException
              if (args.length > 0) //     Checks to see if there are any arguments
                   printArgumentInfo ();
              else // if no arguments run the program
                   getInput ();
                   printToFile ();
                   deleteFiles ();
         public static void getInput () throws IOException
         //     Gets the input and then send it to 3 files according to Tags
              File head = new File ("head.chris");
    PrintStream headStream = new PrintStream (new FileOutputStream (head));
    File body = new File ("body.chris");
    PrintStream bodyStream = new PrintStream (new FileOutputStream (body));
    File foot = new File ("foot.chris");
    PrintStream footStream = new PrintStream (new FileOutputStream (foot));
    String input; //     String used to store input                
    File d = new File(".");
    String files[] = d.list();
    for (int n=0; n!=files.length; n++)
         if (files[n].endsWith(".txt") == true)
              String fileName = files[n];
              BufferedReader in = new BufferedReader (new FileReader(fileName));
                   while (true)
                   input = in.readLine();
                   if (input != null)
                        input = input.trim();
                        if (input == null) // if no more input                          
                             break;
                        else if ( (input.compareTo("<HEAD>")) == 0) // if start of <HEAD> text
                             do
                                  input = in.readLine();
                                       if (input != null)
                                       input = input.trim();
                                       if ( ((input.compareTo("<BODY>")) == 0) ||
                                                      ((input.compareTo("<FOOT>")) == 0) ||
                                                      ((input.compareTo("</BODY>")) == 0) ||
                                                      ((input.compareTo("</FOOT>")) == 0) ||
                                                      ((input.compareTo("<HEAD>")) == 0))
                                                      //checks to see if tags in input are in correct order
                                            System.out.println("Input Is Incorrectly Formatted - Tag Error");
                                            System.out.println("Close your <HEAD> tag before starting another tag.");
                                            System.exit(1); //exit program without printing data                                                   
                                       if ( (input.compareTo("</HEAD>")) != 0) //if not end of tag
                                            headStream.println(input); //print to text file
                             while ( (input.compareTo("</HEAD>")) != 0);
                        else if ( (input.compareTo("<BODY>")) == 0) // if start of <BODY> text
                             do
                                  input = in.readLine();
                                  if (input != null)
                                       input = input.trim();
                                       if ( ((input.compareTo("<HEAD>")) == 0) ||
                                                      ((input.compareTo("<FOOT>")) == 0) ||
                                                      ((input.compareTo("</HEAD>")) == 0) ||
                                                      ((input.compareTo("</FOOT>")) == 0) ||
                                                      ((input.compareTo("<BODY>")) == 0))
                                                      //checks to see if tags in input are in correct order
                                            System.out.println("Input Is Incorrectly Formatted - Tag Error");
                                            System.out.println("Close your <BODY> tag before starting another tag.");
                                            System.exit(1); //exit program without printing data                                                   
                                       if ( (input.compareTo("</BODY>")) != 0) //if not end of tag
                                            bodyStream.println(input); //print to text file
                             while ( (input.compareTo("</BODY>")) != 0);
                             else if ( (input.compareTo("<FOOT>")) == 0) // if start of <FOOT> text
                                  do
                                  input = in.readLine();
                                  if (input != null)
                                       input = input.trim();
                                       if ( ((input.compareTo("<BODY>")) == 0) ||
                                            ((input.compareTo("<HEAD>")) == 0) ||
                                                 ((input.compareTo("</BODY>")) == 0) ||
                                                 ((input.compareTo("</HEAD>")) == 0) ||
                                                 ((input.compareTo("<FOOT>")) == 0))
                                                 //checks to see if tags in input are in correct order
                                            System.out.println("Input Is Incorrectly Formatted - Tag Error");
                                            System.out.println("Close your <FOOT> tag before starting another tag.");
                                            System.exit(1); //exit program without printing data                                                   
                                       if ( (input.compareTo("</FOOT>")) != 0) //if not end of tag
                                                 footStream.println(input); //print to text file
                             while ( (input.compareTo("</FOOT>")) != 0);
                   else
                        break;
    public static void printToFile () throws IOException
    // Prints the text from head.txt, body.txt, and foot.txt to the output.log
         File head = new File ("head.chris");
         FileReader headReader = new FileReader(head);
              BufferedReader inHead = new BufferedReader(headReader);
              File body = new File ("body.chris");
              FileReader bodyReader = new FileReader(body);
              BufferedReader inBody = new BufferedReader(bodyReader);
              File foot = new File ("foot.chris");
              FileReader footReader = new FileReader(foot);
              BufferedReader inFoot = new BufferedReader(footReader);
              PrintStream outputStream = new PrintStream (new FileOutputStream (new File("output.log")));
              String output;     //string used to store output
              while (true)
                   output = inHead.readLine();
                   if (output == null) //if no more text to get from file
                   break;
                   else
                        outputStream.println(output); // print to output.log
              while (true)
                   output = inBody.readLine();
                   if (output == null)// if no more text to get from file
                   break;
                   else
                        outputStream.println(output); // print to output.log
              while (true)
                   output = inFoot.readLine();
                   if (output == null) //if no more text to get from file
                   break;
                   else
                        outputStream.println(output); // print to output.log
              //Close up the files
              inHead.close ();
              inBody.close ();
              inFoot.close ();
              outputStream.close ();     
         public static void printArgumentInfo () //     Prints argument info to screen
              System.out.println("");
              System.out.println("Disco Hristo");
              System.out.println("");
              System.out.println("Assemble.class is a small program that");
              System.out.println("takes in as input a body of text and then");
              System.out.println("outputs the text in an order according to");
              System.out.println("the tags that are placed in the input.");
         public static void deleteFiles ()
              File deleteHead = new File ("head.chris");
              File deleteBody = new File ("body.chris");
              File deleteFoot = new File ("foot.chris");
              deleteHead.deleteOnExit();
              deleteBody.deleteOnExit();
              deleteFoot.deleteOnExit();
    }

    I tired your program, it still gives false for files deleted. I tool the same functions you used in your program and ran it. The files get deleted. Tried this :
    <pre>
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    public class FileTest {
         public static void main(String args[]) {
              FileTest f = new FileTest();
              try {
                   f.createFile();
                   f.deleteFile();
              } catch(IOException ioe){
                   System.out.println(ioe.getMessage());
         public void createFile() throws IOException {
              System.out.println("In create file method...");
              File test = new File("test1.txt");
              File tst = new File("text2.txt");
              PrintStream testStream = new PrintStream (new FileOutputStream (test));
              PrintStream tstStream = new PrintStream (new FileOutputStream (tst));
              testStream.println("this is a test to delete a file");
              tstStream.println("this is the second file created");
              testStream.close();
              tstStream.close();          
         public void deleteFile() throws IOException {
              File test = new File("test1.txt");
              File tst = new File("text2.txt");
              System.out.println(test.delete());
              System.out.println(tst.delete());
    </pre>
    Also check the starting and closing braces for your if..else blocks.
    -Siva

  • HT1430 guys, I need help, im trying to the the new software IOS 7.0 and it requires 3.7 GB free space. im using the IPhone4 and it had 6.4 GB capacity. i've deleted so much and it still says I only have 1.4 GB, I dont understand where the 5GB are being us

    guys, I need help, im trying to the the new software IOS 7.0 and it requires 3.7 GB free space. im using the IPhone4 and it has 6.4 GB capacity. i've deleted so much and it still says I only have 1.4 GB, I dont understand where the 5GB are being used.
    has any one experienced that? I cancelled my icloud account coz i tot the 5GB where there. im so confused. please help.
    Dee

    First thing to try is to reset your device. Press and hold the Home and Sleep buttons simultaneously ignoring the red slider should one appear until the Apple logo appears. Let go of the buttons and let the device restart. See if that fixes your problem.

  • I actually need help but cannot find the answer. Please.......Lately when open a new tab it does not open with a blank page. I don't want to set my homepage as

    I actually need help but cannot find the answer.
    Please.......Lately when open a new tab it does not open with a blank page. I don't want to set my homepage as blank as when I first open Firefox, it automatically loads my hotmail page. But then if I open other pages I don't get a blank page. Help, please?
    Thank you.
    ''[Personal information removed by moderator. Please read [[Forum and chat rules and guidelines]], thanks.]''

    hello, please refer to [[New Tab Page – show, hide and customize top sites]] in order to switch the feature off.

  • I buy for mac app but not for the iPad, so how do I reinstall a program that has already purchased? I need help because I bought the imovie'11 but when he opened it only brought 8 movie trailer templates instead of the 15 it says on the program. How do I

    I buy for mac app but not for the iPad, so how do I reinstall a program that has already purchased? I need help because I bought the imovie'11 but when he opened it only brought 8 movie trailer templates instead of the 15 it says on the program. How do I solve this problem? Once paid for a program incomplete. I also liked that the AppStore itself had a button to reinstall programs already bought, because it is very hard to understand how to do this in the store, only option is to install and hide purchase, and how do I reinstall, attention'm talking about reinstalling a computer mac, not an ipad or iphone.
    Thank you.

    Prodesigntools.com , go ahead and download the software from there and use your serial number to serialize it.

  • I need help in finding all the new fontsin iPad 2 using iOS  5

    I need help in finding all the new fonts in ipad 2 using ios 5

    You cannot change the email font. You can make it bold, italics and underline the type, but Helvetica is your only choice in the mail app.
    In the notes app you have 3 choice Noteworthy, Helvetica and Marker Felt. The font can be changed in Settings>Notes>Font.
    You can only use fonts that are built into the app that you are using at the time. You cannot pick and choose fonts from a list of all of the fonts that may be on the iPad but only from the list of fonts that the app allows.

  • I need help! I updated the new 6.1.3 last night. Since that time my phone will not charge. The phone is plugged in and shows as charging but the battery still drains. What can I do? I need help!

    I need help! I updated the new 6.1.3 last night. Since that time my phone will not charge. The phone is plugged in and shows as charging but the battery still drains. What can I do? I need help!

    Restore iPhone with iTunes on your computer.

  • I need help quick please sold the iPod and before handing it over wanted to clear out info so pushed erase now there is only a plug icon for iTunes but it won't now recognize my computer what can I do??

    I need help quick please sold the iPod and before handing it over wanted to clear out info so pushed erase now there is only a plug icon for iTunes but it won't now recognize my computer what can I do??

    Try
    iOS: Device not recognized in iTunes for Windows
    or
    iPhone, iPad, iPod touch: Device not recognized in iTunes for Mac OS X

  • I had to put my computer by together without migration or time machine I NEED help with order of the files?

    I had to put my computer by together without migration or time machine I NEED help with order of the files?

    Hi, where are these other files exactly?

  • Need help with passcode using the "Remote" app

    Hello and thanks in advance. I can't find a place on iTunes to enter the passcode from the Remote app.

    PLEASE READ!!!
    I have a HP Pavilion - Windows XP
    I need help as well with the passcode. I went to Networking and Sharing center and clicked customize and changed the name to NetGear because that is what it says next to my WiFi on my iPhone but with my iPhone under Settings it says WiFi NETGEAR > but when I click on it, it says choose a Network. Is NETGEAR a network? How do I find or change to a Network? is this the problem?

  • Hi i need some help im having problems the ipod can not be turned , in fact it was working fine but suddenly switched off and did not return to light n because it reconnected and if I had drums

    hi i need some help im having problems , the ipod can not be turned , in fact it was working fine but suddenly switched off and did not return to light n because it reconnected and if I had drums  . what can i do to turned on .
    its an ipod touch 64gb

    That symptom is covered here:
    iPod touch: Hardware troubleshooting

  • I Need help!!! The card I used when I first set up my account I lost it so now I can't download any music cause it's wanting a number of that card I lost... Someone tell me what I can do???

    I Need help!!! The card I used when I first set up my account I lost it so now I can't download any music cause it's wanting a number off that card and I don't have it anymoe... Someone tell me what to do please???

    Add another good card and delete the old one, Yu can also purchase and redeem an iTunes gift card and hthen delee the bad credit card.  Yu need a valid payment method for update as well even purchasing free apps if the account was set up with a credit card.

  • I need help! I have the iphone 5 and I want to buy the whastsaap, but it turns out I get to put the answers up and answer the questions but I do not remember. Someone could help me? Help! Thank you!

    I need help! I have the iphone 5 and I want to buy the whastsaap, but it turns out I get to put the answers up and answer the questions but I do not remember. Someone could help me? Help! Thank you!

    Security questions:
    https://discussions.apple.com/thread/4533485?tstart=0

Maybe you are looking for