Unpredictable Program Behaviour

Hi there,
I'm pulling my hair out with this and I thought I'd see if the greater Java experience of others might be able to shed some light on the problem. There is a large amount of program code I have written, which is itself within a larger project so I can't simply post it. However, I will outline the problem...
The issue:
My code does not return predicatble results from a simulation. Each time the simulation is run, various statistics are recorded. Despite the fact that the code is identical (!), the results produced differ between executions.
Things I am pretty sure are not a problem (although if you think there's a "gotcha" please shout out):
- A random number generator is used but it is seeded with the same value each time.
- The program is single threaded so race conditions should not be an issue.
- Behaviour occurs in both debug mode, standalone jar and normal execution from the IDE (I'm using eclipse).
- Static members are used between objects in lists. The for-each construct is used, but this should execute in the same order each time.
- In the case of sorting the lists just mentioned, Collections.sort() is utilised and so should be stable (again, lists should be ordered in the same order)
Can anyone think of something I might be overlooking here? This seems unfathomable at the moment!
Thanks!

JavaDev12345 wrote:
If I could minimise the problem to a short, self contained, correct example that would fit into a forum post then I wouldn't need to be asking - I would debug it myself and rewrite the offending section!So asking a bunch of people who have no access to any of your code seems like a more reasonable approach? What did you expect to happen?
I am asking for general advice for something I may have overlooked, from people who may have experienced something like this before. You haven't even really described what "something like this" is. "Unpredictable results" is about as helpful as saying "my program doesn't work". Even assuming we could (or would) magically tell you what your problem is, you really think you've provided enough information?
There can't be that many ways to introduce unpredictability into a program.Then it shouldn't take that long to track down, neh? Add some print statements to see where your "results" start becoming "unpredictable". Or use a debugger. Either of those approaches is going to be much more effective than the one you've taken so far.

Similar Messages

  • Forms 6i: Unpredictable LOV behaviour

    Hi,
    I'm trying to modify a forms 6i LOV to return a list of custodians based on information that is in the form at this time. The form is tabbed, and the tab I'm using has multiple records - with an LOV in each record. The problem I'm having is that sometimes the LOV will return a long list of custodians, sometimes just a couple, and sometimes none (no data found). Furthermore I always get the same result for each record, even if that record has a different status (HGF,GVS,Project) - A Pool status is supposed to return no results in the LOV, and I have structured the query such, but it returns the same results as the other records.
    I thought maybe the LOV wasn't reading the values right from the active record, so I made some temp fields and created an LOV button that first copied the fields of interest from the active record into temp fields located at the bottom, and the called the List_Values, but the LOV displayed exactly the same behaviour. With the current code, listed below, I get a long list of custodians returned by the LOV regardless of which record's LOV I activate.
    The code below is the original code without putting in the temp fields. I hope someone can explain why the LOV is behaving like this, and help me to resolve the problem. Here is the code for my LOV:
    SELECT distinct RTRIM(surname) || ', ' || given_names name, v.custodian
    FROM vbm_hr_emp_driver c, VBM_CUSTODIAN v, VBM_CUSTODIAN vc
    WHERE c.employee_no = v.custodian
    AND :VBM_VEHICLE_STATUS.STATUS IN ('HGF','GVS','Project')
    AND vc.custodian = v.custodian and vc.status = :VBM_VEHICLE_STATUS.STATUS
    AND TO_DATE(TO_CHAR(:VBM_VEHICLE_STATUS.FROM_DATE,'dd-MON-yyyy hh24:mi'),'dd-MON-yyyy hh24:mi') >= vc.from_date
    AND (TO_DATE(TO_CHAR(:VBM_VEHICLE_STATUS.FROM_DATE,'dd-MON-yyyy hh24:mi'),'dd-MON-yyyy hh24:mi') < vc.to_date
    OR vc.to_date IS NULL)
    AND (TO_DATE(TO_CHAR(:VBM_VEHICLE_STATUS.TO_DATE,'dd-MON-yyyy hh24:mi'),'dd-MON-yyyy hh24:mi') < vc.to_date
    OR TO_DATE(TO_CHAR(:VBM_VEHICLE_STATUS.TO_DATE,'dd-MON-yyyy hh24:mi'),'dd-MON-yyyy hh24:mi') IS NULL)
    ORDER BY Name
    Is it that LOV's can't be dynamic - ie: they have a predetermined list of results that can't be changed by variables? Please help as this is driving me mad.
    Thanks
    Adam

    AND TO_DATE(TO_CHAR(:VBM_VEHICLE_STATUS.FROM_DATE,'dd-MON-yyyy hh24:mi'),'dd-MON-yyyy hh24:mi')
    >= vc.from_date
    AND (TO_DATE(TO_CHAR(:VBM_VEHICLE_STATUS.FROM_DATE,'dd-MON-yyyy hh24:mi'),'dd-MON-yyyy hh24:mi')
    < vc.to_date
    OR vc.to_date IS NULL)
    AND (TO_DATE(TO_CHAR(:VBM_VEHICLE_STATUS.TO_DATE,'dd-MON-yyyy hh24:mi'),'dd-MON-yyyy hh24:mi')
    < vc.to_date
    OR TO_DATE(TO_CHAR(:VBM_VEHICLE_STATUS.TO_DATE,'dd-MON-yyyy hh24:mi'),'dd-MON-yyyy hh24:mi') IS NULL)
    That is a terrible mess for date comparison. This is equivalent:
        AND  :VBM_VEHICLE_STATUS.FROM_DATE >= vc.from_date
        AND (:VBM_VEHICLE_STATUS.FROM_DATE  < vc.to_date
                                           OR vc.to_date IS NULL)
        AND (   :VBM_VEHICLE_STATUS.TO_DATE < vc.to_date
             OR :VBM_VEHICLE_STATUS.TO_DATE IS NULL)

  • Strange program behaviour

    I'm testing my application on 3 different linux machines. I use the exact same java configuration on all three of them. But only on one of them my application will work.
    On the other two I get the following exception
    Error occurred in server thread; nested exception is:
    java.lang.NoClassDefFoundError: weka/core/Instances
    java.rmi.ServerError: Error occurred in server thread; nested exception is:
    java.lang.NoClassDefFoundError: weka/core/Instances
    at java.rmi.Naming.rebind(Unknown Source)
    at be.ugent.psb.grid.server.WekaServerDaemonImpl.<init>(WekaServerDaemon
    Impl.java:86)
    at be.ugent.psb.grid.server.WekaServerDaemonImpl.main(WekaServerDaemonIm
    pl.java:66)
    Caused by: java.lang.NoClassDefFoundError: weka/core/Instances
    at java.lang.Class.getDeclaredMethods0(Native Method)
    I start my application with the following command:
    java -Xmx1500m -ea -Djava.rmi.server.codebase="http://myhost.com/~username/server.jar http://myhost.com/~username/weka.jar" -Djava.security.policy=policy -cp .:weka.jar:jcommon.jar:junit.jar:jfreechart.jar server.WekaServerDaemonImpl
    The file http://myhost.com/~username/weka.jar contains the weka.core.Instances.
    The strange thing is that this works on 1 of the 3 machines, but not on the others.
    Anyone any clues on what I'm doing wrong.

    Kai,,
             many thanks for the reply.
    You said :
    So when you check it the prog is executed in a test mode and does not really chenge the status. This way you can do a test and make sure no errors happen during execute.
    But then if i execute the program in test mode.... what experience am I gaining???I mean it is a 3 step prosess, 1. we put the name of prog in se38 and trigger it, 2. we get a selection screen where we put necessary details like idoc name, messege type and check / uncheck TEXT button, and then execute it,. In the 3. step, we get a messege 1/ 0 idocs converted,, so i mean this test thing really looks a unwanted application, really does not do me any benifit!!
       pls correct me!!!
    Regards,
    Arnab,

  • Unpredictable font behaviour in InDesign

    Hi folks.
    I'm experiencing a weird recurring font problem within InDesign CS3 and CS4.
    I'm copying some text (Meta LF - Postscript) from advert A to advert B and the text keeps changing to the non-LF version of the font.
    Here's the list of things that I have tried so far:
    1. I removed the non-LF version from my machine but it still converts to the LF version but now sees it as missing.
    2. Removed the font cache from within Extensis Universal Type Server and reinstalled all my fonts.
    3. Exported the file as an InDesign Interchange file to see if it cleared any corruption.
    4. Pasted the same text from advert A into a new document and it worked fine.
    5. Pasted advert B into a new document. Copied the text from advert A in but still getting the same problem.
    6. Pasted advert B into a new document deleted advert B and then pasted the text from advert A in again. Still getting the same problem.
    PLEASE HELP!!!!!!!!
    I'm gradually going insane!
    Gordon
    This is occurring on multiple machines. G5s & MacPros running Mac OS 10.4 & 10.5, InDesign CS3 (simualted the same problem in CS4) and running Extensis Universal Type server. Meta Postscript font from FontShop International.

    Starting with the obvious, have you looked at the Paragraph or Character Styles panels for these documents?

  • Abort system error in program SAPLRSS2 and form MULTI_ASSIGN-01-

    After executing a query with RSRT, I got an error message: "Abort system error in program SAPLRSS2 and form MULTI_ASSIGN-01-".
    The error appeared first after patching the SAP BW with the Enhancement Package 1 to version 7.01.
    I found the note 1593976 concerning this problem. But installing the note didn't help.
    I set a breakpoint at the "PERFORM MULTI_ASSIGN" - statement in the function module "RRS_GVAR_FROM_VREP_FILL" where the exception is thrown.
    I compared the code of the form with the older version of the form.
    Current version (7.01):
    ASSIGN COMPONENT l_s_fieldname OF STRUCTURE c_sx_gvar TO <l_gvar_table>.
    IF sy-subrc NE 0. PERFORM x_message USING rs_c_true 'MULTI_ASSIGN-01-'. ENDIF.
    Older version (7.00):
      ASSIGN COMPONENT L_FIELDNAME OF STRUCTURE C_SX_GVAR TO <L_GVAR_TABLE>.
    check sy-subrc eq 0.
    The newer version raises an error message where the older version only left the form. So I simulated the old program behaviour by jumping over the 2 occurences of the "PERFORM MULTI_ASSIGN" - statement, because the form doesn't do any changes anyway, when it is left right after the call. The query then seems to be executed properly.
    I don't know whether the raising of a message is correct here and I already did something wrong in the old version, which hasn't been detected since EnhP 1 or if the raising of a message is not appropriate here. May you help me out in this situation ?

    Thanks! That really helped me out. I thought, I already regenerated the query report. But it seems it has not been the case.

  • PSE 8 Organizer Troublesome

    PSE Organizer is not the first photo organizer I have ever used, but thought it might be a suitable tool since PSE appeared to be the editing program for my needs.
    There have been numerous criticisms leveled at PSE Organizer, and at first I thought many were exaggerations or jusr sour grapes; but having worked with it for nearly six months, with a collection exceeding 10,000 images, I am concluding much of the criticism is well founded.
    Many features work haphazardly, unpredictably or periodically, sometimes requiring a reboot in order to activate them.  Then there is the intermittent on and intermittent off capability of version importation that whimsically appears to enable and disable itself.
    Furthermore, Organizer in its whimsical behaviour will periodically refuse to recognize images of the filetype and size it recognized moments ago from the identical source, stating the image is not of a type recognized by PSE  (JPG???)
    Now Organizer refuses to display images it labels as "File too Large" when similar files of the same filetype and smaller size are displayed right next to it.
    My patience with Organizer has just about run out, because like most of us, I cannot afford the time to deal with unpredictable software behaviour.
    I now regret having abandoned Thumbs Plus, that worked flwlessly as an organizer and has a much more powerful functionality.

    John, I have a total of seven people tags and thanks for the advice.  It's not a keyword tag issue.
    But, hallelujah, I have found the problem!  It's the 'Folder Location View'.  Stay out of it!  It turns a face tagging from a half second task to a 65 second task.  It appears that, when in the Folder Location View, after you complete a task like face tagging PSE will then go off and re-read (for 65 seconds) all your Windows folders and regenerate the folder view.  When you switch to the Thumbnail View and do the face tag then PSE comes right back immediately.  I was able to recreate this scenario several times.  Each task I did in Folder Location View took 65 seconds or more.  The same task in Thumbnail View takes half a second tops.

  • Firefox 34.0.5 says Adobe Flash plugin is blocked, but update check reports my Flash plugin (ver. 16.0.0.235) is current. How to fix???

    About 1 month ago, I updated Flash and Firefox to most current versions. Firefox 34.0.5, running on WinXP, SP3, shows Adobe Flash plugin as ver. 16.0.0.235, but this is now being blocked again. No other versions of Flash are evident. When I choose option on Flash screen to check plugins are up to date, Firefox reports Flash plugin is up to date.
    This program behaviour is wrong and should be fixed. Checking at Adobe, current Flash is 16.0.0.305.
    Who or what is broken here? Is Firefox broken, and not reporting correctly that more current Flash plugin is available?
    I do not appear to have previous versions of Flash installed on system. This combo of software was working correctly for a while, and then became broken, without a proper path to allow users to resolve it. If Firefox is rigged to "Block" a plugin, then it *MUST* be configured to easily and **CORRECTLY** allow that plugin to be updated. Using most current software, my clicking on the "Check for updates" feature reports that Adobe Flash is most current version. Arrrrgh!!
    I am now back to "diagnose and fix broken Firefox+Flash" exercise, which I just went thru.
    Best solution here would be to allow user to easily override the "blocking" mechanism. This would assist users who only use Flash video access on trusted sites.
    If there is an obvious solution to this current Flash "BLocking" goofery, please inform. Otherwise, if and when I resolve this, I will post a reply to my own question here, indicating what I did to fix this, as it appears to be affecting other Firefox+Flash users, without a clear solution being posted.

    Adobe issued 3 new Flash 16 versions in January alone, then another new one - .305 - in February, ''along with one in early December. Five new versions in 2 months time''. So with updating Flash "about 1 month ago", you are probably 2 or 3 versions behind the latest Flash 16 version.
    Note that Adobe has its own internal updater, which by default is set to check for an update ''(only)'' once a month. Adobe does their own updates for their software, Firefox just tells you when your version is on the blocklist due to known security issues with the version you have installed. It is up to you to do a manual update between the monthly update check that Flash does for your installation.
    The "solution" is for Adobe to fix their stuff. Like maybe an updater that checks for updates more frequently, and not hide their updater user preferences where users don't know where they are and be able to set it for more a frequent update check cycle. ''[Firefox "checks" every time Firefox is launched, as does Chrome]''. Or fix the code in Flash that leads to it being so exploitable, and not have to do 5 separate security fixes in as little as a 2 month time span. ''Flash went almost 2 years prior to Dec 2014 without Mozilla needing to blocklist it, and when Mozilla did first blocklist it in Dec it was / is a soft-block where the user can still use it by using Allow per Flash presentation.''
    My advice is to grab the Extended Support Release - Flash Player 13.0.0.269 from here - https://www.adobe.com/products/flashplayer/distribution3.html - over 3/4 down that page. IMO the best version for WinXP users, as the later versions have features for Vista and later versions of Windows - won't work on WinXP or may cause problems on WinXP.

  • Problem with socket responses with flex

    Hi, I am using the code below to connect to an IMAP server.
    When I telnet to the server and use the commands that I am sending in the code, the rsponses are correct.
    However, when I run the code below, I only obtain the ready and logged in responses as shown below.
    Any ideas why I am not receiving the full set of responses from the socket?
    Thanks in advance fro your advice.
    The following is the output from the code:
    +++++++++++++++++ START SENDING IMAP DATA +++++++++++++++++++++++++
    sent: . login user1 myPassword
    sent: . status INBOX (messages)
    sent: . select INBOX
    +++++++++++++++++ END SENDING IMAP DATA +++++++++++++++++++++++++
    ++++++++ [IMAP START]
    Response is: * OK Dovecot ready.
    [IMAP END] +++++++++
    ++++++++ [IMAP START]
    Response is: . OK Logged in.
    [IMAP END] +++++++++
    The code is:
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:mx="library://ns.adobe.com/flex/mx"
       applicationComplete="init()">
    <fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
    <![CDATA[
    public var dataStr:String;
    private var socket:Socket;
    private var serverURL:String= "dead.org";
    private var serverPort:int = 143;
    private var serverResponse:ByteArray = new ByteArray();
    private function init():void
      this.serverURL = serverURL;
      this.serverPort = serverPort;
      socket = new Socket();
      socket.addEventListener(ProgressEvent.SOCKET_DATA,handleNewIMAPData); //Event when socket receives new data
      this.connectToServer();
      sendIMAPdata();
    private function sendString(dataStr:String):void
      var bytes:ByteArray = new ByteArray();
      bytes.writeMultiByte(dataStr, "UTF-8");
      socket.writeBytes(bytes);
      socket.flush();
      trace("sent: " + dataStr);
    public function sendIMAPdata():void
      trace("\t +++++++++++++++++ START SENDING IMAP DATA +++++++++++++++++++++++++");
      dataStr =". login user1 myPassword" + "\r\n";
      sendString(dataStr);
      dataStr =". status INBOX (messages)" + "\r\n";
      sendString(dataStr);
      dataStr =". select INBOX" + "\r\n";
          sendString(dataStr);
      trace("\t +++++++++++++++++ END SENDING IMAP DATA +++++++++++++++++++++++++");
    private function handleNewIMAPData(event:ProgressEvent):void
      var numBytes:int = socket.bytesAvailable;
      serverResponse = new ByteArray();
      while(socket.bytesAvailable)
        var byte:int = socket.readUnsignedByte();
    serverResponse.writeByte(byte);
      var response:String = serverResponse.toString();
      trace(" ++++++++ [IMAP START]\n Response is: " + response + "[IMAP END] +++++++++\n");
    private function connectToServer():void
      socket.connect(serverURL, serverPort);
    ]]>
    </fx:Script>
    </s:WindowedApplication>

    When I run telnet, the console responses are the same as the tcpdump messages.
    When I run the program, the messages from tcpdump match the messages in my trace statements.
    The messages from telnet and running the program are different:-)
    I can only assume (at the moment) that I am sending multiple messages too quickly(?), but I did a quick and dirty big "for loop" to slow down the sending of subsequent messages, but with no resulting change in the programs behaviour.
    So, still thinking about the problem -  unfortunately.

  • Songs greyed out after hard disk failure

    Hi,
    I've been looking though the many, many () posts on here regarding songs greyed out and unplayable but none seem to match my exact problem.
    I recent had the hard-disk fail on my macbook so, as a temporary mesasure I had to use a smaller, spare hard-disk I had lying around until I could buy a replacement.
    Having de-clutered my life some time ago from keeping my music on CDs I had a lot of music on my phone which I didn't want to lose. I downloaded iExplorer and attempted to move my music across however a lot of my songs are now greyed-out on my iPhone and do not appear on iExplorer.
    Did I lose everything?

    Many thanks!
    Your advice pushed me to reinstall.
    I entered the licencing info from a popup that appeared after launching LR5 and just did what required. It worked just ok!
    At first installation, I closed the popup with the idea to check my LR-Photo-archive in first step. Once I could check that all my pictures were ok, I entered manually the licence data from <help> + <LR registration>; registration steps and program behaviour were slightly different and were unsuccessful each time I tried.
    I have to tell that my current LR5 licence is issued from upgrade from LR4... may be licence number required were first previous one or I entered the bad one...
    Anyway, happy that recovery and reinstalling process ran properly.
    Thank you again.

  • Calls to methods in a class that extends Thread

    Hello,
    I have some code that I am initiating from within an ActionListener that is part of my programs GUI. The code is quite long winded, at least in terms of how long it takes to perform. The code runs nicely, however once it is running the GUI freezes completely until operations have completed. This is unacceptable as the code can take up to hours to complete. After posting a message on this forum in regard to the freezing of the GUI it was kindly suggested that I use multi-threading to avoid the unwelcome program behaviour.
    The code to my class is as follows:
    public class FullURLAddress
      private boolean success_flag = true;
      private BufferedReader iN;
      private Document dT;
      private EditorKit kT;
      private Element lmNt;
      private ElementIterator lmIterate;
      private XURL[] compAddress;
      private int countX = 0;           //Tracks Vector vT's size.
      private int countY = 0;           //Tracks Vector vS's size.
      private int xURLcount = 0;        //Tracks XURL objects instantiated by this FullURLAddress object.
      private SimpleAttributeSet simpAtSet;
      private String aURL;              //Contains original (Xtended) URL!
      private String fileType;
      private String indexContent;
      private String[] parseURL;
      private String[] finalStrings;
      private String[] sortStrings;
      private URL indexConnect;
      private URLConnection iconn;
      private Vector vT;            //Stores href information, from targeted URL's HTML souce code.
      private Vector vS;            //Stores sorted HREF info ".jpg" and ".gif" only (no: png, tiff, etc).
      public FullURLAddress(String aURL)
        this.aURL = aURL;
        try{
          indexConnect = new URL(aURL);
          iconn = indexConnect.openConnection();
          iN = new BufferedReader(new InputStreamReader(iconn.getInputStream()));
            /* Document creation, analysis objects instantiated */
          vT = new Vector();
          vS = new Vector();
          kT = new HTMLEditorKit();
          dT = kT.createDefaultDocument();
          dT.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
            /* Iterate through document and store all HREF values */
          kT.read(iN, dT, 0);
          lmIterate = new ElementIterator(dT);
          while((lmNt = lmIterate.next()) != null)
            simpAtSet = (SimpleAttributeSet)lmNt.getAttributes().getAttribute(HTML.Tag.A);
            if(simpAtSet != null)         //As long as there are A tags to be read...
              vT.addElement(simpAtSet.getAttribute(HTML.Attribute.HREF));
              countX++;//Tracks number of HREF occurences occur, giving better control of the Vector.
        }catch(MalformedURLException e){
          success_flag = false;
          System.out.println("FullURLAddress object has encountered a "+
                             "MalformedURLException at: "+aURL);
        }catch(IOException e){
          e.getMessage();
          success_flag = false;
        }catch(BadLocationException e){
          e.getMessage();
          success_flag = false;
        /* Searches through all HREF attributes that are now stored in Vector
           vT for occurences of the character string ".htm" */
        sortStrings = new String[countX];
        for(int i=0;i<countX;i++)
          sortStrings[i] = (String)vT.elementAt(i); //Vector Strings transfered into array.
          if(sortStrings.endsWith("gif")) // Does href value end with ".jpg"?
    vS.addElement(sortStrings[i]); // If so add it to the sorted Vector vS.
    countY++;
    if(sortStrings[i].endsWith("GIF"))
    vS.addElement(sortStrings[i]);
    countY++;
    if(sortStrings[i].endsWith("jpg")) // Does href value end with ".jpg"?
    vS.addElement(sortStrings[i]); // If so add it to the sorted Vector vS.
    countY++;
    if(sortStrings[i].endsWith("JPG"))
    vS.addElement(sortStrings[i]);
    countY++;
    finalStrings = new String[countY];
    for(int j=0;j<countY;j++)
    finalStrings[j] = (String)vS.elementAt(j);
    public int getCount()
    return countY; //Returns number of instances of htm strings
    } //ending with either "jpg" or "gif".
    public String[] xurlAddressDetails()
    return finalStrings;
    I have changed the above code to make use of multithreading by making this class extend Thread and implementing the run() method as follows:
    public class FullURLAddress extends Thread
      private boolean success_flag = true;
      private BufferedReader iN;
      private Document dT;
      private EditorKit kT;
      private Element lmNt;
      private ElementIterator lmIterate;
      private XURL[] compAddress;
      private int countX = 0;           //Tracks Vector vT's size.
      private int countY = 0;           //Tracks Vector vS's size.
      private int xURLcount = 0;        //Tracks XURL objects instantiated by this FullURLAddress object.
      private SimpleAttributeSet simpAtSet;
      private String aURL;              //Contains original (Xtended) URL!
      private String fileType;
      private String indexContent;
      private String[] parseURL;
      private String[] finalStrings;
      private String[] sortStrings;
      private URL indexConnect;
      private URLConnection iconn;
      private Vector vT;            //Stores href information, from targeted URL's HTML souce code.
      private Vector vS;            //Stores sorted HREF info ".jpg" and ".gif" only (no: png, tiff, etc).
      public FullURLAddress(String aURL)
        this.aURL = aURL;
      public void run()
        try{
          indexConnect = new URL(aURL);
          iconn = indexConnect.openConnection();
          iN = new BufferedReader(new InputStreamReader(iconn.getInputStream()));
            /* Document creation, analysis objects instantiated */
          vT = new Vector();
          vS = new Vector();
          kT = new HTMLEditorKit();
          dT = kT.createDefaultDocument();
          dT.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
            /* Iterate through document and store all HREF values */
          kT.read(iN, dT, 0);
          lmIterate = new ElementIterator(dT);
          while((lmNt = lmIterate.next()) != null)
            simpAtSet = (SimpleAttributeSet)lmNt.getAttributes().getAttribute(HTML.Tag.A);
            if(simpAtSet != null)         //As long as there are A tags to be read...
              vT.addElement(simpAtSet.getAttribute(HTML.Attribute.HREF));
              countX++;//Tracks number of HREF occurences occur, giving better control of the Vector.
        }catch(MalformedURLException e){
          success_flag = false;
          System.out.println("FullURLAddress object has encountered a "+
                             "MalformedURLException at: "+aURL);
        }catch(IOException e){
          e.getMessage();
          success_flag = false;
        }catch(BadLocationException e){
          e.getMessage();
          success_flag = false;
        /* Searches through all HREF attributes that are now stored in Vector
           vT for occurences of the character string ".htm" */
        sortStrings = new String[countX];
        for(int i=0;i<countX;i++)
          sortStrings[i] = (String)vT.elementAt(i); //Vector Strings transfered into array.
          if(sortStrings.endsWith("gif")) // Does href value end with ".jpg"?
    vS.addElement(sortStrings[i]); // If so add it to the sorted Vector vS.
    countY++;
    if(sortStrings[i].endsWith("GIF"))
    vS.addElement(sortStrings[i]);
    countY++;
    if(sortStrings[i].endsWith("jpg")) // Does href value end with ".jpg"?
    vS.addElement(sortStrings[i]); // If so add it to the sorted Vector vS.
    countY++;
    if(sortStrings[i].endsWith("JPG"))
    vS.addElement(sortStrings[i]);
    countY++;
    finalStrings = new String[countY];
    for(int j=0;j<countY;j++)
    finalStrings[j] = (String)vS.elementAt(j);
    /* What happens with these methods, will they need to have their
    own treads also? */
    public int getCount()
    return countY; //Returns number of instances of htm strings
    } //ending with either "jpg" or "gif".
    public String[] xurlAddressDetails()
    return finalStrings;
    Are there any special things that I need to do in regard to the variables returned by the getCount() and xurlAddressDetails() methods. These methods are called by the code that started the run method from within my GUI. I don't understand which thread these methods are running in, obviously there is an AWT thread for my GUI and then a seperate thread for my FullURLAddress objects, but does this new thread also encompass the getCount() and xurlAddressDetails() methods?
    Please explain.
    This probably sounds a little wack, but I don't understand what thread is responisble for the methods in my FullURLAddress class aside of course from the run() method which is obvious. Any help will be awesome.
    Thanks
    Davo

    Threads are part of code that allows you to run multiple operations "simultaneously". "Simultaneously", because threads are not run actually simultaneously in any one-CPU machine. Since you most propably have only one CPU in your system, you can only execute one CPU instruction at time. Basically this means that your CPU can handle only one java-operation at time. It does not matter if you put some code in thread and start it, it will still take up all CPU time as long as the thread runs.
    So you would need a way to let other threads run also, for that purpose thread contains a yield feature that allows you to give time for other threads to run.
    http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Thread.html#yield()
    You need to use thread's yield() method in your thread code, in a place you want to give other threads time to run. Also bear in mind that if you yield your first thread run to allow second thread to run, you also need to add yield to the second thread also. If you don't, after yielding the first thread, the second thread will eat up all CPU time until it finishes, thus meaning the rest of your first thread will be run after second thread is done.
    One good place to execute yield() is usually at the end of a loop, for example 'for' or 'while' loop. This way you prevent for example while-deadlocks.
    Here is a java thread tutorial, worthy reading:
    http://java.sun.com/docs/books/tutorial/essential/threads/

  • ABAP Objects - real example

    Hello everybody,
    can someone please navigate me to some "real example" of using abap objects?
    I went through demos in sap (I am using SAP R/3 4.6C) in <i>transaction ABAPDOCU, I have a book Horst Keller: Abap Objects (where partially the object orientation is written), I am reading articles in SAP professional journal or on web www.erpsapgenie.com, etc.
    This is all nice, but no real example can I find.
    What I mean with real example:
    For example report, where I select data from database ("select *.." or "get ..." etc.), put this data to internal table, maintenance these data, output these data.
    Or: in dialog programming write simple dialog, get data from PBO/PAI, put to into it, write data to database table, etc.
    I have tryed the first case: simple, but meaningfull report, and I start to struggle with problems - if I will have internal table it should be variable of given class, and the table will be in interfase? Or it should be in some "global class main" - but - it is recomended to have as possible protected/private data - so if I will have global data it is worse programming behaviour the to use old procedural approach...
    So generally, WHERE are some examples, where all standard behaviour of procedural programming is shown? - like
    <i>- put data to internal table/get if from it,
    - communication with dialog modules/calling selection screen,
    <i>- open text file in present. server, </i>
    <i>- preparing data for batch input processing, </i>
    <i>- exist abap objects equivalent of logical databases or (we, application programmers) have to write it by ourselves? </i>
    <i>- where are some real programs in R/3 4.6C, which are written fully object oriented? (but please not in HR module )</i>
    <i>- etc.</i></i></i>
    Are these things available to use in version R/3 4.6C?
    Thanks a lot,
    Alexander Talac.

    Hi,
    OOPS ALV links are as below...Check them,if they are useful,kindly reward points by clicking the star on the left of reply.
    OOPS ALV
    OOPS - Events.
    Editable ALV
    Tree
    TabStrip
    Multigrid
    Check this for basic concepts of OOPS
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/abap%20objects/abap%20code%20sample%20to%20learn%20basic%20concept%20of%20object-oriented%20programming.doc
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc
    Tabstrip
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20for%20tab%20strip%20in%20alv.pdf
    Editable ALV
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20edit%20alv%20grid.doc
    Tree
    http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_usrint.htm
    General Tutorial for OOPS
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an%20easy%20reference%20for%20alv%20grid%20control.pdf

  • Problems with Java Dictionary Tables

    Hi Experts,
    I have some problems with the Java Dictionary tables that I have created for my
    application. There are around 15 dictionary tables, each one of them having
    several hundred records, added in due course.
    As much as I understand these tables (created using the dictionary perspective)
    are stored in the default schema of the J2EE engine where the dictionary project
    is deployed and there is no direct way to insert records into these tables, we have
    to separately write methods to insert, update and delete records.
    I've already done this. Now the problem is that i have moved my project DC from
    development to testing. Now here the tables are existing, but not the data that i
    inserted during development.
    NOW, the main question: IS THERE ANY WAY IN WHICH I CAN TRANSFER
    THE CONTENTS OF THESE JAVA DICTIONARY TABLES??
    I have tried solutions like creating a DBLINK between the databases, but it is
    tedious, and unpredictable in behaviour. Also Please do not advise to first
    download them to excel and then upload using jxlapi, etc.
    Thanx in Advance.
    Alka.

    Hi Alka,
    The dblink is a good solution, but just a bit slow. You can also use a SQL Loader, first export the data from the source table in a text file (i.e. using a tool like TOAD), then sql loader loads the data in the destination table. This is more fast.
    Hope this help,
    Vito

  • Substitution does not work

    Hi,
    I create substitution using exit by copy RGGBS000 to ZRGGBS000 and activated it in tcode OBBH. When I test using Tcode F-02, saves as complated, it is work.
    My questions:
    1. When I changes my parked document, why my substitution does not work ?
    2. When I create document using Tcode F-65 and save as complate, why my substitution does not work ?
    Thanks,

    HI,
    Note 158739 describes in detail the standard program behaviour. It's not a bug! It's the designed system behaviour.
    The requirement can be fulfilled by a substitution when the document is posted. Or you can work with the ENJOY transactions, which enable substitutions when a document is saved as complete or posted. In case of just parking the substitutions don't work in ENJOY either.
    Regards
    Ravinagh Boni

  • Report output display problem

    I developed purchase register for vendor wise when i am displaying out put it is taking 4 lines gap for each vendor.
    my output is coming as below.
    Afton chemicals  100020  01.2.2008
    sector 6             10021   02.2.2008
    Mumbai.
    here it is taking 4 line space
    indian additives  123456  09.02.2008
    sector 20           124567  10.02.3008
    newdelhi
    here it is taking 4 lines space
    abatap chemicals  456789 12.03.2008
    deonar                  123456 13.03.2008
    mumbai              
    again 4 lines space it is taking.
    i have given line-count 10.
    in my pogram i have used with in loops
    reserved 8 lines and back statement.
    how to reduce space between each vendor.
    i written code as ..
    report puchase order line-count 10.
    loop at output.
    onchange of output-name1.
    reserved 8 lines.
    write: output-date , output-amount.
    back.
    endon.
    write: output-billno.

    Hi,
    the reason for your program behaviour is the combination of reserve 8 lines. and the back. statement You could either reduce the number of 8 lines, try to do without back or use a simple skip.
    Rgds.
    Roman Weise

  • Custom Date Field not showing up in Pages Inspector

    I created a custom date field in Address Book and now want to merge info from Address Book into a Pages template I created (including this new custom date field). When I go to the Inspector to add the custom date field to the template, it is not listed as a field - only Anniversary and Birthday are listed as "other" fields.
    How do I get the custom date field to show up in the inspector?
    Chris

    Question asked and responded several times.
    The Help is unaware of the true program behaviour.
    In version 3, custom AddressBook fields are not usable in Pages.
    _Go to "Provide Pages Feedback" in the "Pages" menu_, describe what you wish.
    Then, cross your fingers, and wait _at least_ for iWork'09
    Yvan KOENIG (from FRANCE samedi 8 novembre 2008 18:13:21)

Maybe you are looking for

  • Officejet Pro 8500A Premium will not print from my laptop

    I have an Officejet Pro 8500A Premium. I jus had ot reload my driver thinking it would resolve the below issue but it did not. The connection string is  laptop -> docking station -> ethernet to router -> ethernet to printer.  On my laptop I can see t

  • How can I right-align a table header?

    Does anyone know a way to right-align a table header? For example, in the table below I want the word 'Price' to be right-aligned. I could set the table's 'header renderer' to be a right-aligned DefaultTableCellRenderer, but then the header would loo

  • Going from Results tab to Criteria is taking too much time I think

    Hi guys, I noticed that sometimes when you go from Results to Criteria tab - it's taking too long, maybe 15-20 seconds sometimes. And in reality, shouldn't it be faster? I wonder whether it's an OBIEE issue at all?

  • Goods receipt to hub location.

    Hi Experts, Have a scenario which i can hardly think a good solution for it. Scenario: Due to limited warehouse space, my company rented few bonded warehouse WH near by the plant. In system we indicate this bonded WH with different storage location (

  • Migration of Oracle Apps from HP-UX to Linux

    Hi Experts, We have plan to migrate the Oracle Application from HP-UX to Linux OS. Can you please suggest me the road map to be followed : requirement : Source : 11.5.10.2 + 10.2.0.4 (DB) : HP-UX Target need to be : 11.5.10.2 + 11.2.0.2 (DB ) RHEL 64