Targeting the EdgeID object from inside the animation

I've been working on an animation that displays content pulled in from json files.  The height of the content pulled in is determined and then the Stage height is adjusted to fit the total content. This works well by itself. See http://www.jomariworks.com/edge-json (Only west coast links are live. Project files http://www.jomariworks.com/edge-json/edge-json.zip)
Now I'm embedding the animation in a page using the oam insert feature, which creates an object with a fixed size.  When the animation adjusts the stage height, the object window size does not change. When the content is longer than the object window, the content scrolls.
Is there a way I can target the height of the object (id is EdgeID) during the execution of the animation?
The live version of this can be viewed at  http://reconnectingamerica.org/spacerace/index.php.  The project files at http://www.jomariworks.com/edge-json/edge-json.zip are the same as far as functionality goes.
Thanks in advance for any help.

After being unable to discover how to target the height of the object containing the embedded edge animation, I have gone back to having the entire page part of the animation file.
The final web page is online at http://reconnectingamerica.org/spacerace
There are big disadvantages of this:
The full web page has more than 7000 lines of HTML.  Making changes in Edge Animate is a VERY slow process.
Edge Animate corrupts the HTML in the file. This file contains complex TABLEs.  After making changes in Edge Animate and saving those changes, the TABLE headers are all corrupted (e.g. closing THEAD tags are moved above the head content and several closing TR tags are relocated. For the record, I checked.and the original HTML is syntactically valid.).  To deal with this I removed the tables when editing in Edge Animate and after making changes and publishing the Edge Animate version of the HTML I restored the tables.
Working separately on the animation and then embedding is clearly the better workflow in this situation. Unfortunately, I needed to be able to resize the embedded animation's object container in the same way I was able to adjust the Stage from inside the animation.  Not being a jQuery wizard I couldn't figure out how to target the height of the animation's parent container.  Still interested in finding out how to do that if anyone can help.
Message was edited by: jomariworks

Similar Messages

  • How to copy/access a string from inside the driver

    is there any equivalent to strncpy() to use inside
    the driver for copying user sent data to local buffer .
    i used I_STRioctl and assigned struct to strioctl.ic_dp
    as shown below..
    char * buf;
    struct user-data
    int minor;
    char* data;
    struct user_data u_data;
    buf="hello world"
    u_data.minor=0;
    u_data.data=buf;
    strioctl.ic_dp=&u_data;
    strioctl.ic_len=sizeof(struct user_data);
    ioctl(fd,I_STR,&strioctl);
    when i tried to copy/access the string sent by the user application from inside the driver, machine gets into
    booting ...
    here what i did was
    in wput routine
    struct user_data *u_data;    
    u_data =(struct user_data*)mp->b_cont->b_rptr;      
    cmn_err(CE_NOTE,"minor= %d",u_data->minor);
    till here working well..
    where as..
    cmn_err(CE_NOTE,"data= %s",u_data->data);
    causing panic to the system...booting happens.
    please help me out ..
    thank u all
    ss vasu

    looks like the data pointed to by 'data' is not copied from user space to kernel space.
    u_data.data=buf, just makes pointer assignment, does not copy data pointed to by buf.
    two solutions:
    1. Declare data as a array(char data[10] or something
    2. Copy buf after the structure and point data to it. strioctl.ic_len should be set to sizeof(struct) +
    data size.
    -Vijay
    is there any equivalent to strncpy() to use inside
    the driver for copying user sent data to local buffer
    i used I_STRioctl and assigned struct to
    strioctl.ic_dp
    as shown below..
    char * buf;
    struct user-data
    int minor;
    char* data;
    struct user_data u_data;
    buf="hello world"
    u_data.minor=0;
    u_data.data=buf;
    strioctl.ic_dp=&u_data;
    strioctl.ic_len=sizeof(struct user_data);
    ioctl(fd,I_STR,&strioctl);
    when i tried to copy/access the string sent by the
    user application from inside the driver, machine gets
    into
    booting ...
    here what i did was
    in wput routine
    struct user_data *u_data;
    u_data =(struct user_data*)mp->b_cont->b_rptr;
    r;
    cmn_err(CE_NOTE,"minor= %d",u_data->minor);
    till here working well..
    where as..
    cmn_err(CE_NOTE,"data= %s",u_data->data);
    causing panic to the system...booting happens.
    please help me out ..
    thank u all
    ss vasu

  • How can I get the underlying object from the ObjectReference

    Dear friends,
    I think this question has been asked a couple of times. But, I am still wondering if anybody has found an answer to it. Maybe this is some common need ...
    I would like to get the underlying object for which the ObjectReference is
    a mirror For example, I have a class Customer in my application, and I can get an ObjectReference through JDI during runtime. But how can I get the target VM's object which is a real instance of Customer, by which I can invoke methods defined in Customer?
    Thank you so much for any input!
    SunnyDay

    I'll preface this response by admitting this far from an elegant solution, but I did write a function addressing this question, mostly as an exercise.
    If passed an object with an InTextFrame property (Pgf, AFrame, Cell, Fn) that resides in an open document, the function will return the Doc object. Otherwise, it returns undefined.
    function getParentDoc(testObj) {
        //Get object for current page
        try { var curPage = testObj.InTextFrame.FrameParent.PageFramePage; }
        catch(er) {return;}
        //Step backwards to first page in document
        var prevPage = curPage.PagePrev;
        while (prevPage.ObjectValid())
            curPage = prevPage;
            prevPage = prevPage.PagePrev;
        //Compare with first pages of open documents
        var testDoc = app.FirstOpenDoc;
        while (testDoc.ObjectValid())
            if (curPage.id==testDoc.FirstBodyPageInDoc.id) return testDoc;
            testDoc = testDoc.NextOpenDocInSession;    
        return;
    To your PPS: Rather than seeing the native framework grow bloated to address additional features, I would love to see Adobe and other developers publish libraries of useful functions and class extensions.

  • Can I import HTMLs from inside the project and use as portlet page ?

    As you know, I am using Java Studio Creator 2 Update 1 for my current portal project. I have created JSR-168 JSF Portlet Project for my portlet development.
    As I have some html pages ready for my development,
    Can I import HTMLs from inside the project and use as portlet page for my project?
    I did the followings steps:
    1: In side the project - File -> Add Existing Item -> Web Page ( imported test.html page from my local folder)
    2: Let it convert some of the tags for me ( so now it becomes - �test.jsp� )
    3: Set it to initial view.
    4. A default portlet page � newPortletPage.jsp is still there with no initial view.
    Now after doing this, No Visual Designer and Properties window available to for that �test.jsp� page. Though it allowed me to �build� the project successfully.
    When I build and run the portlet application, got the error message �Error occurred in portlet!� on Pluto Portal. Please advice.

    You do not open fcpproject files. You don't double click or anything else. The files have to be in the correct folder structure in the Final Cut Projects folder and the application opens them automatically. Can you post screen shots of the Final Cut Projects folder and its location.

  • How can I make the Counter move from inside text box to inside Footer?

    I am tweaking a page. At this point, I cannot move the Counter and the Email Me icon from the bottom of the text box to inside the footer like someone here said he does.
    Why do the Counter and the Email Me icon resist being moved?
    I am in Graphics mode. I never had this problem before.
    — Lorna in Southern California

    Lorna,
    I'm not sure why you can't move it down into the
    footer — by inside the text box, do you mean the page
    "content" or "body" section, or did you somehow get
    the icons into a text box? I know that you can
    "force" a text box into the footer (or header) by
    selecting it, then dragging it while holding the
    command (Apple) key down at the same time.
    Hope this helps.
    Bob
    Bob,
    When I say Text box maybe I am not using the right word. I am referring to that entire space on the page which is dedicated to receiving documents or images. If you have a lot of pictures or words, then that text box/space has to be lengthened to accomodate.
    I am saying that the two icons -- Counter and Email Me -- are sitting (or were sitting. It's morning now and honestly, I can't recall from last night!) at the very bottom of the text box/space.
    I made a Footer (55 pixels) specially to accomodate the Counter and Email icons. The problem, as stated, was/is that those icons would not budge from where they were sitting.
    — Lorna in Southern California

  • Declare object type inside the package

    Hi,
    How can I declare an object type inside the package?
    CREATE TYPE TempObj AS OBJECT (
    user_id number,
    text varchar2(4000),
    date_created DATE
    This will not work if placed inside this:
    CREATE OR REPLACE PACKAGE SAMPLE_PKG IS
    ---declaration goes here.
    END SAMPLE_PKG;
    I tried using the type RECORD and it worked. But I am just curious how to declare an Object. Or maybe RECORD is the replacement of Object? is this correct?
    thanks,
    Baldwin

    The inside of a PL/SQL package should contain PL/SQL statements.
    CREATE TYPE is not a PL/SQL statement. You can't create a table in package either.
    If data protection is the reason that you would rather create the type inside the package, then consider using a record type as you suggested, or hiding the SQL type in a more protected schema.
    Message was edited by:
    jonjac

  • How can I drop the java objects from a schema

    hi..good afternoon all...
    How can I drop the java objects from a database schema???
    suppose the credentials are scott/tiger@db1
    Another thing is that...I have to do this from cmd(command prompt) as there is no plsql developer or sqldeveloper installed in the machine.
    plss help...thanks in advance...

    hi...i have already tried all the options..but it is showing the error..
    ora:01435 - user does not exist
    but when i have given the command...
    select object type, object_name, status from user_objects where object_type like'%JAVA%';
    then it is showing that the java_object is present....
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL>
    SQL>
    SQL>
    SQL> set linesize 200
    SQL>
    SQL>
    SQL>
    SQL> select object_type, object_name, status from user_objects where object_type
    like '%JAVA%';
    OBJECT_TYPE OBJECT_NAME
    STATUS
    JAVA CLASS javaclass1
    VALID
    JAVA SOURCE javaclass1
    VALID
    SQL> drop java source javaclass1.java;
    drop java source javaclass1.java
    ERROR at line 1:
    ORA-01435: user does not exist
    SQL>

  • I have the 4th generation iPod touch and my friend changed the iPod passcode and she cant remember it. Im on the iPod, Im not locked out. Im wondering if there is a way to change the passcode from inside the ipod settings or something?

    My friend cant remember the password. Can I change it from inside the iPod settings or something?

    Your friend could only have changed it if they had your original passcode - you have to be able to enter the current passcode to change it to a new one.  Once you restore it now, I would then change it and NOT give it out to people.
    P.S. if you have a backup from when it still had your passcode on it, just restore from that backup and it should set the passcode back to what you had.
    Without that backup, you will have to restore as new, and set everything up again from scratch.

  • How to retrieve data from inside the folders in SharePoint SSRS

    Hi ,
    How to get the data from inside the folders and subfolders.
    How can I do that.
    https://social.msdn.microsoft.com/Forums/en-US/15451351-4ee2-428c-a0b7-135810e4cbfa/action?threadDisplayName=ssrs-reports-sharepoint-list-datasource-how-to-retrieve-items-from-subfolders
    Here the information is not given.
    Regards
    Vinod

    Hi Vinodaggarwal87,
    According to your description, you want to retrieve data from sharepoint list in a sub folder. Right?
    In this scenario, we should select the XML data source type and in the connection string provide the
    List.asmx service URL when creating data source. Then we need to use the List web Service and specify "recursive" for ViewAttribute in Lists.asmx. For detail steps, please refer to the links below:
    Generate SSRS report on SharePoint List with folders using List Service.
    SSRS: how to specify ViewAttributes when creating a report against a SharePoint's list
    If you want to set the ViewAttribute on CAML query level. You need add the view tag outside of query tag:
    <View Scope="RecursiveAll">
        <Query>
            <Where>...</Where>
        </Query>
    </View>
    Reference:
    View Element (List)
    ViewAttributes Recursive Scope not working SharePoint 2013 CAML Query to fetch all files from document library recursively
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • How to put the text "BottomCENTER" from inside JLabel1 out of  Jlabel1??

    Dear friends:
    I have following code,
    It can run.
    I hope to move the text "BottomCENTER" from inside JLabel1 out of Jlabel1,
    I mean Text "BottomCENTER" should be display outside of JLabel1
    import java.awt.Color;
    import java.awt.GridLayout;
    import javax.swing.BorderFactory;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.SwingConstants;
    public class AlignmentExample {
      public static void main(String[] args) {
        // Create the labels and set alignment
        JLabel label1 = new JLabel("BottomCENTER", SwingConstants.CENTER);
        JLabel label2 = new JLabel("CenterLeft", SwingConstants.LEFT);
        JLabel label3 = new JLabel("TopCenter", SwingConstants.CENTER);
        label1.setVerticalAlignment(SwingConstants.BOTTOM);
        label2.setVerticalAlignment(SwingConstants.CENTER);
        label3.setVerticalAlignment(SwingConstants.TOP);
        // Add borders to the labels . . . more on Borders later in the book!
        label1.setBorder(BorderFactory.createLineBorder(Color.black));
        label2.setBorder(BorderFactory.createLineBorder(Color.black));
        label3.setBorder(BorderFactory.createLineBorder(Color.black));
        label1.setBounds(10, 10, 200, 150);
        // Put it all together . . .
        JFrame frame = new JFrame("AlignmentExample");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JPanel p = new JPanel(new GridLayout(3, 1, 8, 8));
        p.add(label1);
        p.add(label2);
        p.add(label3);
        p.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
        frame.setContentPane(p);
        frame.setSize(400, 500);
        frame.setVisible(true);
    Thanks so much!!

    change following JLabel1
    | |
    | |
    | |
    | JLabel1 |
    | |
    | |
    | |
    into following Jlabel1:
    | |
    | |
    | |
    | |
    | |
    | |
    | |
    JLabel1
    Thanks

  • Editing track order FROM INSIDE the iPhone

    Is it possible to edit the tags on the tracks from inside the actual phone? I don't have access to iTunes right now, and an album I'm listening to is horribly out of order. Is there any way to get it to play in the proper order by just using the resources on the actual phone?

    The only way I know of is to use the on the go playlist feature (covered on page 66 of the manual):
    http://manuals.info.apple.com/enUS/iPhone_UserGuide.pdf

  • Execute binary from inside the app?

    Hello! I'm working on a Mac App that on the push of a button, will execute a binary file from inside the .app file. But I don't know where to place the binary so i can access it, and how to execute it.
    Thanks,
    Andrei

    Hello,
         We are able to use the Java Gui directly from the mac without any problems.
    We are recieving the following error from the Mac Console when we execute the Iview from with the portal.
    5/1/08 1:17:35 PM [0x0-0x5d05d].org.mozilla.firefox[656] ### MRJPlugin:  getPluginBundle() here. ###
    5/1/08 1:17:35 PM [0x0-0x5d05d].org.mozilla.firefox[656] ### MRJPlugin:  CFBundleGetBundleWithIdentifier() succeeded. ###
    5/1/08 1:17:35 PM [0x0-0x5d05d].org.mozilla.firefox[656] ### MRJPlugin:  CFURLGetFSRef() succeeded. ###
    5/1/08 1:17:35 PM [0x0-0x5d05d].org.mozilla.firefox[656] _NSJVMLoadLibrary: NSAddLibrary failed for /System/Library/Frameworks/JavaVM.framework/Versions/(null)/Libraries/libjvm.dylib
    5/1/08 1:17:35 PM [0x0-0x5d05d].org.mozilla.firefox[656] JavaVM FATAL: Failed to load the jvm library.
    Were the (null) is located in the error log above we presently have version 1.4.1, 1.4.2, 1.5.0, 1.6.0.   So it looks as if it isn't getting the version of java from the Transaction_configuration file that it should be pointed to.
    Any suggestions.

  • Failed retrieval of the session object from the portal server in the WebApp

    hello out there,
    i tried to realize a multipartform file upload with a jsp-Channel (in .../portal/dt ) which sends the data into the same WebApp ( .../portal/ )to a different jsp-File but which is not using the desktopServlet of the potal. The Information where the file must be stored is generated in the jsp-Channel of the portalDesktop and saved in a session object. the problem i have is this: the session object generated in the jsp-Channel isn`t available outside .../portal/dt. But the WebAppContext is .../portal/ and the jsp File which processes the upload resides in .../portal/fileProcess.jsp . Does the PortalServer manage SessionManagement in a different way than an ordinary servlet/jsp container ?? if yes, how can i create a session object for the whole webAppContext ".../portal/ " ??
    i am very thankful for answers
    sincerely
    martin

    you may try to set usehttpsession to true in ../SUNWam/lib/AMConfig.properties file (restart after change). But using httpsession in portal is not an optimal solution for performance - performance tuning in production environment sets the value to false. I remember there is a good posting here about using session in portal, you may want to find it out.
    Hope this helps.
    Joe Zhou

  • How can I kill all Threads of the same class from within the run() method?

    Ok
    I have a class called Consumer that extends Thread
    I have several Consumer threans running... but, when a certain condition is true (within the run() method) in ANY of the threads, I want to kill ALL the threads of that object.
    is this possible?

    I know this is gonna be too demanding, but can someone please tell me why my Consumer's run() method never reaches the System.out.println( "ALL CONSUMING DONE") line
    Create a multi-threaded prime number calculator that is based on the producer-consumer model
    using semaphores. Your program should be able to check for prime numbers in a range specified
    by the user and with a variable number of threads. Example:
    $ java PrimeFind 3 5000 10000
    should use 1 producer and 2 consumers (3 threads in total, obviously the minimum is 2) to find all
    the prime numbers in the range [5000,10000].
    The producer should: use a buffer to store candidate numbers that have to be checked for
    primality.
    Consumers should: read from the buffer, check if a number is prime and update the status of the
    program accordingly (e.g. show the number on the screen, or save it to a file)
    import java.util.concurrent.Semaphore;
    import java.io.*;
    public class Assign1 {
    static int fromThisNumber;
    static int toThisNumber;
    static int numberOfThreads;
    static int buffer[];
    static Semaphore ready;          /*This semaphore is used by the Producer to signal
                                         an "OK" to the consumers*/
    static Semaphore critical;  /*This is a Mutex semaphore. It allows only 1 consumer
                                         to enter his critical section.
    static Semaphore counter;     /*This semaphore acts as a counter.
                                        Instead of having a global variable
                                         incremented each time, we just release()
                                         this semephore when we find a prime number
                                         Because remember that release() increments permits
    static Producer prod;
    static Consumer cons[];
    static int in=0;
    static int out=0;
    static PrintWriter outFile;
         public static void main (String args[]){
              try{
                   outFile=new PrintWriter(new FileWriter("primes.txt"));
                   }catch(Exception e){}
              numberOfThreads=Integer.parseInt(args[0]);
              fromThisNumber=Integer.parseInt(args[1]);
              toThisNumber=Integer.parseInt(args[2]);
              buffer=new int[Integer.parseInt(args[2])-Integer.parseInt(args[1])+1];
              ready=new Semaphore(0,false); /*We initialise it to 0 because we wait
                                                      for the Producer to produce atleast a
                                                      item. Suppose ready was 1 and if
                                                      Consumer ran first he would be in an
                                                      empty buffer */
              critical=new Semaphore (1,false);/*We initialise it to 1 because when
                                                         the first Consumer thread tries
                                                         to enter its critical section, it
                                                         should be allowed to;
                                                         Subsequent threads will have to
                                                         wait since only 1 thread can
                                                         access its critical section at a time*/
              counter=new Semaphore(0,false); // duh!
              cons=new Consumer[numberOfThreads-1]; /*numberOfThreads-1 because 1 thread
                                                                is taken by the Producer*/
              //Creating Producer object
              prod=new Producer();
              //Creating the Consumer object and start the thread.
              for(int i=0;i<cons.length;i++)
                        cons=new Consumer();
                        cons[i].start();
              prod.start();          
              //Printing to screen and file
    /*          for(int i=0;i<buffer.length;i++)
                   if(buffer[i]!=0)
                             System.out.println(buffer[i]);
                             outFile.println(buffer[i]);
              System.out.println("Total primes found between "+args[1]+" and "+toThisNumber+": "+counter.availablePermits()+"\n primes.txt written");
              outFile.println("Total primes found between "+args[1]+" and "+toThisNumber+": "+counter.availablePermits());
              outFile.close();*/                    
    static class Producer extends Thread {
         public void run(){try{
              while(in<buffer.length)     /*'in' should always be more than 'out'.Oherwise the consumer will try to access an empty index*/
                   {     System.out.println("producing");     
                        buffer[in]=fromThisNumber;
                        in++;
                        fromThisNumber++;
                        ready.release();
              catch (Exception e){e.printStackTrace();}
              System.out.println("ALL PRODUCING DONE");
    static class Consumer extends Thread {
         int tempout=0;
         public void run(){try{
              System.out.println("before while"+this.getId());
              while(tempout<=in)
                   System.out.println("before ready"+this.getId()+" "+ready.availablePermits()+" "+in);
                   ready.acquire();
                   System.out.println("before critical.acquire"+this.getId());
                   critical.acquire();
                   tempout=out;
                   out++;
                   critical.release();               
                   if(!isPrime(buffer[tempout]))
                        {System.out.println(buffer[tempout]+" by "+this.getId());buffer[tempout]=0;}
                   else {counter.release();System.out.println("prime added: "+buffer[tempout]+" by "+this.getId());}
                   critical.acquire();
                   tempout=out;
                   System.out.println("tempout:"+tempout+" of "+this.getId());
                   critical.release();
              System.out.println("ALL CONSUMING DONE"+this.getId());
         catch(Exception e){e.printStackTrace();}
         //Prime number-checking method     
         public boolean isPrime(int n){
              for(int i=2;i<=(n/2);i++)
                   if(n%i==0)
                        return false;
              return true;
    ======================
    import java.util.concurrent.Semaphore;
    import java.io.*;
    /* 3 questions to ask Barlas
    * Why error if I start the Consumer threads before Producer
    * Why does the counter semaphore always give a +1 result at the end
    * Is there a way I can verify that all the work is not being done by only 1 consumer thread? In other words, the workload is being shared properly
    * if I put ready.acquire() outside or inside the while loop, its not making any difference, why?
    * Strangely, its not making any difference if I playing with the release() and aquire() of the semaphores, WHY?!?!
    public class Assign1 {
    static int fromThisNumber;
    static int toThisNumber;
    static int numberOfThreads;
    static int buffer[];
    static Semaphore ready;          /*This semaphore is used by the Producer to signal
                                       an "OK" to the consumers*/
    static Semaphore critical; /*This is a Mutex semaphore. It allows only 1 consumer
                                       to enter his critical section.
    static Semaphore counter;     /*This semaphore acts as a counter.
                                  Instead of having a global variable
                                       incremented each time, we just release()
                                       this semephore when we find a prime number
                                       Because remember that release() increments permits
    static Producer prod;
    static Consumer cons[];
    static int in=0;
    static int out=0;
    static PrintWriter outFile;
         public static void main (String args[]){
              try{
                   outFile=new PrintWriter(new FileWriter("primes.txt"));
                   }catch(Exception e){}
              numberOfThreads=Integer.parseInt(args[0]);
              fromThisNumber=Integer.parseInt(args[1]);
              toThisNumber=Integer.parseInt(args[2]);
              buffer=new int[Integer.parseInt(args[2])-Integer.parseInt(args[1])+1];
              ready=new Semaphore(0,false); /*We initialise it to 0 because we wait
                                                      for the Producer to produce atleast a
                                                      item. Suppose ready was 1 and if
                                                      Consumer ran first he would be in an
                                                      empty buffer */
              critical=new Semaphore (1,false);/*We initialise it to 1 because when
                                                      the first Consumer thread tries
                                                      to enter its critical section, it
                                                      should be allowed to;
                                                      Subsequent threads will have to
                                                      wait since only 1 thread can
                                                      access its critical section at a time*/
              counter=new Semaphore(0,false); // duh!
              cons=new Consumer[numberOfThreads-1]; /*numberOfThreads-1 because 1 thread
                                                                is taken by the Producer*/
              //Creating Producer object
              prod=new Producer();
              //Creating the Consumer object and start the thread.
              for(int i=0;i<cons.length;i++)
                        cons[i]=new Consumer();
                        cons[i].start();
              prod.start();          
              //Printing to screen and file
    /*          for(int i=0;i<buffer.length;i++)
                   if(buffer[i]!=0)
                             System.out.println(buffer[i]);
                             outFile.println(buffer[i]);
              System.out.println("Total primes found between "+args[1]+" and "+toThisNumber+": "+counter.availablePermits()+"\n primes.txt written");
              outFile.println("Total primes found between "+args[1]+" and "+toThisNumber+": "+counter.availablePermits());
              outFile.close();*/                    
    static class Producer extends Thread {
         public void run(){try{
              while(in<buffer.length)     /*'in' should always be more than 'out'.Oherwise the consumer will try to access an empty index*/
                   {     System.out.println("producing");     
                        buffer[in]=fromThisNumber;
                        in++;
                        fromThisNumber++;
                        ready.release();
              catch (Exception e){e.printStackTrace();}
              System.out.println("ALL PRODUCING DONE");
    static class Consumer extends Thread {
         int tempout=0;
         public void run(){try{
              System.out.println("before while"+this.getId());
              while(tempout<=in)
                   System.out.println("before ready"+this.getId()+" "+ready.availablePermits()+" "+in);
                   ready.acquire();
                   System.out.println("before critical.acquire"+this.getId());
                   critical.acquire();
                   tempout=out;
                   out++;
                   critical.release();               
                   if(!isPrime(buffer[tempout]))
                        {System.out.println(buffer[tempout]+" by "+this.getId());buffer[tempout]=0;}
                   else {counter.release();System.out.println("prime added: "+buffer[tempout]+" by "+this.getId());}
                   critical.acquire();
                   tempout=out;
                   System.out.println("tempout:"+tempout+" of "+this.getId());
                   critical.release();
              System.out.println("ALL CONSUMING DONE"+this.getId());
         catch(Exception e){e.printStackTrace();}
         //Prime number-checking method     
         public boolean isPrime(int n){
              for(int i=2;i<=(n/2);i++)
                   if(n%i==0)
                        return false;
              return true;
    ===========================
    BTW, when I tried to change extends Thread to implements Runnable I got some kinda of error.
    Actually, my program is pretty complete... its just that something if messed up in my Consumer's run() method's while loop... I think
    I know guys its crazy to ask ya'll to look at so much code, but.... I'd really appreciate it. This assignment is killing me, been at it since 10 hours now....

  • "there were not enough threads in the threadpool object to complete the operation" exception

    Post Author: crystalmatrix
    CA Forum: .NET
    I have a WinForm application using a Crystal Report Viewer control that in turn connects to a CR web service to display report. The client side application runs on WinXP SP1 with .Net framework 1.1, and the server is Win2k with ASP.Net 1.1. I am using CR XI out of the box.
    Users would periodically get "there were not enough threads in the threadpool object to complete the operation." exception when trying to launch the report viewer connected to the web service. The web service is a standard example implementation derived from CrystalDecisions.Web.Services.ReportServiceBase class. The problem usually happens when the user tries to open multiple report viewer forms, but once they get the error, it would continue to happen even after the user shuts down all viewer forms and then tries to launch a new one.
    There are some posts on the web regarding multiple asynchronous HttpWebRequest draining threadpool when running simultaneously and each one taking a long time to complete. However, our reports all run pretty quickly and results are usually returned before the next report starts to run. So my question is: does Crystal Report Viewer control has a problem with web service in that it may hold the HttpWebRequest thread even after the report is returned, or any other problem that may prevents the asynchronous thread being released back to the Threadpool? Anyone has experienced similar problems and has a workaround?
    Any advice is appreciated.

    Find your serial number quickly

Maybe you are looking for