Stack problems...

writing a program to convert an infix expression to post fix. I first need to check to make sure there are a correct amount of parenthesis in the equation by checking if is an "(" then push it to stack, if it is a ")" then check if stack is empty, and if not then pop stack. Lastly at the end of parsing the string I should check if stack is empty and if it isn't print an error.
My problem right now is when I try to run my application as I get an error msg in my prompt window as follows:
exception in thread "main" java.lang.NoSuchMethodError: main
here is my code:
import java.io.*;
import java.util.*;
import java.util.Stack;
import java.lang.String.*;
public class temp
public static void main(){
//Read in string using Keyboard class
     String infix = "";
     Stack myStack = new Stack();
     System.out.print("Enter Equation:");
     infix = Keyboard.readString();
     for (int n=0;n<infix.length();n++){
               char ch = infix.charAt(n);
               if (ch == '('){ myStack.push(new Character(ch));}
               if (ch == ')'){
                    if(myStack.empty()){ System.out.print("Error: Missing (");
                    }else{ myStack.pop();}
     if(myStack.empty()){ System.out.print("Equation Correct");}
     else{ System.out.print("Error: Missing )");}
}Thanks for any help!

thanks... now I'm getting
line 9: <identifier> expected
public static void main(String[]){
and
line 9: missing method body, or declare abstract
public static void main(String[]){                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Image size and stacking problem with FF12 even in safe mode. Images are 5x the right size and overlayed on top of other pictures or text. how to fix?

    OK this problems limited to Facebook only. When logged in FF12 the entire page is scrambled. The pictures are stacked over each other and are 5 to 6 times the size their supposed to be. I have tried everything I could think of to fix this it even runs like this when in safe mode. I have uninstalled all plugins and all extensions I have uninstalled and even tried back dating FF. it's still so massively out of proportion that you can't do anything. .even when zoomed out 3x it's so large the pictures are larger than my screen. They are still overlapped so bad you can't do a thing with it. Even worse I uninstalled and installed pale moon and the effects migrated to that browser as well. Only browser I found unaffected by this is IE. Lord knows I don't wanna ever have to go that rout so I'm asking for help. I have a whole list of parsing errors and decoration drops, to many to post. any help would be much appreciated until it's fixed I'm stuck with IE. Chrome wont work with the software I run only IE or FF will.

    -> press '''CTRL''' + '''0''' (zero) to '''Reset''' Zoom
    * For details, see this article -> [[How do I use Zoom?]]
    Check and tell if its working.

  • Load files into Stack Problems

    So what happen was this. I make GIFs as a hobby. But what happen was that 3 days ago, I opened my Photoshop CS5.1 Extended version 12.1 (x64) and did the usual thing.
    I went to Scripts and to Load Files into Stacks. I loaded my files and pressed OK. So here's the funny part, usually, the pictures will load by itself and eveyrthing will be in order. But what happen was that the layers load to around 6 to 7 layers and everything just disappear. Literally disappear. Like I didn't even load anything. No canvas, no images, nothing. I thought it was a bug or something so I reinstalled my CS5 but the problem remains.
    So I try with my CS6 Extended version 13.0 x64. (That I barely use because I'm still more comfortable with CS5.) And the same thing happens.
    I decided to Google it and nothing comes up. I do not know whether is it my laptop or something went wrong somewhere. This has never happen before for the amount of time I have CS5.
    I even change my scratch disc space. Last time it was on (C) with around 20GB space and nothing happens. So I changed it to my D drive and it has atleast 150GB space. I even tried closing every applications I have to test whether is it something related to my ram. But nothing happens. The problem remains.
    So I require some help because I asked around and it appears that none of my friends knows whats wrong.
    Here's my system information:
    Window 7 Ultimate Service Pack 1
    Intel (R) Pentium (R) CPU B970 @ 2.30GHZ
    6.00 GB Ram
    Running on 64-bit OS
    Graphics:
    Intel(R) HD Graphics Family

    When you start having problems with Photoshop.  Most of the time its because of something external to Photoshop or your user id Photoshop preferences.   Reinstalling Photoshop seldom fixes these problem. For User preferences survive across the reinstall. Third party plug-in may as well. Since you have the problem with both CS5 and CS6 it may have to do with the files your loading into the stack. For that something both version are trying to process.  CS5 and CS6 haves separate Preferences and third party add on must be installed into each though they may share plug-in if you use Photoshop Preferences to and a additional plug-in path and you use the same path for CS5 and CS6.

  • Java Stack Problem

    Dear Gurus,
    Right Now I have Installed in my server sapfs Abap stack+Java stack.Abap stack is working fine,Java stack also config toll is working fine.Iam new to Java Stack,I have open explorer and given this path http://hostname:5<instanc no of java>00/irj/portal but page cannot displayed.Please give sugestion any problem with Java stack or else any parameter I have to set.
    Best Regards,
    kk

    Hello krishna murthy,
    I would suggest you use jcmon to test whether java stack is really running, because network or browser could prevent java page being properly displayed. Usage:
    logon as <sid>adm
    jcmon pf=<you instance profile>
    then "20", you will see whether java dispatcher, server, sdm running. If running, it should like:
    |Idx|Name               |PID     |State                |Error|Restart|
    |---|-------------------|--------|---------------------|-----|-------|
    |  0|dispatcher         |   25298|Running              |    0|yes    |
    |  1|server0            |   25299|Running              |    0|yes    |
    |  2|SDM                |   20917|Running              |    0|yes    |
    good luck.
    Rongfeng

  • Catalyst (3750 24 10/100/1000T) and (3750 12 SFP) Stacking Problems

    Dear all
    I'm having a very strange situation here (at least for me)
    we have 4 core switches
    2 x   WS-C3750G-24T-S Catalyst 3750 24 10/100/1000T + IPB Image
    and
    2 x   WS-C3750G-12S-S Catalyst 3750 12 SFP + IPB Image
    Stack configuration is done this way
    when the switches are powered on, the first two SFP core switches are seen as a single stack with the stack master LED turned green on the first switch
    the other two (24 10/100/1000T) switches have the RPS LEDs always green, mode cannot be changed, and cannot be accessed by Console connection
    but when the (24 10/100/1000T) are powered off, the first (SFP) switch in the stack reports that " Switch 3 and 4 has been removed from Stack "
    which means they are stacked but there's something wrong, because
    only the SFP ports are shown in the " Show interfaces status " , the ethernet ports of the bottom switches are not present !!!
    can you please tell me what's the poblem ?

    Dear Daniel
    Sorry for my delayed response but i was actually quite busy
    but the problem was actually in another sense
    the default profile for the Catalyst 3750 SFP is the Aggregate SDM Template
    while the 3750 10/100/1000 ethernet Switch Default SDM profile was Desktop profile
    so i had an SDM mismatch
    DATACENTER#sh switch detail
    Switch/Stack Mac Address : 081f.f3cf.1c80
                                               H/W   Current
    Switch#  Role   Mac Address     Priority Version  State
    *1       Master 081f.f3cf.1c80     1      0       Ready              
    2       Member 081f.f3cf.5900     1      0       Ready              
    3       Member aca0.16ac.0180     1      2       SDM Mismatch       
    4       Member aca0.16a3.bc80     1      2       SDM Mismatch 
             Stack Port Status             Neighbors    
    Switch#  Port 1     Port 2           Port 1   Port 2
      1        Ok         Ok                2        4
      2        Ok         Ok                3        1
      3        Ok         Ok                4        2
      4        Ok         Ok                1        3 
    all i did was changing the default profile of the SFP switches into the Desktop Profile and problem was solved
    switch 1 provision ws-c3750g-12s
    switch 2 provision ws-c3750g-12s
    switch 3 provision ws-c3750g-24t
    switch 4 provision ws-c3750g-24t
    system mtu routing 1500
    ip subnet-zero
    no file verify auto
    spanning-tree mode pvst
    spanning-tree extend system-id
    vlan internal allocation policy ascending
    interface GigabitEthernet1/0/1
    interface GigabitEthernet1/0/2
    interface GigabitEthernet1/0/3
    interface GigabitEthernet1/0/4
    interface GigabitEthernet1/0/5
    interface GigabitEthernet1/0/6
    interface GigabitEthernet1/0/7
    interface GigabitEthernet1/0/8
    interface GigabitEthernet1/0/9
    interface GigabitEthernet1/0/10
    interface GigabitEthernet1/0/11
    interface GigabitEthernet1/0/12
    interface GigabitEthernet2/0/1
    interface GigabitEthernet2/0/2
    interface GigabitEthernet2/0/3
    switchport trunk encapsulation dot1q
    switchport mode trunk
    interface GigabitEthernet2/0/4
    interface GigabitEthernet2/0/5
    interface GigabitEthernet2/0/6
    interface GigabitEthernet2/0/7
    interface GigabitEthernet2/0/8
    interface GigabitEthernet2/0/9
    interface GigabitEthernet2/0/10
    interface GigabitEthernet2/0/11
    interface GigabitEthernet2/0/12
    interface GigabitEthernet3/0/1
    interface GigabitEthernet3/0/2
    interface GigabitEthernet3/0/3
    interface GigabitEthernet3/0/4
    interface GigabitEthernet3/0/5
    interface GigabitEthernet3/0/6
    interface GigabitEthernet3/0/7
    interface GigabitEthernet3/0/8
    interface GigabitEthernet3/0/9
    interface GigabitEthernet3/0/10
    interface GigabitEthernet3/0/11
    interface GigabitEthernet3/0/12
    interface GigabitEthernet3/0/13
    interface GigabitEthernet3/0/14
    interface GigabitEthernet3/0/15
    interface GigabitEthernet3/0/16
    interface GigabitEthernet3/0/17
    interface GigabitEthernet3/0/18
    interface GigabitEthernet3/0/19
    interface GigabitEthernet3/0/20
    interface GigabitEthernet3/0/21
    interface GigabitEthernet3/0/22
    interface GigabitEthernet3/0/23
    interface GigabitEthernet3/0/24
    interface GigabitEthernet4/0/1
    interface GigabitEthernet4/0/2
    interface GigabitEthernet4/0/3
    interface GigabitEthernet4/0/4
    interface GigabitEthernet4/0/5
    interface GigabitEthernet4/0/6
    interface GigabitEthernet4/0/7
    interface GigabitEthernet4/0/8
    interface GigabitEthernet4/0/9
    interface GigabitEthernet4/0/10
    interface GigabitEthernet4/0/11
    interface GigabitEthernet4/0/12
    interface GigabitEthernet4/0/13
    interface GigabitEthernet4/0/14
    interface GigabitEthernet4/0/15
    interface GigabitEthernet4/0/16
    interface GigabitEthernet4/0/17
    interface GigabitEthernet4/0/18
    interface GigabitEthernet4/0/19
    interface GigabitEthernet4/0/20
    interface GigabitEthernet4/0/21
    interface GigabitEthernet4/0/22
    interface GigabitEthernet4/0/23
    interface GigabitEthernet4/0/24
    that's it !
    : D
    cheers

  • Stacking Problem in pam.conf on Solaris 10 ?

    Hi all,
    I have pam.conf with enteries for
    # Default definition for Password management
    # Used when service name is not explicitly mentioned for password management
    *other password required pam_dhkeys.so.1*
    *other password requisite pam_authtok_get.so.1*
    *other password requisite pam_authtok_check.so.1*
    *other password required pam_authtok_store.so.1*
    As per my understanding the
    (I) SPI pam_authtok_get.so.1 is used to get the user credentials from password DB.
    (II) SPI pam_authtok_check.so.1* is used to check if the new password supplied is satisfying the password policy on the OS ( by reading values from /etc/default/passwd )
    (III) SPI pam_authtok_store.so.1* is used to store the newly entered password to password db.
    Please correct me if I am wrong anywhere.
    Now I have a requirement thar an application has to be wriiten which will just check that the entered password satisfies the password policies of the OS or not, but it should not update the password DB(should not store the password)
    I make the following enteries in my pam.conf
    osPasswdCheck password required pam_dhkeys.so.1
    osPasswdCheck password requisite pam_authtok_get.so.1
    osPasswdCheck password requisite pam_authtok_check.so.1
    I removed the entry for pam_authtok_store.so.1 as I dont want to store the but when I run my application it always give error 20 authentication manipulation error.
    please refer (/usr/include/security/pam_appl.h)
    I have done all the formalities w.r.t writing a PAM Conversation funtion and the application is returning success when I add the pam_authtok_store.so.1 into the SPI
    Please anyone can help me out.Is there is anyother way with which I can use my application just to check password (w.r.t. OS policy) .
    I will be really thankful if anybody can provide me with working PAM Modules stack for achieving it.
    Thanks in advcance.
    Regards,
    Rahul.
    but I dont want to store it.

    Why not just keep the "pam_authtok_store.so.1" line in your pam.conf file and set it to a level of "requisite" or lower? I haven't tried it myself yet, but I've found that in the past when editing this file, completely removing a line rather than giving the PAM stack what it would expect to see with that line being there in some way can also cause problems.

  • 1.2 RAW + JPEG Stacking problem

    I have posted this elsewhere, but nobody seems to understand my problem, I hope I can describe it correctly here...
    Lightroom 1.2 is stacking photos automatically where the filename is the same, although the extensions are different:
    All my photos are stored in folders by Date (i.e. I have a folder named "2007 10 04", which has 93 photos taken on that date). I have 2 files that have similar names (from different cameras). One file is of a duck and is named "IMG001.CR2", and the other file is of a cat named "IMG001.JPG". Lightroom has seen these files as the same photo and displays the duck photo, but hides the cat photo. The thumbnail only shows the duck photo, and has the header "CR2+JPG" to show me there are 2 photos. I want to separate these photos from each other, but cannot see how!
    I hope this makes sense.

    I don't think you CAN view them seperately later if they are 'joined'.
    Way I heard it described was that it shows CR2+JPG as a 'convenience' so you know its there and Lightroom didn't just totally ignore it. (And apparently it would use it as a sidecar for display until LR created its own previews.)
    Initially in 1.0 LR wouldn't let you import the jpegs at ALL unless they were in a different folder from the RAW images. This was because it was apparently thought that no "real" workflow by a "real" photographer would involve anyone wanting to look at the jpegs if the RAW existed, and being "smarter" than the user it wouldn't bring them in at all if they were side by side. Wasn't until they got flamed for this and some battles behind the scenes that they begrudgingly allow us to now do this.
    What I'll probably do is evntually start stacking my jpegs with my RAW images... I wish there was an option to AUTOSTACK RAW to jpeg on import.

  • Import/Stack problem

    Hi all,
    I imported a database from windows box to an Aix box (both with oracle 9i). I created a new database on Aix (with same name as in windows) before importing. When I launch Imp command (full=y, ignore=y,commit=y) all work fine for several minutes, when I receve an error message like this:
    ----- Argument/Register Address Dump -----
    Argument/Register addr=1d15. Dump of memory from 0x1CD5 to 0x1E15
    1CC0 00000000 00000000
    00000000
    1CE0 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000
    Repeat 8 times
    ----- End Call Stack Trace -----
    What's the problem? How can I resolve it??
    Thanks for suggestion!!

    You are right!
    The error is:
    kgepop: no error frame to pop to for error 21500^M
    OCI-21500: internal error code, arguments: [kopuigpfx1], [13], [], [], [], [], [], []^M
    Errors in file :^M
    OCI-21500: internal error code, arguments: [kopuigpfx1], [13], [], [], [], [], [], []^M
    ^M
    ^M
    ----- Call Stack Trace -----^M
    calling call entry argument values in hex ^M
    location type point (? means dubious value) ^M
    -------------------- -------- -------------------- ----------------------------^M
    skgudmp+0048 bl kgdsdst D081C ? FFFFCF44 ?^M
    kgepop+0094 bl _ptrgl               ^M
    kgeasnmierr+0070 bl kgepop 100 ? 0 ? 0 ?^M
    kopuigpfx+0070 bl kgeasnmierr 10347BF0 ? 10350540 ?^M
    8394B4 ? 1 ? 4 ? D ?^M
    FFFFA8C8 ? FFFFA8C4 ?^M
    koxxri2c+0114 bl kopuigpfx FFFFAAE0 ? 0 ? 0 ?^M
    koxxri2c+0260 bl koxxri2c 8332B0 ? 1034D7A8 ?^M
    FFFFAD10 ? 10305435 ? 9C628 ?^M
    koxxi2c+0138 bl koxxri2c 38 ? 200FEFE0 ? 102FF5B0 ?^M
    A004C5E8 ? 2 ?^M
    koxx2itc+0038 bl koxxi2c 16 ? 16 ? 87DED8 ? 0 ?^M
    102FF5BB ? A004C5E8 ? 1 ?^M
    22 ?^M
    kopzxitc+011c bl koxx2itc 1045ECC8 ? FFFF ? FFFFB0D0 ?^M
    0 ? 896468 ? 10322240 ?^M
    FFFFB0D0 ? 36 ?^M
    impted+0820 bl kopzxitc 0 ? 10062178 ? FFFFB1A0 ?^M
    102FF130 ? FFFFB1A0 ?^M
    A004C668 ? FFFFB1E0 ?^M
    A0048BC0 ?^M
    impins+202c bl impted FFFFCF24 ? 36 ? 10305450 ?^M
    0 ? 256C7520 ?^M
    do_insert+0488 bl impins 10099848 ? 13 ? 13 ? 825F0C ?^M
    imptabwrk+00f0 bl do_insert 80A4C8 ?^M
    impdta+0418 bl _ptrgl               ^M
    impdrv+2d64 bl impdta ^M
    main+0010 bl impdrv 40000000 ? 200FEA08 ?^M
    __start+0090 bl main 0 ? 0 ?^M
    ^M
    ----- Argument/Register Address Dump -----^M
    ^M
    Argument/Register addr=d081c. Dump of memory from 0x1000D07DC to 0x1000D091C^M
    00000001

  • 2960s stack problem

    I have a problem with 4 cisco 2960-s Switches in a stack.
    2 of the switches are 2960-48fps-l
    1 is a 2960-f48fps-l
    and 1 is a 2960-24pd-l
    The problem I ran into is the 2960-f48fps-L was running version 15 out of the box so I got a version mismatch when I did a show switch. So i upgraded all 4 switches to the newest ios 15.0.2 when they rebooted now 2 of them say provision and the f48fps does not even show. I have tried everything from moving the cables around to wiping the config on all 4 switch to setting provision setting to setting priority. If I go back to the original version 12.2 on the other 3 switch they all work fine but the oldest version on the f48fps is 15. I have tried everything all with no luck can anyone help?

    Hi,
    Can you make sure that all of the switches use the same SDM template? You can check that with the show sdm prefer command.
    Hope this helps.

  • Stack Problem

    This is a major problem I got with stacks...I've been trying for hours and my professor never emailed me back with help so I am turning to the forums for help.
    I have to do a few things with stacks & these are my problems:
    1. I have to copy the top element in a stack to an INT
    2. I have to take the larger number after I compare the numbers of the 2 stacks out (I presume this is done with pop())
    3. I have to copy 2 arrays of INTS into 2 stacks
    Please help...coding below:
    import jmds.Stack;
    public class PileGame
    private Stack pile1, pile2;
    private int winner;
    private boolean gameOver;
    public PileGame()
    // TO DO: INITIALIZE GAME
    private void move()
    int top1 = 0;
    int top2 = 0;
    ///TO DO: SET top1 = NUMBER ON TOP OF pile1
    /// SET top2 = NUMBER ON TOP OF pile2
    ///TO DO: REMOVE TOP ITEM FROM WINNING PILE
    /// ("WINNING PILE" IS THE ONE WITH THE LARGER TOP NUMBER)
    /// FOR A TIE, REMOVE TOP ITEM FROM BOTH PILES
    ///TO DO: DECIDE WHETHER GAME IS OVER BECAUSE A PILE IS EMPTY
    /// EMPTY PILE IS THAT OF WINNER (IF BOTH EMPTY, TIE).
    /// IF DONE, CALL win FOR WINNER (1 OR 2) OR FOR TIE (0)
    /// OTHERWISE, CONTINUE GAME
    win(0); ///ALWAYS A TIE -- TO DO: REPLACE WITH SOLUTION TO ABOVE
    private void win(int player)
    gameOver = true;
    winner = player;
    public int getWinner()
    if (!gameOver)
    play();
    return winner;
    public String toString()
    String result;
    if (gameOver)
    if (winner == 0)
    result = "Tie Game";
    else
    result = "Player " + winner + " wins!";
    else
    result = "Game not played";
    return result;
    public void play()
    // Initialize new game
    // Fill both piles with integers between 1 and 20
    // (the integers must be "shuffled")
    int[] list1 = ShuffledIntegers.shuffle(1, 20);
    int[] list2 = ShuffledIntegers.shuffle(1, 20);
    // TO DO: PUT CONTENTS OF list1 INTO pile1,
    // AND CONTENTS OF list2 INTO pile2
    // Play the game
    while (!gameOver)
    move();
    }

    I am not a stack master but here are the basic functions.
    in order to look at the item on top of the stack you use the function peek().
    Yes, removing the top item is done with pop().
    In order to put items onto the stack you use the function push().
    and to Check if it is empty call the function empty(). This will return a boolean.
    And that is as basic and as advanced as I am in this subject

  • Appearance panel stack problem

    this is probably common sense, but for the life of me i cant figure it out.
    I have a simple text. In the appearance panel, the "eyes" are greyed out and i cant add effects, nor can i change the stack order.
    However i create a simple rectangle and i am able to do it.
    what is the problem here?

    If you plan on applying the same attributes to your entire selection of text, I recommend  selecting your charachters with the type tool and setting your fill & strokes to none.
    Then as per Wade  change to a selection tool and begin applying your strokes and fills
    At type level you can move fill to the top, add multiple strokes which now go outwards, etc. The type level overides the character, but I still like to clean character level out to none to keep my files clean and not have problems with removing unused colors and such.

  • Stacking problem from Migrating photos to Photoshop Elements 12

    I just installed Photoshop Elements 12 after my new computer program on Microsoft  8.1 would not support my old Photoshop Elements 5.  In Photoshop Elements 5 my 34000 photos were stacked.  All my photos were uploaded to the new Photoshop Elements 12 and now I have 75000 photos because they are no longer stacked.  I now have the original and edited versions next to each other.  Is there any easy way to restack?  

    You did not mention how you got your media files in the PSE12 catalog:
    - by 'getting photos and videos from files or folders'
    - or by converting the catalog from the file / catalog... menu ?
    Only the last solution restores your stacks as well as tags etc.
    If you converted the catalog, have a look at the 'Window' menu just left of the 'Help' menu; there is an option to 'collapse' stacks.

  • Mac newbie with a "stacks" problem

    Now, you're dealing with a former Windows person here making the transition...
    In setting up my desktop, my stacks don't work. when I minimize applications windows, they just line up on that bar...had stacks initially but not now.
    How do I get this cool function back?
    I do Ind out what version of MAC OS I have?
    would appreciate help with this first (of potentially many) questions as I cross over to the Mac world.
    thanks

    How do I get this cool function back?
    Drag a folder to the Dock...don't minimize them.
    I do Ind out what version of MAC OS I have
    Apple menu --> About this mac

  • Stacking problem

    I have not been able to create stacks in Lightroom. following the instruction Choose Photo > Stacking > Group Into Stack after selecting a series of images gives me a submenu in which all entries are greyed out. I am working with Lightroom 1.1. These are RAW images from an Olympus E-510.

    Thanks to Lee Jay and Albert Mueller. I did discover that stacking only works in the folder view. I think that should have been mentiuoned in the docs. There are quite a few things that one needs to adapt to whenever one takes on a new workflow.
    I am quite pleased with the amount of effort that Adobe has put into Lightroom.

  • Simple Stack Problem

    Hi All,
    I'm trying to create a graphical calculator and want to input the equation as a string into a stack. I think the code does this, but when I try to pop it I get an error. Here's the code:
    public void calculate(String n, int parethCount, String temp)
              int nLength = n.length();
              stack = new Stack();
              display.setText("Working");
              while (nLength > 0)
                   stack.push(n.substring(nLength, nLength-1));
                   nLength--;
              display.setText(stack.pop());
        }I'm just trying to pop the last item inserted into the stack and display it in the calc display. Here's the error I get.
    C:\Java\4-14-03>javac calculator1.java
    calculator1.java:212: setText(java.lang.String) in javax.swing.text.JTextCompone
    nt cannot be applied to (java.lang.Object)
    display.setText(stack.pop());
    ^
    1 error
    Don't know why. Any thoughts.
    Thanks,
    bob2829

    try this: stack.pop().toString()

Maybe you are looking for