Problem with queue timing out?

Hi all,
I am using a queue to send a cluster between parallel while loops (producer-consumer); however sometimes, but not on all occasions, the enqueue in the producer seems to "freeze" or maybe timesout for no reason (no timeout value is wired to the enqueue or any other element related to that queue process; so I assume it never timesout)...
I have checked this and there is data in the cluster that is being enqueued, but the dequeue in the consumer loop is empty... This does not happen on every execution, just occassionally... If I stop and save the vi, it works fine again but the next occurence of this problem.... If I wire 0ms to the enqueue timeout it also works properly again...
Any suggestions?
Thanks,
Jack

Hi Yamaeda,
Thanks for the input... Please see code attached (a number of subvis are a missing, but these only help with reading the data file and doing basic analysis on the data after the dequeue).... In a nutshell, there are 3 parallel while loops;  Loop 1: User Interface; Loop2 : Read, Convert, Plot; and Loop 3: Analyse and Write to File.
The enqueue with the problem is in loop 2 (inside the "Plot" state, then inside the "False" case)... The loop is a rough state machine.
There are no timeouts on the enqueue in loop 2 or corresponding dequeue in loop 3.... The dequeue does not timeout based on a constant "false" from an indicator when the problem occurs.
When the dequeue does not work, memory usuage keep increasing until a "Memory Full Error" and the vi aborts.... This does not happen when it runs properly.
The data being queued can be quite large (upto 1M rows x 7 columns of data and does occur quickly (basically, data in the top graph is min-max decimated based on graph pixel width as I read on the NI white paper for displatying large data sets; the data between the start and stop cursors is then sent as a subarray to the enqueue for a fully display on the bottom graph for closer analysis)... Perhaps the queue is filling? I did not know this was possible (I am using a100ms wait for loop timing).
Any suggestions greatly appreciated.
Thanks,
Jack
Attachments:
Neuro Analysis 2.vi ‏461 KB

Similar Messages

  • Canon pixma pro 9500 having problems with my print out. colors are glazed and missing colors

    canon pixma pro 9500 having problems with my print out. colors are glazed and missing colors
    i have prfiled the mac and printer wiht colormunki and uplodated the profile sucessfully
    i set the printer to correct icc profile
    print out comes out same with glazed colors and missing tones/colors
    however when i use the same printer on windows and with light room, following same icc profile, colormunki calibrated profile, the print our are excellent.
    i have also tried using printer manage profile using the Mac and Aperture and get same poor prints
    can  you please assist and thanks

    I've a Pro9000 and also use Colormunki successfully.
    When I use Colormunki, I calibrate both of my monitors and the printer/paper combination. Colormunki saves the generated profiles to the correct places -- I don't load or change any profiles after that as that would mess-up what the Colormunki had just done for me, and this would likely mess-up the prints.
    Though I double-check the settings in the print dialogue, the choice for the printer handling things is already grayed-out. Colorsync handles it all just fine.

  • Frustratingly, since I upgraded to Yosemite 10.10, I too am having the worst problems with WiFi dropping out. I've never had this problem before on my iMac 27-inch mid 2011 model. Turning WiFi off and then back on again sometimes works. Help please.

    Frustratingly, since I upgraded to Yosemite 10.10, I too am having the worst problems with WiFi dropping out. I've never had this problem before on my iMac 27-inch mid 2011 model. Turning WiFi off and then back on again sometimes works. Help please. I've already tried a lot of your suggested fixes, but without success. Why hasn't Apple Fixed this?

    Please test after taking each of the following steps that you haven't already tried. Stop when the problem is resolved. Back up all data before making any changes.
    Step 1
    Take the applicable steps in this support article. The Wireless Diagnostics program generates a large file of information about your system, which would be used by Apple Engineering in case of a support incident. Don't post the contents here.
    Step 2
    Disconnect all USB 3 devices. If you don't know which are USB 3, disconnect all USB devices except keyboard and mouse.
    Step 3
    If you're not using a wireless keyboard or trackpad, disable Bluetooth by selecting Turn Bluetooth Off from the menu with the Bluetooth icon. If you don't have that menu, open the Bluetooth preference pane in System Preferences and check the box marked Show Bluetooth in menu bar. Test. If you find that Wi-Fi works better with Bluetooth disabled, you should use the 5 GHz Wi-Fi band. Your router may not support it; in that case, you need a new router.
    Step 4
    Open the Energy Saver pane in System Preferences and unlock the settings, if necessary. Select the Power Adapter  tab, if there is one. Uncheck the box marked
              Wake for Wi-Fi network access
    if it's checked.
    Step 5
    Open the Network pane in System Preferences and make a note of your settings in the Wi-Fi service. It may be helpful to take screenshots of the various tabs in the preference pane. If the preference pane is locked, unlock it by clicking the padlock icon and entering your administrator password. Delete Wi-Fi from the service list on the left by selecting it and clicking the minus-sign button at the bottom. Then recreate the service by clicking the plus-sign button and following the prompts.
    Step 6
    In the Wi-Fi settings, select
              Advanced... ▹ TCP/IP ▹ Configure IPv6: Link-local
    Click OK and then Apply.
    Step 7
    Reset the System Management Controller.
    Step 8
    Reset the PRAM.
    Step 9
    Launch the Keychain Access application. Search for and delete all AirPort network password items that refer to the network. Make a note of the password first.
    Step 10
    Make a "Genius" appointment at an Apple Store, or go to another authorized service center.

  • BIPCatalogUtil extraction always fails with "Connection timed out"

    BIPCatalogUtil extraction always fails with "Connection timed out".
    Any suggestions on what could be the issue?

    One thought was that perhaps it was timing out going out some unused port (e.g., the Airport port), but a list shows only the Ethernet port is enabled:
    admin$ sudo networksetup -listallnetworkservices
    An asterisk (*) denotes that a network service is disabled.
    Built-in Ethernet
    *AirPort
    *Built-in FireWire
    *Bluetooth

  • DeskI Job Server Hangs with Connection timed out error in trace file

    Hi, in these days I have a problem with Desktop Intelligence Job Server. After some hours after its starting (it's restarted every day in the morning to allow db backup) in the trace file I can see errors like this:
    [Wed Apr  8 09:58:40 2009]      28116   1457753008      (../iinfoprocessing_implmixedproc.cpp:607): trace message: Failed to send message to child: 28527, err 0, PipeListener: timed out reading from pipe: Connection timed out
    [Wed Apr  8 09:58:43 2009]      28116   1457753008      (csipipe.cpp:242): trace message: PipeListener: ReadString(1) timed out: Connection timed out
    [Wed Apr  8 09:58:43 2009]      28116   1457753008      (../iinfoprocessing_implmixedproc.cpp:607): trace message: Failed to send message to child: 28529, err 0, PipeListener: timed out reading from pipe: Connection timed out
    [Wed Apr  8 09:58:46 2009]      28116   1457753008      (csipipe.cpp:242): trace message: PipeListener: ReadString(1) timed out: Connection timed out
    [Wed Apr  8 09:58:46 2009]      28116   1457753008      (../iinfoprocessing_implmixedproc.cpp:607): trace message: Failed to send message to child: 28553, err 0, PipeListener: timed out reading from pipe: Connection timed out
    [Wed Apr  8 09:58:49 2009]      28116   1457753008      (csipipe.cpp:242): trace message: PipeListener: ReadString(1) timed out: Connection timed out
    [Wed Apr  8 09:58:49 2009]      28116   1457753008      (../iinfoprocessing_implmixedproc.cpp:607): trace message: Failed to send message to child: 28555, err 0, PipeListener: timed out reading from pipe: Connection timed out
    [Wed Apr  8 09:58:52 2009]      28116   1457753008      (csipipe.cpp:242): trace message: PipeListener: ReadString(1) timed out: Connection timed out
    [Wed Apr  8 09:58:52 2009]      28116   1457753008      (../iinfoprocessing_implmixedproc.cpp:607): trace message: Failed to send message to child: 28591, err 0, PipeListener: timed out reading from pipe: Connection timed out
    All job submitted remains in "Suspend" mode and never pass in "Executing".
    To solve the problem I've to manually stop and restart the DeskIjob server, but after some hours the problem reappear.
    How to solve it?
    I've installed Business Objects XI R2 SP5 on Linux SLES 10
    Thanks

    Checking the jobcd trace of child process in connection timeout, I can see, at the time in which in jobsd process the error occurs, the following error:
    [Thu Apr  9 09:14:08 2009]      8940    1452690272      (../ijob_implmixedproc.cpp:143): trace message: MixedProcMgr: msg = GetLoad
    [Thu Apr  9 09:14:08 2009]      8940    1452690272      (../ijob_implmixedproc.cpp:128): trace message: MixedProcMgr: timed out wating for new jobs, shutting down.
    [Thu Apr  9 09:14:08 2009]      8940    1452690272      (pp_procFC.cpp:3716): trace message: IJobDllUnInitialize
    [Thu Apr  9 09:14:08 2009]      8940    1452690272      (pp_procFC.cpp:951): trace message: ReleaseStaticSubsystem()
    [Thu Apr  9 09:14:08 2009]      8940    1452690272      (pp_procFC.cpp:168): trace message: t_shutdown_ptr::reset()
    [Thu Apr  9 09:14:08 2009]      8940    1452690272      (pp_procFC.cpp:172): trace message: Shutting down INTERFACE
    [Thu Apr  9 09:14:08 2009]      8940    1452690272      trace message: TraceLog: [ENTER] BOLApp::ExitInstance
    [Thu Apr  9 09:14:08 2009]      8940    1452690272      trace message: TraceLog: [ENTER] ~_BOUserUniverseManager
    [Thu Apr  9 09:14:08 2009]      8940    1452690272      trace message: TraceLog: [ENTER] ReleaseUniverseCache
    [Thu Apr  9 09:14:08 2009]      8940    1452690272      trace message: TraceLog: [EXIT]  ReleaseUniverseCache: 0
    [Thu Apr  9 09:14:08 2009]      8940    1452690272      trace message: TraceLog: [EXIT]  ~_BOUserUniverseManager: 0
    The error occurs exaclty 2 hours after the starting of the child ... I don't think it's a coincidence ....
    Edited by: David Loreto on Apr 9, 2009 11:41 AM

  • BIP fails to render a pdf report with Read timed out

    Hi,
    If a run a report with large query/data, BIP after 2 minutes fails with this error: java.sql.SQLException: java.net.SocketTimeoutException: Read timed out.
    The BIP report run a OBIEE Query, and BI Server log return this:
    [2012-07-03T14:47:39.000+00:00] [OracleBIServerComponent] [ERROR:1] [] [] [ecid: 00i8cAKOjzl7Y7k5wzCCyW0002gS0001OO] [tid: 28f0] [nQSError: 43119] Query Failed:
    [2012-07-03T14:55:23.000+00:00] [OracleBIServerComponent] [ERROR:1] [] [] [ecid: 7a1d39a9491c6b05:-116dac4a:137a8e42d31:-8000-00000000000d1d0a] [tid: 2d7c] [nQSError: 46066] Operation cancelled. [[
    ExecutePhysical Exchange
    [2012-07-03T14:47:39.000+00:00] [OracleBIServerComponent] [ERROR:1] [] [] [ecid: 00i8cAKOjzl7Y7k5wzCCyW0002gS0001OO] [tid: 28f0] [nQSError: 17012] Bulk fetch failed. [[
    [nQSError: 17001] Oracle Error code: 1013, message: ORA-01013: user requested cancel of current operation
    at OCI call OCIStmtFetch.
    How can I run the report? ...If I try the Phisical Query that OBIEE wrote on log, its work fine.
    Thank you, R.

    up!

  • HT4199 I am having the problem of "connection timed out" suddenly after almost two years of use of the same internet connection.

    I had left my apple to download an update on OS Lion overnight and found that the Mac had been disconnected from the internet with a window showing the words 'Connection timed out".  I have tried all sort of stuff including turning off and switching on my modem, the Mac, deleting entirely the key chain access (at the loss of all my other passwords which I am now rebuilding), deleting the network in my Settings and trying Assist Me to register again, all in VAIN!
    Please help.

    Connection timed out to what?  Everything?  If so, then before wiping your disk, reinstalling, further deleting your keychain entries or other related activities, please check with your ISP and see if there's a network outage, or if you've exceeded some download quota.

  • Sound problems with back line out port

    Hey everyone, I just sent an email to MSI Tech Support, but figure I would post a message here as well.  I just put together a new system, but I'm having a problem with the back line out port.
    My problem: When I plug in the front panel audio connectors (Left Audio Out, Left Audio Return, Right Audio Out, Right Audio Return) in the motherboard on pins 5-6 and 9-10 of JAUD1, the back line out does not work properly.  I get sound on only the right speaker of the headphones.
    More info:
    - Audio Driver: 5.10.0.5620 (from MSI CD)
    - If I instead plug the headphones on the front audio line out, then sound is fine
    - Here's the strange part, if I unplug the front audio connectors from the motherboard (and short pins 5-6, 9-10 with the jumpers, obviously), then the sound on the back line out works properly!
    - My Windows sound settings are fine
    Has anyone heard of this problem?  Any ideas/suggestions of what I could try?  
    Could this be a defective board?  Could it be bad wires on the case?  Seems unlikely since both back line out and front line out work depending on what I have setup.
    Help! :-)
    Thanks,
    icab

    Quote
    Originally posted by Steve F.
    You could try:
    1. Read the manual
    2. Search this forum.
    Rear sound problem
    Third time this has come up in 1 or 2 weeks.
    Steve,
    I appreciate the reply, but I believe you are wrong.  Yes, I have searched the forum and did find that thread.  Yes, I have read the manual.  The only thing that it says is: "If you don't want to connect to the front audio header, pins 5 & 6, 9 & 10 have to be jumpered in order to have signal output directed to the rear audio ports. Otherwise, The Line-out connector on the back panel will not function."  That's not my case since I want both ports to work (not outputting the signal both at the same time, obviously).
    This can't be ByDesign.  Either my board is defective or MSI is not following the Intel Front Panel I/O Connectivity Guide correctly.  The whole point of having 4 wires for the front panel audio ports, 2 of the wires being Aud_Ret_R and Aud_Ret_L, is so that the audio signal is sent to the front line out and _returned_ to the back line out if nothing is plugged in the front line out.
    I have an IBM machine with an intel mobo at work and it works as mentioned in the design guide.
    Any other ideas, anyone? I can still RMA my motherboard, but it's a design issue, i guess I'm stuck. I never got an automated reply from MSI Tech Support, so I guess my email never went through.  I'll send another email and let the forum know of the results.
    Thanks,
    Igor

  • Problems with loading Ressources out of a jar file

    Hi Folks !
    My current job for my university is to make some Java programms runnable as a WebStart Application. With most of the programms this was no problem. But i have a problem with one.
    The gui of the program loads some icons out of the jar file with the following code:
    try {
          openIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/open.png"));
          generateIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/generate.png"));
          editIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/edit.png"));
          propertiesIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/properties.png"));
          alphabetIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/alphabet.png"));
          cutIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/cut.png"));
          saveIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/save.png"));
          helpIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/help.png"));
          aboutIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/about.png"));
          exitIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/exit.png"));
          startIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/start.png"));
          stopIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/stop.png"));
          preferencesIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/preferences.png"));
          okIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/ok.png"));
          noIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/no.png"));
          clearIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/clear.png"));
          plusIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/plus.png"));
          minusIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/minus.png"));
          overlapIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/overlap.png"));
          canselIcon = new ImageIcon(ClassLoader.getSystemResource("guissstester/icons/cansel.png"));
        catch(NullPointerException e){
          JOptionPane.showMessageDialog(frame,
              "There was an error while loading icon files. Probably the needed icon files are not present.",
              "Missing icon files!", JOptionPane.ERROR_MESSAGE);
        }When i start the program as a normal jar with
    java -jar ssstester.jarAll Icons are loaded normaly. But when i start it as a WebStart Application i get the catch (NullPointerException e) error message "There was an error while loading icon files. Probably the needed icon files are not present. Missing icon files!".
    So where is the problem ? Don't know if it is important, but the Application gets full rights in the jnlp File
    <security>
        <all-permissions/>
    </security>Greetings and sorry for my horrible english,
    Christoph

    Thread.currentThread().getContextClassLoader().getResource(imageFilePath); to load the images than the one you are using right now
    Edited by: Mayya on Jun 17, 2008 4:34 AM

  • TMG 2010 report problem Operation has timed out

    Hello.
    I stuck and i'm really need assistance
    We has a TMG 2010 RTM version and i decide to update it to latest rollup and SP (dumb head)
    So at now we have TMG 2010 SP2 rollup 4.
    Before i update TMG reports work fine but at now reports not working at all.
    When i try execute a report ( or shedule daily or weekly report) i have same issue 
    Error 31289:
    The report "Daily" could not be generated. Report Server error information: The report Daily could not be generated. Report Server error information: The operation has timed out.
    The error occurred on object 'Reports' of class 'Reports Configuration' in the scope of array 'TMG`
    I read all guidliness( include this http://www.isaserver.org/tutorials/Microsoft-Forefront-TMG-How-to-use-SQL-Server-2008-Express-Reporting-Services.html) and not find something useful.
    Settings correct, and i not changed any settings.
    And at now my ideas end i ask your help.

    That would be expected as the RAT key does not exist by default on a TMG system. You will need to create it and the subkeys referenced along with the values.
    Create as described in the article. 
    Hth, Anders Janson Enfo Zipper

  • Can anyone help with "session timed out" at iTunes store?

    I am trying to purchase music from the iTunes store and I am being asked to accept Terms and Conditions to continue which I do - I check the box and I click on accept (immediately). At this point I am told that my session has timed out and to try again. I cannot get past this step, I'd appreciate some advise.  Thank you.

    I used to see that in iOS6 once in a while. Close the apps and reboot the iPad and then look in the apps again. You know how to close the apps so close them first.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • Problem with Queue Implementation

    Hi there !
    I can't solve the implementation of an exercize about Queue.My teacher wrote down just the interface Queue and the first part of the class ArrayQueue implementation.They are the following :
    public interface Queue<E>
       public int size();
       public boolean isEmpty();
       public E front() throws EmptyQueueException;
       public void enqueue (E element);
       public E dequeue() throws EmptyQueueException;
    public class ArrayQueue<E> implements Queue<E>
       public ArrayQueue(int cap)
          capacity = cap;
          Q = (E[]) new Object[capacity];
       public ArrayQueue()
          this(CAPACITY);
    }So the teacher asked to complete the code. I have tried and retried so many times for 3 days.I know it's so easy and I understood how it should work but when I try to write down the code I can't get the final solutions but only mistakes.
    During my attempts my better code was this :
    package queue;
    public class ArrayQueue<E> implements Queue<E>
         @SuppressWarnings("unchecked")
         public ArrayQueue(int cap)
            capacity = cap;
            Q = (E[]) new Object[capacity];
         public ArrayQueue()
            this(CAPACITY);
         public String toString()
            int count = 0;
            for(E element : Q)
                 return count +")"+(String)element;
            count++;
            return null;
         public void enqueue(E element)
              try
                   if(element == null)
                        throw new IllegalArgumentException();
                   if (size() == capacity)
                     throw new FullQueueException();
                   if(Q[rear] == null)
                      Q[rear] = element;
                      rear++;
              catch (FullQueueException e)
                   System.out.println("The Queue is Full !");
         public E dequeue() throws EmptyQueueException
              try
                 E temp;
                 if (isEmpty())
                      Q = (E[]) new Object[capacity];
                      front = 0;
                      rear = 0;
                     throw new EmptyQueueException();
                temp = Q[front];
                 Q[front] = null;
                 front++;
                 return temp;
              catch(EmptyQueueException e)
                   System.out.println("The Queue is Empty !");
              return null;
         public E front() throws EmptyQueueException
              try
                 if(Q[front] == null)
                           front++;
                 if (isEmpty())
                     throw new EmptyQueueException();
                 return Q[front];
              catch(EmptyQueueException e)
                   System.out.println("The Queue is Full !");
              return null;
         public int size()
              return (front + rear);
         public boolean isEmpty()
            return (front == rear);
        public Object[] getQueue()
            return Q;
         protected int capacity;
         public static final int CAPACITY = 1000;
         protected E Q[];
         protected int front = 0;
         protected int rear = 0;
    }But the problems are that I can add the element through the method enqueue() and delete it through dequeue() then,but after deleting it the array size is the same and when I print the array elements I see some null,so if I add a new element I get the message of the class FullQueueException because of the size which it's the same.
    Moreover if I delete all the elements and then I print the value returned by the method front() I get the NullPointerExceptionError because the returned value is null,but I think it should print it ! But he doesn't!
    How should I fix these problems ?
    I also wondered during all my attempts how to repeat this procedure after the array size limit is reached.What I really mean is if I delete the element Q[0] and the index front = 1 and rear = n - 1 for example,how can I add with the method enqueue() a new element in Q[0] again ?
    Can you help me courteously ?
    I hope my explanation was clear because of my English !
    Thanks in Advance !

    Thanks for all your suggestions men ^^ !
    I changed some things in the code :
    package queue;
    public class ArrayQueue<E> implements Queue<E>
         @SuppressWarnings("unchecked")
         public ArrayQueue(int cap)
            capacity = cap;
            Q = (E[]) new Object[capacity];
         public ArrayQueue()
            this(CAPACITY);
         public String toString()
              String s = "[";
              int count = 0;
              for (int i = front; i < rear; i++) {
                   count++;
                   s += Q.toString() + (i < rear - 1 ? "," : "");
              s += "] (" + count + " elements)";
              return s;
         public void enqueue(E element)
              try
                   if (size() == capacity - 1)
              throw new FullQueueException();
                   Q[rear] = element;
                   rear = (rear + 1) % capacity;
              catch (FullQueueException e)
                   System.out.println("The Queue is Full !");
         public E dequeue() throws EmptyQueueException
              try
              E temp;
              if(isEmpty())
              throw new EmptyQueueException();
         temp = Q[front];
              Q[front] = null;
              front = (front + 1) % capacity;
              return temp;
              catch(EmptyQueueException e)
                   System.out.println("The Queue is Empty !");
              return null;
         public E front() throws EmptyQueueException
              try
              if (isEmpty())
              throw new EmptyQueueException();
              return Q[front];
              catch(EmptyQueueException e)
                   System.out.println("The Queue is Empty !");
              return null;
         public int size()
              return (capacity - front + rear) % capacity;
         public boolean isEmpty()
    return (front == rear);
         protected int capacity;
         public static final int CAPACITY = 1000;
         protected E Q[];
         protected int front;
         protected int rear;
    }Now after I delete an element and I use the method enqueue() to add a new one the algorithm does,but
    after I delete all the elements I get an element null when I add the element in the array position n - 1.
    I have fixed the method toString() as pgt told me to do and it's really great,but dunno why sometimes when I delete an element it says the array has 0 elements also if the array is almost full !
    About my code changements,according to my university friend I should reduce front and rear mod the capacity and that's what marlin314 suggested me to do too and I had to change the expression if(size() == capacity) to if(size() == capacity - 1).But the algorithm doesn't work as it should do !                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Problem with queues / stacks for a project

    I have to code a calculator that turns an infix expression, where the operator is in the middle, to a postfix expression, where the operators are at the end;
    so, for instance, 5 + 5 would really be 5 5 +, and 5 + 5 * 5 / 5 would be 5 5 5 5 + * /.
    I've gotten the addition and subtraction working fine, the only problem comes when I have to take into account order of operations (so far).
    So, that being said, here is the code:
    import java.util.*;
    public class iCalc {
          * @param args
         public static void main(String[] args) {
         //     Scanner scan = new Scanner(System.in);
         //     System.out.println("Equation:");
         //     String input = "55+5-10%16."; //might have to store each element in a linked list later
         //     evalExp(input);     //calls evalExp with the input
              String input2 = "55 + 5 * 10 + 16";//declare some dummy input
              //121
              String [] items = input2.split(" ");//split the string's elements into an array
              Queue<String> queue = new LinkedList<String>();//the queue
              Stack<String> stack = new Stack<String>();//make a new stack to store operators
              Stack<String> stackOutput = new Stack<String>();//output stack
              for (String s : items) {//scan the array
                  System.out.println("item : " + s);//print out what's being scanned
                  if(isNumber(s)) queue.add(s);//add it onto the queue
                  if(isOperator(s)) stack.push(s);//add it onto the stack
              //converts to postfix here
             while(!stack.isEmpty()) queue.add(stack.pop());
             evalExp(queue, stackOutput);
         public static void evalExp(Queue<String> exp, Stack<String> outputStack)
              System.out.println("Evaluating the expression...");
              int length = exp.size();
              int temp;
         while(length > 0)
              // 55 5 10 16 + * +
              // 55
              try{
                   length--;
                   System.out.println("Trying to see if the element is a number...");
                   if(isMultiplyOrDivide(exp))//is there a multiply or divide operator
                        int spot = findMultiplyOrDividePosition(exp);//if yes, finds its position in the operators and stores it as an int
                        temp = 0;
                        for(String s : exp)
                        {//PROBLEM: After the first iteration, it suddenly has an empty stack exception
                             temp++;//keeps track of how far you are into the queue
                             outputStack.push(exp.remove());//take the head of the queue, and push it onto the stack
                             if(temp == spot+1)
                                  break;     //(if there were enough elements in the queue popped, end this loop
                        outputStack.push(performMath(outputStack.pop(), outputStack.pop(), popTheOperator(exp)));
                   Double MyNum = Double.parseDouble(exp.remove());
                   String MyStackNum = "" + MyNum;
                   outputStack.push(MyStackNum);
                        if(outputStack.size() == 2)
                             length--;
                             String operator = popTheOperator(exp);
                             System.out.println("Two numbers have been popped, time to find the operator...");     
                             outputStack.push(performMath(outputStack.pop(), outputStack.pop(), operator));
                             for(String s : exp)
                                  if(s.equals(operator))
                                       exp.remove(s);
                                       break;
              }     catch(Exception ParseException){
                   outputStack.push(performMath(outputStack.pop(), outputStack.pop(), exp.remove()));               
              while(!outputStack.isEmpty()) System.out.println("The output stack is:" + outputStack.pop());     
         public static boolean isNumber(String s1)
              char[]arr2 = s1.toCharArray();
              for(int i = 0;i<s1.length();i++)
                   System.out.println("checking...." + s1);
                   if((!Character.isDigit(arr2))) return false;
              return true;
         public static boolean isOperator(String s2)
              char[]arr3 = s2.toCharArray();
              for(int i = 0;i<arr3.length;i++)
                   System.out.println("checking...." + arr3[i]);
                   if(findOperator(arr3[i])) return true;
              return false;
         public static boolean findOperator(char op)
                        if(op == '+' ||
                             op == '-' ||
                             op == '/' ||
                             op == '*' ||
                             op == '%' ||
                             op == '^' ||
                             op == '&' ||
                             op == '(' ||
                             op == ')' ||
                             op == '|' ||
                             op == '>' ||
                             op == '<' ||
                             op == '=' ||
                             op == '!' ) return true;          
              return false;          
         // 10 16 + + +
         public static String popTheOperator(Queue<String> myQueue)
              String current = "";
              for(String s: myQueue)
                   if(s.equals("*") || s.equals("/"))
                        current = s;
                   break;
              if(current == "")
                   for(String s: myQueue)
                        if(s.equals("+") || s.equals("-"))
                             current = s;
                             break;
         return current;     
         public static String performMath(String operand1, String operand2, String operator)
              String myString = "";
              double result = 0;
              double temp1 = Double.parseDouble(operand1);
              double temp2 = Double.parseDouble(operand2);
              if(operator.equals("+"))
                   result = temp1 + temp2;
              else if(operator.equals("-"))
                   result = temp2 - temp1;
              else if(operator.equals("/"))
                   result = temp1 / temp2;
              else if(operator.equals("*"))
                   result = temp1 * temp2;
              else if(operator.equals("%"))
                   result = temp1 % temp2;
              else if(operator.equals("^"))
                   result = Math.pow(temp1, temp2);
              else if(operator.equals("&"))
              else if(operator.equals("|"))
                   result = temp1 - temp2;
              else if(operator.equals(">"))
                   if(temp1 > temp2)
                        result = 1;
                   else result = 0;
              else if(operator.equals("<"))
                   if(temp1 < temp2)
                        result = 1;
                   else result = 0;
              else if(operator.equals("="))
                   if(temp1 == temp2)
                        result = 1;
                   else result = 0;
              else if(operator.equals("!"))
                   if(temp1 != temp2) result = 1;
                   else result = 0;
              myString = "" + result;
              return myString;
         public static boolean isMultiplyOrDivide(Queue<String> myQueue)
              for(String s : myQueue)//scan the queue
                   if(s.equals("*") || s.equals("/"))
                        return true;//it has found a multiply/divide operator!
              return false;
         public static int findMultiplyOrDividePosition(Queue<String> myQueue)
              int position = 0;
              for(String s: myQueue)
                   if(s.equals("+") ||
                                  s.equals("-") ||
                                  s.equals("%") ||
                                  s.equals("^") ||
                                  s.equals("&") ||
                                  s.equals("|") ||
                                  s.equals(">") ||
                                  s.equals("<") ||
                                  s.equals("=") ||
                                  s.equals("!")) position ++;
              return position;
    }I think that its trying to remove the head, but because the head was already removed, somehow its not letting it remove it; as if by removing the head, there is no new updated head.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

                   if(isMultiplyOrDivide(exp))//is there a multiply or divide operator
                        int spot = findMultiplyOrDividePosition(exp);//if yes, finds its position in the operators and stores it as an int
                        temp = 0;
                        for(String s : exp)
                        {//PROBLEM: After the first iteration, it suddenly has an empty stack exception
                             temp++;//keeps track of how far you are into the queue
                             outputStack.push(exp.remove());//take the head of the queue, and push it onto the stack
                             if(temp == spot+1)
                                  break;     //(if there were enough elements in the queue popped, end this loop
                        outputStack.push(performMath(outputStack.pop(), outputStack.pop(), popTheOperator(exp)));
                   }the problem is somewhere in here.

  • Problems with "queue" to Media Encoder

    I just downloaded the latest CC updates yesterday which was for AME and PPCC ...
    After the update when i go to >EXPORT> MEDIA > then press queue it locks up/stalls. Nothing goes to AME. I have to keep turning off the process.
    I tried a 3 minute clip and it worked but anything above 20 mins it stalls...
    Rather than "queue" i have to use "export" which means i cannot use premiere pro while it exports my project. I usually have to export 4-5 things from one project so its very time consuming and its waisting alot of my time.
    I tried opening up AME seperately then either drag and drop or go to >add files and adding the sequences from the project, but when i do this i get a message that say "READING XMP' and it just stays like that for ever unless i kill it through task manager...
    I run a production company so these kind of issues are super frustrating and costing me money.
    Im guessing its has someonthing to do with the new updates as this wasnt occuring before the updates... has anyone had same issues ?
    Shouldnt be having these basic problems.... Pls fix or help asap ADOBE !!!
    windows 7
    adobecc
    i7-2600K 3.40Ghz
    16GB ram
    just realised some other wierd things since the update..... is there anyway of taking off the latest updates and rolling back to the previous version ?

    Just a comment:
    I'd say you found a workaround...not a solution, though it's helpful to know there IS a way around the problem.
    I'm having a similar problem, and am still searching for an answer. (Unfortunately, my project is due tonight, and I'll suffer the lengthy software-only encoding, spending time in this forum rather than gamble/waste time experimenting/uninstalling/re-installing). This is ruining my Easter weekend.
    This is my 2nd round of problems using CC (a few months back I uploaded a file which went missing for a few days while Adobe scrambled to fix what was apparentyl a widespread problem, while I had to re-build a project from a prior version. That took me days, though I did it before the file I uploaded was "found". And, of course, I encountered the problem following the latest update at the time...just like today's problem).
    I get the sense they're pushing things out, i.e. new "versions"/"updates", before adequate testing is done. I worked in QA for many years in the corp hq of a Fortune 500, and was afraid CC would suffer the "rush" to distribute without proper testing. I feel as if end-users are testing new updates, which makes me question the reliability of new releases. Unfortunately, this raises questions about CC being "professional-level software". If it's not thoroughly tested, how can professionals rely on it?
    End of rant...Thanks.

  • Problems with IO timing constraints

    I am developing a system for Virtex-6 FPGA under ISE environment.
    Now I have several I/O pins that need to be constrained in timing.
    I have an overall system clock called sys_clk in 100MHz, and a logic-generated clock called sr_clk in 125MHz.
    I need to make offset constraints referring to sr_clk. However, it seems that the constraint editor will only recognize sys_clk. Any constraints with sr_clk reference are invalid.
    How could I solve such problem?

    Thanks 
    I have tried the following statements in my ucf file:
    NET "sys_clk_n" LOC = T7 | TNM_NET = "SYSCLK";
    NET "sys_clk_p" LOC = T8 | TNM_NET = "SYSCLK";
    TIMESPEC TS_SYSCLK  = PERIOD "SYSCLK" 100 MHz HIGH 50 % PRIORITY 100 ;
    NET "sr1_clk_out" LOC = AR20 | TNM_NET = SRAM_CLK;
    NET "sr2_clk_out" LOC = AW16 | TNM_NET = SRAM_CLK;
    TIMESPEC TS_SRAM_CLK = PERIOD "SRAM_CLK" 125MHz HIGH 50% PRIORITY 100 ;
    TIMEGRP "SRAM_DATAADDR" OFFSET = IN 2 ns AFTER "sr1_clk_out" HIGH;
    TIMEGRP "SRAM_DATAADDR" OFFSET = OUT 2 ns BEFORE "sr1_clk_out" HIGH;
    The final timing report after P&R shows that there are 0 paths analysed for last 3 constraints during the process. 

Maybe you are looking for

  • Getting error:Absence type 100 was not found in Customizing for

    Hi, I am using the Standard workfllow for leave application, and when i am  creating the request i am getting the bleow error: 'Absence type 100 was not found in Customizing for 21.10.2010' What could be the reason, i have configured the statndard se

  • How to enter bios and install multiple OS

    I just bought a HP Envy 700 430 QE.  I can't even get into my BIOS to change the order of boot and set  up new hard drives.  I have an OCZ 240 \GB PCI SSD and two Samsung SSDs.  On my old Gateway, I could press Del to get into Bios and then F12 to se

  • Error at the time of Display of Excise Invoice.

    Dear All, My Excise Invoice got saved with the correct values and also the correct number got generated.However when I am going to the display of excise invoice and input the excise invoice number,given the excise year as 2008 and given the correct s

  • Error message: The iTunes Library file cannot be saved. An unknown error occurred (-54).

    I opened iTunes and downloaded 2 songs from http://www.reverbnation.com. Shortly after I started getting this error message: The iTunes Library file cannot be saved. An unknown error occurred (-54). Anyone dealt with this before?

  • PS Elements 11

    PS elements 11 lässt sich nicht mit Win 8.1 öffnen. Über ein mit PSE11 bearbeitetes Bild öffnet sich das Program und funktioniert einwandfrei.