Need help compiling v4l cvs

I just bought myself a new tv card that needs the cvs version of v4l... I've tried to compile it but always fails... I did this:
cvs -d :pserver:[email protected]:/cvs/video4linux login
cvs -d :pserver:[email protected]:/cvs/video4linux co video4linux
cvs -d :pserver:[email protected]:/cvs/linuxtv login
cvs -z3 -d :pserver:[email protected]:/cvs/linuxtv co -P dvb-kernel
cd video4linux
./scripts/merge-trees.sh
make
And as a result I get only errors... Files not being found and errors about incomplete types... I think this is the right way to compile the cvs, according to their wiki, so maybe it's an arch thing? I've never tried to compile any modules before so this is a totally new thing for me... Please help!

yeah, I know! it was my intension from the start but I had problem cutting and pasting from a terminal into firefox... but I found out a way now!
make gives this output:
make -C /lib/modules/2.6.12-ARCH/build SUBDIRS=/root/video4linux modules
make[1]: Entering directory `/usr/src/linux-2.6.12-ARCH'
CC [M] /root/video4linux/video-buf.o
/root/video4linux/video-buf.c:36:29: media/video-buf.h: No such file or directory
fixdep: /root/video4linux/.video-buf.o.d is empty
CC [M] /root/video4linux/v4l1-compat.o
CC [M] /root/video4linux/v4l2-common.o
CC [M] /root/video4linux/btcx-risc.o
CC [M] /root/video4linux/ir-common.o
/root/video4linux/ir-common.c:27:29: media/ir-common.h: No such file or directory
fixdep: /root/video4linux/.ir-common.o.d is empty
CC [M] /root/video4linux/bttv-driver.o
CC [M] /root/video4linux/bttv-cards.o
CC [M] /root/video4linux/bttv-risc.o
CC [M] /root/video4linux/bttv-if.o
In file included from /root/video4linux/bttv-if.c:35:
/root/video4linux/bttvp.h:52:29: media/video-buf.h: No such file or directory
/root/video4linux/bttvp.h:53:29: media/audiochip.h: No such file or directory
/root/video4linux/bttvp.h:54:25: media/tuner.h: No such file or directory
/root/video4linux/bttvp.h:55:28: media/tveeprom.h: No such file or directory
/root/video4linux/bttvp.h:56:29: media/ir-common.h: No such file or directory
fixdep: /root/video4linux/.bttv-if.o.d is empty
CC [M] /root/video4linux/bttv-vbi.o
CC [M] /root/video4linux/bttv-i2c.o
CC [M] /root/video4linux/bttv-gpio.o
In file included from /root/video4linux/bttv-gpio.c:36:
/root/video4linux/bttvp.h:52:29: media/video-buf.h: No such file or directory
/root/video4linux/bttvp.h:53:29: media/audiochip.h: No such file or directory
/root/video4linux/bttvp.h:54:25: media/tuner.h: No such file or directory
/root/video4linux/bttvp.h:55:28: media/tveeprom.h: No such file or directory
/root/video4linux/bttvp.h:56:29: media/ir-common.h: No such file or directory
fixdep: /root/video4linux/.bttv-gpio.o.d is empty
CC [M] /root/video4linux/cx88-video.o
In file included from /root/video4linux/media/video-buf-dvb.h:3,
from /root/video4linux/cx88.h:33,
from /root/video4linux/cx88-video.c:37:
/root/video4linux/dmxdev.h:38:19: demux.h: No such file or directory
In file included from /root/video4linux/media/video-buf-dvb.h:4,
from /root/video4linux/cx88.h:33,
from /root/video4linux/cx88-video.c:37:
/root/video4linux/dvb_demux.h:46: error: field `filter' has incomplete type
/root/video4linux/dvb_demux.h:47: error: `DMX_MAX_FILTER_SIZE' undeclared here (not in a function)
/root/video4linux/dvb_demux.h:65: error: field `ts' has incomplete type
/root/video4linux/dvb_demux.h:66: error: field `sec' has incomplete type
/root/video4linux/dvb_demux.h:70: error: parse error before "dmx_ts_cb"
/root/video4linux/dvb_demux.h:70: warning: no semicolon at end of struct or union
/root/video4linux/dvb_demux.h:70: warning: no semicolon at end of struct or union
/root/video4linux/dvb_demux.h:71: warning: type defaults to `int' in declaration of `sec'
/root/video4linux/dvb_demux.h:71: warning: data definition has no type or storage class
/root/video4linux/dvb_demux.h:72: warning: type defaults to `int' in declaration of `cb'
/root/video4linux/dvb_demux.h:72: warning: data definition has no type or storage class
/root/video4linux/dvb_demux.h:95: error: parse error before '}' token
/root/video4linux/dvb_demux.h:98: error: field `dmx' has incomplete type
/root/video4linux/dvb_demux.h:118: error: `DMX_TS_PES_OTHER' undeclared here (not in a function)
In file included from /root/video4linux/cx88.h:33,
from /root/video4linux/cx88-video.c:37:
/root/video4linux/media/video-buf-dvb.h:27: error: field `fe_hw' has incomplete type
/root/video4linux/media/video-buf-dvb.h:28: error: field `fe_mem' has incomplete type
/root/video4linux/dvb_demux.h:86: error: storage size of `pes_type' isn't known
make[2]: *** [/root/video4linux/cx88-video.o] Error 1
make[1]: *** [_module_/root/video4linux] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.12-ARCH'
make: *** [default] Error 2

Similar Messages

  • Need help compiling external jar files into my one jar file from cmd line

    Here is my problem, let me see if I can explain it right:
    I am making a jar file on my development computer that will run my java project. In this java project, it references a couple Java3D jar files. On my development computer, I create the jar file and it runs correctly, but when I move that jar file over to the test computer, the parts of the application needing those Java3D jars are not found in my jar I created. I isolated the problem and it is because those Java3D jar files I needed are not on my test machine. But that is the way I need it to be. I need it so that when I compile all my code on the development machine, I need it to also compile those two Java3D files into my one jar that I move to the test machine. You get what I'm saying? I must do all the compiling from the command line and have only one jar file to put on the test machine that contains all my compiled code and the two Java3D files needed to run some of the applications in the project.
    Here a brief sample of what I'm doing:
    To compile my java files in my project, I simply to this for all my files:
    javac file.java
    javac file2.java... and so on for all my java files.
    Then I create my jar file:
    jar -cfm MyJar.jar manifest.mf file.class
    jar -fmu MyJar.jar manifest.mf file2.class... and so on for all my class files.
    Also when compiling my jar file, I do this thinking that it would include the two Java3D jars into my one jar file:
    jar -fmu MyJar.jar manifest.mf jars/j3d-org-images.jar
    jar -fmu MyJar.jar manifest.mf jars/j3d-org.jar
    My manifest file looks something like this:
    Manifest-Version: 1.0
    Main-Class: Main
    Class-Path: jars/j3d-org.jar jars/j3d-org-images.jar
    Do I have to have that Class-Path in there pointing to those jar files? Those jar files will not exist on my test machine because the directory structure will not be the same. I've tried a manifest without specifying my Class-Path to those jar files, but I get the same problem when I run my application on the part that needs the Java3D files.
    The error I am getting is that there is a RasterTextLabel class inside one of those Java3D jar files that my application cannot access because those jar files are not on my test machine.
    So basically what I really need to know is how I get those two Java3D jar files compiled into my one jar file that I move to a test machine and run with the following command:
    java -jar MyJar.jar
    Can anyone help me??
    Thanks.

    Here what you need is to have all the files present in a single jar file, and the classpath is set properly to the required jar files.
    Do the following in steps:
    1)
    Create a custom manifest file,say mymanifest.mf, with the following contenets, put it in current directory:
    Manifest-Version: 1.0
    Created-By: 1.4.0_01 (Sun Microsystems Inc.)
    main-Class: Main
    Class-Path: jars/j3d-org.jar jars/j3d-org-images.jar <press ENTER key>
    2)
    jar -cfm MyJar.jar manifest.mf file.class
    jar -fmu MyJar.jar manifest.mf file2.class... and so on for all class files.
    3)
    jar -fmu MyJar.jar manifest.mf jars/j3d-org.jar
    jar -fmu MyJar.jar manifest.mf jars/j3d-org-images.jar
    (Make sure that j3d-org-images.jar and j3d-org.jar are present in a subdirectory called 'jars')
    Now you would be able to run,
    java -jar myjar.jar

  • Need Help Compiling!

    When I compile java using me text editor everything is as smooth as sand but when I go to my ms-dos prompt and type
    javac Root.java
    it turns out to be a bad comand. I have windows 98SE btw and don't understand what the problem is?
    Now my real problem is when I get my java file to compile using my text editor and try to open the class file with ms-dos by doing--
    java Root
    it turns out saying NoClassDefFound, I don't know what this means.
    If anyone could help me on this I'd vary much appreciate it but other then that thanks for your time.

    When I compile java using me text editor everything
    is as smooth as sand but when I go to my ms-dos
    prompt and type
    javac Root.java
    it turns out to be a bad comand. I have windows 98SE
    btw and don't understand what the problem is?You need to add the directory that contains javac.exe to the PATH variable maintained by your computer's operating system. SEE #5 of the installation instructions here:
    http://java.sun.com/j2se/1.5.0/install-windows.html
    Now my real problem is when I get my java file to
    compile using my text editor and try to open the
    class file with ms-dos by doing--
    java Root
    it turns out saying NoClassDefFound, I don't know
    what this means.It means that you don't know how to work with Java's CLASSPATH variable, which is extremely important for you to understand if you plan on writing and running Java code. Read the following documents at this address:
    http://java.sun.com/j2se/1.5.0/docs/tooldocs/index.html#general
    Setting the Classpath
    How Classes are Found
    javac [tool]
    java [tool]
    >
    If anyone could help me on this I'd vary much
    appreciate it but other then that thanks for your
    time.To run your program, change to the directory that contains Root.class and do a directory listing. Verify that the file exists with that exact name and capitalization. Fix any problem. From the same location, issue the following command:
    java -cp . Root (Mind the period and surrounding spaces.)

  • Need help compiling an EJB with Apache Tomcat 5.5

    Hi everyone, I need some help. I�m writing an EJB that has to run on Apache Tomcat 5.5.
    I�m importing the javax.ejb.* library, but Eclipse can�t find the JAR it needs. Where can I find this JAR? Do I have to download or what?
    Thanks a lot.

    Thanks, I�ve already downloaded the javaee.jar from the Sun webpage. As you can see I�m quite new to EJB developing. I want to create an EJB that will get some information from a database and send it back to a servlet, and then a web page. I've been browsing the JBoss page, and I see there are LOTS of versions. Any suggestion, regarding which version I shoud use for this? Thanks a lot again.

  • NEED HELP COMPILING AN APPLET AND FIXING AN ERROR

    Hi this is my applet that i am having a problem compiling.
    import java.applet.*;
    import java.awt.*;
    public class Texts2 extends Applet
         TextArea source;
         TextArea destination;
         Button copy;
         public void init()
              source = new TextArea(10,30);
              add(source);
              copy = new Button("Copy ->");
              add(copy);
              destination = new TextArea(10,30);
              add(destination);
              validate();
         public boolean action(Event evt, Object arg)
              String temp;
              if(evt.target == copy)
                   temp = source.getSelectedText();
                   if (destination.getText() =="")
                        destination.setText(temp);
                   else
                        destination.append(temp);
    }Here is the full error message after i have typed javac Texts2.java in the command prompt:
    Texts2.java:34: missing return statement.
    Note: Texts2.java uses or overides a deprecated API.
    Note: Recompile with -Xlint deprecation for details.
    1 error
    What is the missing return statement?
    What does Recompile with -Xlint deprecation for details mean?
    How do i do this?
    Rafeeq
    Edited by: rafeeq on Jan 9, 2008 1:42 PM

    duffymo wrote:
    you've got three notes, all with the caps lock on, asking for the same lame advice.Actually it was four notes.
    @rafeeq
    Here's another tutorial
    http://java.sun.com/docs/books/tutorial/reallybigindex.html
    comeback when you learn the basics.

  • [PKGBUILD] Need help compiling QuteCom (formerly WengoPhone)

    Hey there!
    I'm trying to make a new PKGBUILD for QuteCom, the former wengophone-ng. The PKGBUILD currently looks this way:
    # Contributor: Julius Bullinger <#####>
    pkgname=qutecom-hg
    pkgver=105
    pkgrel=1
    pkgdesc="The latest hg pull of wmii, a lightweight, dynamic window manager for X11"
    url="http://wmii.suckless.org"
    license='custom'
    arch=('i686')
    makedepends=('mercurial')
    depends=('cmake>=2.4.4' 'qt>=4.2' 'boost>=1.33' 'openssl>=0.9.8a' 'glib2>=2.10.3' \
    'gnutls>=1.2.9' 'e2fsprogs>=1.38' 'libxml2>=2.6.24' 'speex>=1.1.12' \
    'ffmpeg>=cvs20060823' 'portaudio>=19' 'alsa-lib>=1.0.11' \
    'libsndfile>=1.0.12' 'libsamplerate>=0.1.2' 'curl>=7.16.1' 'libosip>=3.0.1')
    source=()
    _hgroot='http://hg.qutecom.org'
    _hgrepo='qutecom-2.2'
    build() {
    cd ${startdir}/src
    if [ -d ${_hgrepo} ]; then
    cd ${startdir}/src/${_hgrepo}
    hg pull -u
    else
    hg clone ${_hgroot}${_hgrepo} || return 1
    cd ${startdir}/src/${_hgrepo}
    fi
    msg "Mercurial checkout done or server timeout"
    msg "Starting make..."
    mkdir ./build
    cd ./build
    cmake .. \
    -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/quotecom \
    -DBUILDID_SUPPORT=OFF -DFFMPEG_INTERNAL=ON \
    -DPORTAUDIO_INTERNAL=OFF -DPORTAUDIO_OSS_SUPPORT=OFF \
    -DPHAPI_AUDIO_OSS_SUPPORT=OFF -DCOPY_DATA_FILES_ON_CONFIGURE=OFF
    make || return 1
    make DESTDIR=$pkgdir install
    As you can see, it's using mercurial and cmake. Building crashes with just saying
    Linking C static library libgaim.a
    [ 29%] Built target gaim
    make: *** [all] Fehler 2 [=Error 2]
    Since I'm no developer, I have no idea what to do. Can anybody help me, e.g. try to build it himself, and give me an hint what to do?
    Thank you!
    Last edited by kwurzel (2009-11-25 08:17:17)

    The following patch allows the build to complete:
    --- qutecom-2.2/wifo/netlib/src/netlib.cpp 2008-07-08 13:03:11.386417658 +0100
    +++ qutecom-2.2-build/wifo/netlib/src/netlib.cpp 2008-07-08 14:57:38.845728354 +0100
    @@ -40,6 +40,7 @@
    #include <sys/ioctl.h>
    #include <netdb.h>
    #include <strings.h>
    + #include <cstring>
    #endif //OS_WIN32
    #include <stdlib.h>
    #include <limits.h>
    I've also made some PKGBUILD changes:
    # Contributor: Julius Bullinger <[email protected]>
    pkgname=qutecom-hg
    pkgver=105
    pkgrel=1
    pkgdesc="Open source softphone, mercurial build"
    url="http://www.qutecom.org"
    license='custom'
    arch=('i686')
    makedepends=('mercurial')
    depends=('cmake>=2.4.4' 'qt>=4.2' 'boost>=1.33' 'openssl>=0.9.8a' 'glib2>=2.10.3' \
    'gnutls>=1.2.9' 'e2fsprogs>=1.38' 'libxml2>=2.6.24' 'speex>=1.1.12' \
    'ffmpeg>=cvs20060823' 'portaudio>=19' 'alsa-lib>=1.0.11' \
    'libsndfile>=1.0.12' 'libsamplerate>=0.1.2' 'curl>=7.16.1' 'libosip>=3.0.1')
    source=(netlib-gcc-4.3.patch)
    _hgroot='http://hg.qutecom.org'
    _hgrepo='qutecom-2.2'
    build() {
    cd ${startdir}/src
    if [ -d ${_hgrepo} ]; then
    cd ${startdir}/src/${_hgrepo}
    hg pull -u
    else
    hg clone ${_hgroot}${_hgrepo} || return 1
    cd ${startdir}/src/${_hgrepo}
    fi
    cp -r ${startdir}/src/${_hgrepo} ${startdir}/src/${_hgrepo}-build
    cd ${startdir}/src/${_hgrepo}-build
    msg "Mercurial checkout done or server timeout"
    msg "Starting make..."
    patch -Np1 -i ../netlib-gcc-4.3.patch || return 1
    cd build
    cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILDID_SUPPORT=OFF -DFFMPEG_INTERNAL=ON \
    -DPORTAUDIO_INTERNAL=OFF -DPORTAUDIO_OSS_SUPPORT=OFF \
    -DPHAPI_AUDIO_OSS_SUPPORT=OFF -DCOPY_DATA_FILES_ON_CONFIGURE=OFF || return 1
    make || return 1
    make DESTDIR=$pkgdir install
    rm -rf ${startdir}/src/${_hgrepo}-build
    The app runs for me, but with most of the interface blank - not too surprising, given that this code is intended for developers only. I'm not interested in working further on this right now, so feel free to do anything you want with the above.

  • Urgent: Need Help (compilation)

    I have problems to compile my classes.
    I would like to know if it is possible to make header files like in C language ?
    Because i have this problem
    ---------- --------> ----------
    + Classe 1 + + Classe 2 +
    ---------- <-------- ----------
    (--> meens call method.)
    For the moment i must comment method calls, compile, uncomment and compile again
    Thank You

    That will be fine then, as long as the methods you're calling actually exist in the other class. If it doesn't compile, it means there's a bug...

  • JAVAC: Need help compiling!!

    I'm really new to Java and everything else, so please bare with me. This is what it says when I try to use: "Javac rs.java" to compile it and create the class file "rs.class" to work with the html file "rs.html". I think I'm saying all of this right, I hope. Here are the errors:
    rs.java:114: not a statement
            ioexception;
            ^
    rs.java:122: not a statement
            runtimeexception;
            ^
    rs.java:146: not a statement
            obj;
            ^
    rs.java:148: not a statement
            obj;
            ^
    rs.java:234: not a statement
            obj;
            ^
    rs.java:252: not a statement
            obj;
            ^
    rs.java:321: not a statement
            runtimeexception;
            ^
    rs.java:333: not a statement
            obj;
            ^
    rs.java:336: not a statement
            obj;
            ^
    rs.java:405: not a statement
            obj;
            ^
    rs.java:413: not a statement
            obj;
            ^
    11 errors

    I'm really new to Java and everything else, so please bare with me. Bare with you? Hey buddy, it's not that kind of forum. 8)
    But I can bear with you.
    This is what it says when I try to use:
    "Javac rs.java" to compile it and create the class
    file "rs.class" to work with the html file "rs.html".rs.html is input to that .class file?
    I think I'm saying all of this right, I hope. Here are the errors:Each of these errors tells you the .java file in which it occurred (e.g., rs.java), the line number (e.g., 114) and the problem. You should open that .java file in your favorite editor with line number display turned on, navigate to that line, and stare at the code and the error until you realize what you've done wrong. If you're still not sure, cut & paste the error text into Google and see what it comes back with.
    %

  • Need help determining compiling error

    Good morning,
    I need help finding the cause of a compiling error I receive. I have reviewed my code numerous times without any luck. I hope you guys might see something I am not! The entire file exceeds the limit I can post, so I am attaching it in 2 posts. Sorry for the inconvenience. The error and my code are posted below. Thank you for your help!
    C:\StockTrackerDB.java:382: cannot find symbol
    symbol : method add(java.lang.Boolean)
    location: class java.util.ArrayList<java.lang.String>
                   aList.add(new Boolean(rs.getBoolean("admin")));
    ^
    1 error
    Tool completed with exit code 1
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    public class StockTrackerDB
         private Connection con = null;
         //Constructor; makes database connection
         public StockTrackerDB() throws ClassNotFoundException,SQLException
              if(con == null)
                   String url = "jdbc:odbc:StockTracker";
                   try
                        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   catch(ClassNotFoundException ex)
                        throw new ClassNotFoundException(ex.getMessage() +
                                    "\nCannot locate sun.jdbc.odbc.JdbcOdbcDriver");
                   try
                        con = DriverManager.getConnection(url);
                   catch(SQLException ex)
                        throw new SQLException(ex.getMessage()+
                                    "\nCannot open database connection for "+url);
         // Close makes database connection; null reference to connection
         public void close() throws SQLException,IOException,ClassNotFoundException
              con.close();
              con = null;
         // Method to serialize object to byte array
         private byte[] serializeObj(Object obj) throws IOException
              ByteArrayOutputStream baOStream = new ByteArrayOutputStream();
              ObjectOutputStream objOStream = new ObjectOutputStream(baOStream);
              objOStream.writeObject(obj); // object must be Serializable
              objOStream.flush();
              objOStream.close();
              return baOStream.toByteArray(); // returns stream as byte array
         // Method to deserialize bytes from a byte array into an object
         private Object deserializeObj(byte[] buf) throws IOException, ClassNotFoundException
              Object obj = null;
              if(buf != null)
                   ObjectInputStream objIStream = new ObjectInputStream(new ByteArrayInputStream(buf));
                   obj = objIStream.readObject(); //IOException, ClassNotFoundException
              return obj;
         // Methods for adding a record to a table
         // add to the Stocks Table
         public void addStock(String stockSymbol, String stockDesc) throws SQLException, IOException, ClassNotFoundException
              Statement stmt = con.createStatement();
              stmt.executeUpdate("INSERT INTO Stocks VALUES ('"
                                    +stockSymbol+"'"
                                    +",'"+stockDesc+"')");
              stmt.close();
         // add to the Users table
         public boolean addUser(User user) throws SQLException,IOException,ClassNotFoundException
              boolean result = false;
              String dbUserID;
              String dbLastName;
              String dbFirstName;
              Password dbPswd;
              boolean isAdmin;
              dbUserID = user.getUserID();
              if(getUser(dbUserID) == null)
                   dbLastName = user.getLastName();
                   dbFirstName = user.getFirstName();
                   Password pswd = user.getPassword();
                   isAdmin = user.isAdmin();
                   PreparedStatement pStmt = con.prepareStatement("INSERT INTO Users VALUES (?,?,?,?,?)");
                   pStmt.setString(1, dbUserID);
                   pStmt.setString(2, dbLastName);
                   pStmt.setString(3, dbFirstName);
                   pStmt.setBytes(4, serializeObj(pswd));
                   pStmt.setBoolean(5, isAdmin);
                   pStmt.executeUpdate();
                   pStmt.close();
                   result = true;
              else
                   throw new IOException("User exists - cannot add.");
              return result;
         // add to the UserStocks table
         public void addUserStocks(String userID, String stockSymbol)
                        throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
              stmt.executeUpdate("INSERT INTO UserStocks VALUES ('"
                                    +userID+"'"
                                    +",'"+stockSymbol+"')");
              stmt.close();
         // Methods for updating a record in a table
         // updating the Users table
         public boolean updUser(User user) throws SQLException, IOException, ClassNotFoundException
              boolean result = false;
              String dbUserID;
              String dbLastName;
              String dbFirstName;
              Password dbPswd;
              boolean isAdmin;
              dbUserID = user.getUserID();
              if(getUser(dbUserID) != null)
                   dbLastName = user.getLastName();
                   dbFirstName = user.getFirstName();
                   Password pswd = user.getPassword();
                   isAdmin = user.isAdmin();
                   PreparedStatement pStmt = con.prepareStatement("UPDATE Users SET lastName = ?," + " firstName = ?, pswd = ?, admin = ? WHERE userID = ?");
                   pStmt.setString(1, dbLastName);
                   pStmt.setString(2, dbFirstName);
                   pStmt.setBytes(3, serializeObj(pswd));
                   pStmt.setBoolean(4, isAdmin);
                   pStmt.setString(5, dbUserID);
                   pStmt.executeUpdate();
                   pStmt.close();
                   result = true;
              else
                   throw new IOException("User does not exist - cannot update.");
              return result;
         }

         // Methods for deleting a record from a table
         // delete a record from the Stocks table
         private void delStock(String stockSymbol) throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
              stmt.executeUpdate("DELETE FROM Stocks WHERE "
                                    +"symbol = '"+stockSymbol+"'");
              stmt.close();
         // delete a record from the Users table
         public void delUser(User user) throws SQLException,IOException,ClassNotFoundException
              String dbUserID;
              String stockSymbol;
              Statement stmt = con.createStatement();
              try
                   con.setAutoCommit(false);
                   dbUserID = user.getUserID();
                   if(getUser(dbUserID) != null) // verify user exists in database
                        ResultSet rs1 = stmt.executeQuery("SELECT userID, symbol "
                                              +"FROM UserStocks WHERE userID = '"+dbUserID+"'");
                        while(rs1.next())
                             try
                                  stockSymbol = rs1.getString("symbol");
                                  delUserStocks(dbUserID, stockSymbol);
                             catch(SQLException ex)
                                  throw new SQLException("Deletion of user stock holding failed: " +ex.getMessage());
                        } // end of loop thru UserStocks
                        try
                        {  // holdings deleted, now delete user
                             stmt.executeUpdate("DELETE FROM Users WHERE "
                                              +"userID = '"+dbUserID+"'");
                        catch(SQLException ex)
                             throw new SQLException("User deletion failed: "+ex.getMessage());
                   else
                        throw new IOException("User not found in database - cannot delete.");
                   try
                        con.commit();
                   catch(SQLException ex)
                        throw new SQLException("Transaction commit failed: "+ex.getMessage());
              catch (SQLException ex)
                   try
                        con.rollback();
                   catch (SQLException sqx)
                        throw new SQLException("Transaction failed then rollback failed: " +sqx.getMessage());
                   // Transaction failed, was rolled back
                   throw new SQLException("Transaction failed; was rolled back: " +ex.getMessage());
              stmt.close();
         // delete a record from the UserStocks table
         public void delUserStocks(String userID, String stockSymbol) throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
              ResultSet rs;
              stmt.executeUpdate("DELETE FROM UserStocks WHERE "
                                    +"userID = '"+userID+"'"
                                    +"AND symbol = '"+stockSymbol+"'");
              rs = stmt.executeQuery("SELECT symbol FROM UserStocks "
                                         +"WHERE symbol = '"+stockSymbol+"'");
              if(!rs.next()) // no users have this stock
                   delStock(stockSymbol);
              stmt.close();
         // Methods for listing record data from a table
         // Ordered by:
         //          methods that obtain individual field(s),
         //          methods that obtain a complete record, and
         //          methods that obtain multiple records
         // Methods to access one or more individual fields
         // get a stock description from the Stocks table
         public String getStockDesc(String stockSymbol) throws SQLException, IOException, ClassNotFoundException
              Statement stmt = con.createStatement();
              String stockDesc = null;
              ResultSet rs = stmt.executeQuery("SELECT symbol, name FROM Stocks "
                                                      +"WHERE symbol = '"+stockSymbol+"'");
              if(rs.next())
                   stockDesc = rs.getString("name");
              rs.close();
              stmt.close();
              return stockDesc;
         // Methods to access a complete record
         // get User data from the Users table
         public User getUser(String userID) throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
              String dbUserID;
              String dbLastName;
              String dbFirstName;
              Password dbPswd;
              boolean isAdmin;
              byte[] buf = null;
              User user = null;
              ResultSet rs = stmt.executeQuery("SELECT * FROM Users WHERE userID = '" +userID+"'");
              if(rs.next())
                   dbUserID = rs.getString("userID");
                   dbLastName = rs.getString("lastName");
                   dbFirstName = rs.getString("firstName");
                   // Do NOT use with JDK 1.2.2 using JDBC-ODBC bridge as
                   // SQL NULL data value is not handled correctly.
                   buf = rs.getBytes("pswd");
                   dbPswd=(Password)deserializeObj(buf);
                   isAdmin = rs.getBoolean("admin");
                   user = new User(dbUserID,dbFirstName,dbLastName,dbPswd,isAdmin);
              rs.close();
              stmt.close();
              return user; // User object created for userID
         // Methods to access a list of records
         // get a list of selected fields for all records from the Users Table
         public ArrayList listUsers() throws SQLException,IOException,ClassNotFoundException
              ArrayList<String> aList = new ArrayList<String>();
              Statement stmt = con.createStatement();
              ResultSet rs = stmt.executeQuery("SELECT userID, firstName, lastName, admin "
                                                 +"FROM Users ORDER BY userID");
              while(rs.next())
                   aList.add(rs.getString("userID"));
                   aList.add(rs.getString("firstName"));
                   aList.add(rs.getString("lastName"));
                   aList.add(new Boolean(rs.getBoolean("admin")));
              rs.close();
              stmt.close();
              return aList;
         // get all fields in all records for a given user from the UserStocks table
         public ArrayList listUserStocks(String userID) throws SQLException, IOException, ClassNotFoundException
              ArrayList<String> aList = new ArrayList<String>();
              Statement stmt = con.createStatement();
              ResultSet rs = stmt.executeQuery("SELECT * FROM UserStocks "
                                                      +"WHERE userID = '"+userID+"' ORDER BY symbol");
              while(rs.next())
                   aList.add(rs.getString("symbol"));
              rs.close();
              stmt.close();
              return aList;
    }

  • Error when compiling AppleScript for CS2, need help

    I've recently started learning AppleScript, and while I'm no stranger to programming I'm a little lost when it comes to errors like this one. I have both InDesign CS2 and InDesign CS3 installed so I'm not sure if my problem is caused by that, they were installed before I started working on this mac. I've also been recently upgraded from Tiger to Leopard, in case that might be a probable cause.
    Basically, my problem stems from this:
    tell application "Adobe InDesign CS2"
        get active document
    end tell
    When I try to compile this I get a Syntax Error that says "Expected end of line but found class name." and highlights "document". I've also had problems trying to use things like "page 1" or "view preferences" with similar errors. With the case of things like "page 1" I've had to replace it with "item 1 of pages" to get it to compile.
    If I change it to "Adobe InDesign CS3" it works fine, but I need to compile for CS2 for backwards compatability. Strangely, this method works:
    set indesign to application "Adobe InDesign CS2"
    tell indesign
        using terms from application "Adobe InDesign CS3"
            get active document
        end using terms from
    end tell
    Does this mean my CS2 dictionary is broken? I can view it fine from the Script Editor, and I've seen things like "active document" used in example scripts, so this syntax error is confusing me.

    I'm not sure why you're getting that error, but a couple of things:
    Using "document 1" instead of "active document" is not a bad habit,
    because there are cases where active document doesn't work.
    When you compile the scripts, the version is somewhat irrelevant -- when
    you go to run them, they look for a running application of the same creator
    code, and use that. It's a bit like when you double-click on a document in
    the Finder -- it doesn't matter what version of ID you made it in, it will
    try to open in whatever version is running first.
    Shane Stanley <[email protected]>
    AppleScript Pro Sessions <http://scriptingmatters.com/aspro

  • Urgent help please - What files needed to compile servlets

    I am trying to compile some servlets but can't. I recently reformatted and forgot how I had configured Tomcat previously.
    What files do I need to compile servlets, and where do I have to save them etc.
    Thanks

    u will require jsdk.jar..
    put this in classpath and then compile ..it will surely compile
    and for compiling ...there is no configuration reqd in tomcat

  • Need help with Math related operations...

    I'm learning JAVA for more than 3 weeks and I really need help...
    I'm using SDK1.4 with Elixir IDE Lite (+patch installed).
    In the following screenshot <http://www.geocities.com/jonny_fyy/pics/java1.png>, I've got this error (when I right-click -> Compile) . Do you know what it means & how can I solve it?
    Here's how it should look if correct (pic scan from lab worksheet)... <http://www.geocities.com/jonny_fyy/pics/lab.jpg>
    Here's my java file... <http://www.geocities.com/jonny_fyy/FahToCeltxt.java>
    Thanks for helping :>

    Hi jonny
    One step ahead:
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    public class FahToCeltxt extends Applet implements ActionListener {
         TextField msgField ;
         String msg = null;
         int msgValue;
         Label title;
         Button b;
         public void init() {
              title = new Label("Enter degrees in Fahrenheit: ");
              add(title);
              msgField = new TextField (10);
              add(msgField);
    //          msgField.addTextListener(this);
              b = new Button("Convert");
              b.addActionListener(this);
              add(b);
    //     public void textValueChanged(TextEvent event) {
    //          msgValue = Integer.parseInt(msgField.getText());
    //          repaint();
         public void paint (Graphics g) {
              int result = (msgValue - 32) * 5/9 ;
              g.drawString("Degree Centigrade is " + result , 50, 50);
      public void actionPerformed(ActionEvent e) {
              msgValue = Integer.parseInt(msgField.getText());
              repaint();
    }Regards.

  • Need help with a currently "in-use" form we want to switch to Adobes hosting service

    Hi, I am in desperate need of help with some issues concerning several forms which we currently use a paid third party (not Adobe) to host and "re-distribute through email"...Somehow I got charged $14.95 for YOUR service, (signed up for a trial, but never used it)..and now I am paying for a year of use of the similar service which Adobe is in control of.  I might want to port my form distribution through Adobe in the hopes of reducing the errors, problems and hassles my customers are experiencing when some of them push our  "submit button". (and I guess I am familiar with these somewhat from reading what IS available in here, and I also know that, Adobe is working to alleviate some of these " submit"  issues, so let's don't start by going backwards, here) I need solutions now for my issues or I can leave it as is, If Adobe's solution will be no better for my end users...
    We used FormsCentral to code these forms and it works for the most part (if the end-user can co-operate, and thats iffy, sometimes), but I need help with how to make it go through your servers (and not the third party folks we use now), Not being cruel or racist here, but your over the phone "support techs" are about horrible & I cannot understand them or work with any of them, so I would definitely need someone who speaks English and can understand the nuances of programming these forms, to please contact me back. (Sorry, but both those attributes will be required to be able to help me, so, no "newbie-interns" or first week trainees are gonna cut it).... If you have anyone who fits the bill on those items and would be willing to help us, please contact me back at your earliest convenience. If we have to communicate here, I will do that & I can submit whatever we need to & to whoever we need to.
    I need to get this right and working for the majority of my users and on any platform and OS.
    You may certainly call me to talk about this, and I have given my number numerous times to your (expletive deleted) time wasting - recording message thingy. So, If it's not available look it up under [email protected]
    (and you will probably get right to me, unlike my and I'm sure most other folks',  "Adobe phone-in experiences")
    Thank You,
    Michael Corman
    VinylCouture
    Phenix City, Alabama  36869

    Well, thanks for writing back...just so you know...I started using Adobe products in 1987, ...yeah...back then...like Illustrator 1 & 9" B&W Macs ...John Warnock's Helvetica's....stuff like that...8.5 x 11 LaserWriters...all that good stuff...I still have some of it working on a mac...much of it was stuff I bought. some stuff I did not...I'm not a big fan of this "cloud" thing Adobe has foisted upon the creatives of the world...which I'm sure you can tell...but the functionality and usefulness of your software can not be disputed, so feel free to do whatever we will continue to pay for, ...I am very impressed with CC PS on the 64 bit PC and perhaps I will end up paying you the stipend that you demand for the other services.
    So  I guess that brings us to our problem.. a few years back and at the height of the recession and near bankruptcy myself,  I was damn lucky and hit on something and began a small arts and crafts supply service to sell my products online to a very "niche market" ...I had a unique product and still sell that product (plus others) online...My website is www.vinylcouture.com...Strange? Yes...but there is a market it seems, for everything now, and this is the market I service...Catagorically, these are 99%+ women that use these "adhesive, sticky backed vinyl products"  to make different "craft items" that are just way too various and numerous to go into... generally older women, women who are computer illiterate for the most part...and all this is irrelevant to my problem, but I want you to have every bit of background on this and especially the demographic we are dealing with, so we can get right to the meat of the problem.
    OK...So about two years ago, I decided to offer a "plain sheet" product of a plain colored "stick back" vinyl... it is available in multiple quantities of packs ( like 5 pieces, 10 pieces, 15 pieces, in a packi  & so on)...and if you are still on my site.. go to any  "GO RIGHT TO OUR ORDER PAGE"  button, scroll down a little...and then to the "PLAIN VINYL" section...you will see the Weebly website order process.) You can back out from here, I think,..but, anyway this product is available in 63 colors + or - a few. So then the problem is,  how do they select their individual colors within that (whatever) pack?... .
    So my initial idea was to enable a "selection form" for these "colors" that would be transmitted to me via email as 'part" of the "order process".. We tried getting our customers to submit a  " a list" ( something my competitiors still do, lol, poor bastards)......but that..is just unbelievable..I can't even begin to tell you what a freakin' nightmare that was...these people cannot even count to 10, much less any higher... figuring out what colors to list and send me... well, lets just say, it wasn't working......I had to figure out a better way...Something had to be done.
    So after thinking this all out,  and yeah...due to my total ignorance, i figured that we could make a form with Live Cycle Designer (Now Forms Central)...(back then something that was bundled with Adobe Acrobat Pro), I believe, and thats what this thing was authored in... and it would be all good...LOL!
    Well not so simple...as you well know, Adobe Acrobat would NOT LET YOU EMAIL anything from itself.....it just wouldn't work (and I know why, and all that hooey), but not being one to take NO for answer,.I started looking for a way to make my little gizmo work.. So I found this company that said they can "hijack" (re-direct actually) the request to email, bypass the wah-wah, and re-transmit it to the proper parties.....for less than $100 a year,  I think...its called http://pdf-fillableforms.com/.
    A nice gentleman named Joseph Silva helped us program the thing to go to his servers and back out. Please dont hassle them...I need them...for now..it basically does work...try it...you should get back a copy of the form that you filled out...good luck however,  if you're on MAC OSX or similar...
    I have included a copy of both of our forms (and feel free to fill it out and play with it)...just put test somewhere on it...(and you must include YOUR email or it will balk)..they are supposed to be mostly identical, except one seems to be twice as large....generating a 1.7 meg file upon submission, while the other one only generates a 600K file or so...thats another issue for another day or maybe you can advise on that also...
    OK so far so good......In our shop, once Grandma buys a 10 pack (or whatever), Only then she gets to the link on her receipt page ro the relevant "selection form" ,(this prevents "Filling and Sending"  with "no order" and "no payment", another early problem we had)... which they can click on and it will usually download and open up on their device if all goes well...Then our little form is supposed to be fillable and is supposed to ADD UP all the quantities, so grandma knows how many she is buying and so forth right on the fly,  and even while she changes her mind..., and IT'S LARGE so grandma can see it, and then it TOTALS it all up for them, ( cause remember, they can NOT add)..,  except there is a programming bug (mouse-click should be a mouse-up probably or something..) which makes you click in the blank spaces to get to a correct TOTAL...about 70-80% of our customers can enable all these features and usually the process completes without problems for them especially on PC's running Windows OS and Acrobat Reader X or XI...at least for most... Unfortunately it is still not the "seamless process" I would like or had envisioned for the other folks out there that do have trouble using our form....  Many folks report to us the following issues that we know of.  First of all it takes too much time to load up...We know its HUGE...is there anyway that you can see, to streamline this thing? I would love for it to be more compact...this really helps on the phones and pads as I'm sure you well know.
    Some just tell us,"it WON'T work"....I believe this is because they are totally out of it and dont even have Adobe Reader on their machine, & don't know how to get it ( yes, we provide the links).....or it's some ancient version....no one can stop this one...
    It almost always generates some kind ( at least one time)  of "error message" which we do warn them about..., telling one,  basically that "Acrobat doesnt even like this happening at all, and it could be detrimental to ones computer files", blah-blah...(this freaks grandma out really bad)...& usually they end up not even trying to send it...  and then I get calls that even you wouldn't believe...& If they DO nut up and push the Red "Submit Form" button, it will usually send the thing to us (and also back to them at the "required email address" they furnished on the form, thats what the folks at the "fillable forms place" do) so, if it's performing it's functions, why it is having to complain?. What are we doing wrong?....and how can I fix it?...Will re-compiling it or saving it as a newer version of "FormsCentral" correct any of these problems ?
    Ok, so that should keep you busy for a minute and we can start out with those problems...but the next thing is, how can I take advantage of YOUR re-direct & hosting services?, And will it get rid of the error messages, and the slowness, and the iOS incompatibilities ? (amazingly,  the last iOS Reader version worked almost OK.. but the newest version doesnt seem to work with my form on my iphone4)  If it will enable any version of the iOS to send my form correctly and more transparently, then it might be worth the money...$14.95 a MONTH you say. hmmmmm...Better be good.
    Another problem is, that I really don't need 5000 forms a month submitted. I think its like 70-100 or less....Got any plans for that?  Maybe I'm just not BIG ENOUGH to use Adobe's services, however in this case, I really don't care whose I do use as long as the product works most correctly for my customers as well as us. Like I said, If I'm doing the best I can, I won't change anything, and still use the other third party, If Adobe has a better solution, then i'm all for that as well. In the meantime, Thanks for any help you can provide on this...
    Michael Corman
    VinylCouture.com
    (706) 326-7911

  • Need help with an assignment

    first of all, who has heard of the game called zuul? It is a very boring text based game I am currently having the pleasure of improving.
    Basically, you are in a room, that is connected to a bunch of other rooms and depending on the room you are in, you have different exists and different items in the room.
    The goal is to navigate through the collection of Rooms and there is no real win condition, It is more for learning then for actually playing.
    You navigate by a series of commands such as: go (direction)( as in "direction of exit", NSEW), quit, a few other odd bits.
    ex: go south, quit, go west etc
    The game has several classes: Game, Command, CommandWords, Item, Parser, Room.
    Obviously Game is the main central head conch, (it is not the super class.)
    Game makes use of Item, Room, Parser, and Command.
    Item is the class that deals with the number of items in the Room.
    Room is the class that deals with the rooms the player will navigate to and from.
    Command reads in the commands such as "go-(direction)" or "quit".
    Parser makes everybody understand each other by using both Command and CommandWords.
    CommandWords is a list of commands such as "go", "quit" etc.
    The problem I am having right now is to allow a player to move through the rooms while holding a certain item. The item has to come from the rooms and the player should be able to drop it.
    So I have to add two new commands: take and drop. The problem is that I have been asked to do this without creating a new class. Otherwise I would have just created class Player and be done with it. So I am trying to figure out whose responsibility should it be to take care of the take and drop command. I have done some preliminary work in class Game, it is the take(Command command) and drop() methods.
    I have also a few questions concerning other aspects of the project, I have listed their locations here:
    1. The take() method in class Game, the for-each loop, a complier error with ArrayList
    2. class Parser, a general question about the string tokenzier
    If you want to see how the game is suppose to run, just comment out the bodies of take() and drop(). Not the declaration. Everything else works.
    I shall now provide the code to all classes. I wish there were an option to upload a zip file, then you don't have to read through all the codes and copy&paste all the codes. The complier I am using is BlueJ. And the SDK version is 1.6. With the exception of class Game, everything else can be assumed to be error free.
    Thank you for your time,
    Davy
    class Game
    import java.util.*;
    *  This class is the main class of the "World of Zuul" application.
    *  "World of Zuul" is a very simple, text based adventure game.  Users
    *  can walk around some scenery. That's all. It should really be extended
    *  to make it more interesting!
    *  To play this game, create an instance of this class and call the "play"
    *  method.
    *  This main class creates and initialises all the others: it creates all
    *  rooms, creates the parser and starts the game.  It also evaluates and
    *  executes the commands that the parser returns.
    * @author  Michael Kolling and David J. Barnes
    * @version 2006.03.30
    public class Game
        private Parser parser;
        private Room currentRoom;
        private Room previousRoom;
        private Stack<Room> previousRooms;
         * Create the game and initialise its internal map.
        public Game()
            createRooms();
            parser = new Parser();
         * Create all the rooms and link their exits together.
        private void createRooms()
            Room outside, theatre, pub, lab, office;
            // create the rooms
            outside = new Room("outside the main entrance of the university");
            theatre = new Room("in a lecture theatre");
            pub = new Room("in the campus pub");
            lab = new Room("in a computing lab");
            office = new Room("in the computing admin office");
            // create some items
            Item desk, chair, beer, podium, tree;
            desk = new Item("desk", "student desk",10);
            chair = new Item("chair", "student chair",5);
            beer = new Item("beer", "glass of beer", 0.5);
            podium = new Item("podium", "lecture podium", 100);
            tree = new Item("tree", "a tree", 500.5);
            // put items in some of the rooms
            outside.addItem(tree);
            theatre.addItem(desk);
            theatre.addItem(chair);
            theatre.addItem(podium);
            pub.addItem(beer);
            pub.addItem(beer);
            office.addItem(desk);
            lab.addItem(chair);
            lab.addItem(beer);
            // initialise room exits
            outside.setExit("east", theatre);
            outside.setExit("south", lab);
            outside.setExit("west", pub);
            theatre.setExit("west", outside);
            pub.setExit("east", outside);
            lab.setExit("north", outside);
            lab.setExit("east", office);
            office.setExit("west", lab);
            currentRoom = outside;  // start game outside
            previousRooms = new Stack<Room>(); // no rooms on the stack
            previousRoom = null;
         *  Main play routine.  Loops until end of play.
        public void play()
            printWelcome();
            // Enter the main command loop.  Here we repeatedly read commands and
            // execute them until the game is over.
            boolean finished = false;
            while (! finished) {
                Command command = parser.getCommand();
                finished = processCommand(command);
            System.out.println("Thank you for playing.  Good bye.");
         * Print out the opening message for the player.
        private void printWelcome()
            System.out.println();
            System.out.println("Welcome to the World of Zuul!");
            System.out.println("World of Zuul is a new, incredibly boring adventure game.");
            System.out.println("Type 'help' if you need help.");
            System.out.println();
            System.out.println(currentRoom.getLongDescription());
         * Given a command, process (that is: execute) the command.
         * @param command The command to be processed.
         * @return true If the command ends the game, false otherwise.
        private boolean processCommand(Command command)
            boolean wantToQuit = false;
            if(command.isUnknown()) {
                System.out.println("I don't know what you mean...");
                return false;
            String commandWord = command.getCommandWord();
            if (commandWord.equals("help")) {
                printHelp();
            else if (commandWord.equals("go")) {
                goRoom(command);
            else if (commandWord.equals("look")) {
                look(command);
            else if (commandWord.equals("eat")) {
                eat(command);
            else if (commandWord.equals("back")) {
                back(command);
            else if (commandWord.equals("stackBack")) {
                stackBack(command);
            else if (commandWord.equals("take")){
                take(command);
            else if (commandWord.equals("drop")) {
                drop(command);
            else if (commandWord.equals("quit")) {
                wantToQuit = quit(command);
            // else command not recognised.
            return wantToQuit;
        // implementations of user commands:
         * Print out some help information.
         * Here we print some stupid, cryptic message and a list of the
         * command words.
        private void printHelp()
            System.out.println("You are lost. You are alone. You wander");
            System.out.println("around at the university.");
            System.out.println();
            System.out.println("Your command words are:");
            System.out.println(parser.getCommands());
         * Try to go to one direction. If there is an exit, enter the new
         * room, otherwise print an error message.
         * @param command The command entered.
        private void goRoom(Command command)
            if(!command.hasSecondWord()) {
                // if there is no second word, we don't know where to go...
                System.out.println("Go where?");
                return;
            String direction = command.getSecondWord();
            // Try to leave current room.
            Room nextRoom = currentRoom.getExit(direction);
            if (nextRoom == null) {
                System.out.println("There is no door!");
            else {
                previousRooms.push(currentRoom);
                previousRoom = currentRoom;
                currentRoom = nextRoom;
                System.out.println(currentRoom.getLongDescription());
         * "Look" was entered.
         * @param command The command entered.
        private void look(Command command)
            if(command.hasSecondWord()) {
                System.out.println("Look what?");
                return;
            System.out.println(currentRoom.getLongDescription());
         * "Eat" was entered.
         * @param command The command entered.
        private void eat(Command command)
            if(command.hasSecondWord()) {
                System.out.println("Eat what?");
                return;
            System.out.println("You have eaten and are no longer hungry!");
         * "Back" was entered.
         * @param command The command entered.
        private void back(Command command)
            if(command.hasSecondWord()) {
                System.out.println("Back what?");
                return;
            if (previousRoom==null) {
                System.out.println("Can't go back.");
                return;
            // push current room on stack (for stackBack)
            previousRooms.push(currentRoom);
            // swap current and previous rooms (for back)
            Room temp = currentRoom;
            currentRoom = previousRoom;
            previousRoom = temp;
            // You could replace the previous three lines with the following
            // which use the stack to get the previous room
            // but note that this makes "back" dependent on "stackBack".
            // (If you do it this way you no longer need "temp".
            // currentRoom = previousRoom;
            // previousRoom = previousRooms.peek();
            System.out.println("You have gone back:");
            System.out.println(currentRoom.getLongDescription());
         * "StackBack" was entered.
         * @param command The command entered.
        private void stackBack(Command command)
            if(command.hasSecondWord()) {
                System.out.println("StackBack what?");
                return;
            if (previousRooms.isEmpty()) {
                System.out.println("Can't go StackBack.");
                return;
            // set previous room (for "back")
            previousRoom = currentRoom;
            // set new current room (using stack)
            currentRoom = previousRooms.pop();
            System.out.println("You have gone StackBack:");
            System.out.println(currentRoom.getLongDescription());
         * allows a player to take something from the room
         * @param command
        private void take(Command command){
        String a;
        a=command.getSecondWord();
        for (Item i:currentRoom.items()) { //a for each loop, since the room's items are kept in a list, but this gives a                                           //compiler error, it doesn't work because items is an ArrayList, but I need a way to pick up the item. I thought that if //given the item's name, I could run a check through the room's ArrayList of items via a for-each loop
            if (a==i.getName()) {
            removeItem (i);
            return;
         * allows a player to drop an item in the room
         * @param command
        private void drop(Command command) {
            if(command.hasSecondWord()) {
                System.out.println("drop what?");
                return;
            //add item method is suppose to be used here
         * "Quit" was entered. Check the rest of the command to see
         * whether we really quit the game.
         * @param command The command entered.
         * @return true, if this command quits the game, false otherwise.
        private boolean quit(Command command)
            if(command.hasSecondWord()) {
                System.out.println("Quit what?");
                return false;
            else {
                return true;  // signal that we want to quit
    }class Room
    import java.util.*;
    * Class Room - a room in an adventure game.
    * This class is part of the "World of Zuul" application.
    * "World of Zuul" is a very simple, text based adventure game. 
    * A "Room" represents one location in the scenery of the game.  It is
    * connected to other rooms via exits.  For each existing exit, the room
    * stores a reference to the neighboring room.
    * @author  Michael Kolling and David J. Barnes
    * @version 2006.03.30
    * @author L.S. Marshall
    * @version 1.03 October 25, 2007
    public class Room
        private String description;
        private HashMap<String, Room> exits;        // stores exits of this room.
        // The items in the room
        private ArrayList<Item> items;
         * Create a room described "description". Initially, it has
         * no exits. "description" is something like "a kitchen" or
         * "an open court yard".
         * @param description The room's description.
        public Room(String description)
            this.description = description;
            exits = new HashMap<String, Room>();
            items = new ArrayList<Item>();
         * Define an exit from this room.
         * @param direction The direction of the exit.
         * @param neighbor  The room to which the exit leads.
        public void setExit(String direction, Room neighbor)
            exits.put(direction, neighbor);
         * Gives a short description of the room.
         * @return The short description of the room
         * (the one that was defined in the constructor).
        public String getShortDescription()
            return description;
         * Return a description of the items in the room
         * (Note that this could be combined with getLongDescription, but
         * this way shows better cohesion, and could avoid code duplication
         * for future enhancements.)
         * @return A description of the items in this room
        public String getItemsDescription()
            String s = new String();
            if (items.size()==0)
                s += "There are no items in this room.\n";
            else {
                s += "The item(s) in the room are:\n";
                for (Item item : items ) {
                   s += item.getInfo() + "\n";
            return s;
         * Return a description of the room in the form:
         *     You are in the kitchen.
         *     Exits: north west
         *     and information on the items in the room
         * @return A long description of this room
        public String getLongDescription()
            String s = "You are " + description + ".\n" + getExitString() + "\n";
            s += getItemsDescription();
            return s;
         * Return a string describing the room's exits, for example
         * "Exits: north west".
         * @return Details of the room's exits.
        private String getExitString()
            String returnString = "Exits:";
            Set<String> keys = exits.keySet();
            for(String exit : keys) {
                returnString += " " + exit;
            return returnString;
         * Return the room that is reached if we go from this room in direction
         * "direction". If there is no room in that direction, return null.
         * @param direction The exit's direction.
         * @return The room in the given direction.
        public Room getExit(String direction)
            return exits.get(direction);
         * Adds the given item to the room.
         * @param item The item to be added
        public void addItem(Item item)
            items.add(item);
         * Removes an item if the person picks it up
         * @param item the item to be removed
        public void removeItem (Item item)
            items.remove(item);
    }class Item
    * This represents an item in a room in zuul.
    * @author L.S. Marshall
    * @version 1.00 October 9, 2007
    public class Item
        // The description of the item
        private String description;
        // The weight of the item
        private double weight;
        private String name;
         * Constructor for objects of class Item
         * @param desc description of the item
         * @param weight the weight of the item
        public Item(String name, String desc, double weight)
            description = desc;
            this.weight = weight;
            this.name=name;
         * Returns a string representing this item
         * @return string representing this item
        public String getInfo()
            return ("Item: " + description + ", weighs " + weight + ".");
         * returns the name of the string
         * @ return the name in a string
        public String getName()
            return ( name );
    }class Command
    * This class is part of the "World of Zuul" application.
    * "World of Zuul" is a very simple, text based adventure game. 
    * This class holds information about a command that was issued by the user.
    * A command currently consists of two strings: a command word and a second
    * word (for example, if the command was "take map", then the two strings
    * obviously are "take" and "map").
    * The way this is used is: Commands are already checked for being valid
    * command words. If the user entered an invalid command (a word that is not
    * known) then the command word is <null>.
    * If the command had only one word, then the second word is <null>.
    * @author  Michael Kolling and David J. Barnes
    * @version 2006.03.30
    public class Command
        private String commandWord;
        private String secondWord;
         * Create a command object. First and second word must be supplied, but
         * either one (or both) can be null.
         * @param firstWord The first word of the command. Null if the command
         *                  was not recognised.
         * @param secondWord The second word of the command.
        public Command(String firstWord, String secondWord)
            commandWord = firstWord;
            this.secondWord = secondWord;
         * Return the command word (the first word) of this command. If the
         * command was not understood, the result is null.
         * @return The command word.
        public String getCommandWord()
            return commandWord;
         * @return The second word of this command. Returns null if there was no
         * second word.
        public String getSecondWord()
            return secondWord;
         * @return true if this command was not understood.
        public boolean isUnknown()
            return (commandWord == null);
         * @return true if the command has a second word.
        public boolean hasSecondWord()
            return (secondWord != null);
    }class Parser
    import java.util.Scanner;
    import java.util.StringTokenizer;
    //I read the documentation for String Tokenizer, and I have a few questions relating to a pet project of mine. The //project is to build a boolean algebra simplifer. I would give it a boolean expression and it will simplify it for me.
    //Which is very similar to what this class does. The documentation mentioned a delimiter for separating the tokens.
    //yet I see none here, is the delimiter at default, the space between the words? and if I were to set manually //delimiters, how do I do that?
    //Once I read in the string, should it be Parser's job to execute the boolean simplification part? According the RDD,
    //it shouldn't, but doing so would keep everything in fewer classes and therefore easier to manage, wouldn't it?
    * This class is part of the "World of Zuul" application.
    * "World of Zuul" is a very simple, text based adventure game. 
    * This parser reads user input and tries to interpret it as an "Adventure"
    * command. Every time it is called it reads a line from the terminal and
    * tries to interpret the line as a two word command. It returns the command
    * as an object of class Command.
    * The parser has a set of known command words. It checks user input against
    * the known commands, and if the input is not one of the known commands, it
    * returns a command object that is marked as an unknown command.
    * @author  Michael Kolling and David J. Barnes
    * @version 2006.03.30
    * @author L.S. Marshall
    * @version 1.01 October 9, 2007
    public class Parser
        private CommandWords commands;  // holds all valid command words
        private Scanner reader;         // source of command input
         * Create a parser to read from the terminal window.
        public Parser()
            commands = new CommandWords();
            reader = new Scanner(System.in);
         * Command returns the command typed by the user.
         * @return The next command from the user.
        public Command getCommand()
            String inputLine;   // will hold the full input line
            String word1 = null;
            String word2 = null;
            System.out.print("> ");     // print prompt
            inputLine = reader.nextLine();
            // Find up to two words on the line.
            Scanner tokenizer = new Scanner(inputLine);
            if(tokenizer.hasNext()) {
                word1 = tokenizer.next();      // get first word
                if(tokenizer.hasNext()) {
                    word2 = tokenizer.next();      // get second word
                    // note: we just ignore the rest of the input line.
            // Now check whether this word is known. If so, create a command
            // with it. If not, create a "null" command (for unknown command).
            if(commands.isCommand(word1)) {
                return new Command(word1, word2);
            else {
                return new Command(null, word2);
         * Returns a list of valid command words.
         * @string list of valid command words
        public String getCommands()
            return commands.getCommandList();
    }class CommandWords
    * This class is part of the "World of Zuul" application.
    * "World of Zuul" is a very simple, text based adventure game.
    * This class holds an enumeration of all command words known to the game.
    * It is used to recognise commands as they are typed in.
    * @author  Michael Kolling and David J. Barnes
    * @version 2006.03.30
    * @author L.S. Marshall
    * @version 1.01 October 9, 2007
    public class CommandWords
        // a constant array that holds all valid command words
        private static final String[] validCommands = {
            "go", "quit", "help", "look", "eat", "back", "stackBack",
            "take", "drop",
         * Constructor - initialise the command words.
        public CommandWords()
            // nothing to do at the moment...
         * Check whether a given String is a valid command word.
         * @param aString the command word
         * @return true if it is, false if it isn't.
        public boolean isCommand(String aString)
            for(int i = 0; i < validCommands.length; i++) {
                if(validCommands.equals(aString))
    return true;
    // if we get here, the string was not found in the commands
    return false;
    * Return a string containing all valid commands.
    * @return string of all valid commands
    public String getCommandList()
    String s="";
    for(String command: validCommands) {
    s += command + " ";
    return s;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    right, sorry, that was thoughtless of me.
    class Parser
    import java.util.Scanner;
    import java.util.StringTokenizer;
    //I read the documentation for String Tokenizer, and I have a few questions relating to a pet project of mine. The //project is to build a boolean algebra simplifer. I would give it a boolean expression and it will simplify it for me.
    //Which is very similar to what this class does. The documentation mentioned a delimiter for separating the tokens.
    //yet I see none here, is the delimiter at default, the space between the words? and if I were to set manually //delimiters, how do I do that?
    //Once I read in the string, should it be Parser's job to execute the boolean simplification part? According the RDD,
    //it shouldn't, but doing so would keep everything in fewer classes and therefore easier to manage, wouldn't it?
    * This class is part of the "World of Zuul" application.
    * "World of Zuul" is a very simple, text based adventure game. 
    * This parser reads user input and tries to interpret it as an "Adventure"
    * command. Every time it is called it reads a line from the terminal and
    * tries to interpret the line as a two word command. It returns the command
    * as an object of class Command.
    * The parser has a set of known command words. It checks user input against
    * the known commands, and if the input is not one of the known commands, it
    * returns a command object that is marked as an unknown command.
    * @author  Michael Kolling and David J. Barnes
    * @version 2006.03.30
    * @author L.S. Marshall
    * @version 1.01 October 9, 2007
    public class Parser
        private CommandWords commands;  // holds all valid command words
        private Scanner reader;         // source of command input
         * Create a parser to read from the terminal window.
        public Parser()
            commands = new CommandWords();
            reader = new Scanner(System.in);
         * Command returns the command typed by the user.
         * @return The next command from the user.
        public Command getCommand()
            String inputLine;   // will hold the full input line
            String word1 = null;
            String word2 = null;
            System.out.print("> ");     // print prompt
            inputLine = reader.nextLine();
            // Find up to two words on the line.
            Scanner tokenizer = new Scanner(inputLine);
            if(tokenizer.hasNext()) {
                word1 = tokenizer.next();      // get first word
                if(tokenizer.hasNext()) {
                    word2 = tokenizer.next();      // get second word
                    // note: we just ignore the rest of the input line.
            // Now check whether this word is known. If so, create a command
            // with it. If not, create a "null" command (for unknown command).
            if(commands.isCommand(word1)) {
                return new Command(word1, word2);
            else {
                return new Command(null, word2);
         * Returns a list of valid command words.
         * @string list of valid command words
        public String getCommands()
            return commands.getCommandList();
    }

  • I need help putting Classical Music CDs into iTunes

    I need help - this question has lots of subquestions, sorry.
    I have found just a few discussions that deal with this but I am still confused. Forgive me if I get wordy and misuse technical terms - I am trying to learn this thing...
    I'm an iPod newbie and haven't a clue on the best way to organize my many, many classical CDs that I'd like to put onto my iPod Classic 160G. I'd also like to do this with as little fussing around as possible since there are lots of CDs I've got to deal with.
    If each CD is a separate entry [album?] in the playlist and titled with composer name first [ex Bach, Brandenburg Concertos, Titov conductor] I'll have several playlist entries with the same titles, but different contents. No problem really.
    But, should I separate it further, by having each concerto [say] be a separate entry in the playlist - without having to download the CD again. [I've just practiced on a few CDs but I imagine it being a problem if I had to download each CD several times - once for each work] Does it make sense to leave gaps between movements? [I'm not finding a way to remove gaps, though I have seen that suggested somewhere]
    And when I come to play the pieces, if I start playing a work in a playlist, will the iPod keep going from one movement to the next as it makes its way through the playlist - or will it stop at each movement and wait for me to tell it what to do next?
    Advanced Settings - are these the best? I'll be listening to music on an airplane using noise cancelling headphones and at destination attaching iPod to portable speakers to listen to music in hotel rooms.
    General: Keep iTunes Music folder organized - unchecked? [not sure what this means or does or doesn't do]
    Copy files to iTunes Music folder when adding to library - checked?
    Importing: AAC encoder? High quality -128 kbps?
    Thanks for all your help - I know this is a multiple set of questions and perhaps should have been broken up...
    Mrs H
    Message was edited by: Mrs H to fix typos
    Message was edited by: Mrs H

    Thank you so much for your help. You have sorted out a lot of problems for me. I've tried to go through what you wrote, add some more info and I have asked a few more questions below-
    I re-ripped at 256. I too have the 160GB classic so it's good to know that it will take 10,000 tracks as lossless - now I have to re-rip again! I actually hadn't anticipated using the iPod with anything other than our high quality noise canceling airplane headphones, our cheap, portable travel speakers for hotel rooms and our Cambridge sound speakers for our cabin. It's that last set of speakers that makes me think I should follow you advice and go with lossless.
    QUESTION #1 - When I re-rip and do an automatic sync, will the tracks at 256 automatically be replaced by the bigger lossless ones with the same name or should I delete everything from the iPod and begin anew?
    "I create a playlist for each work, using a systematic naming convention..." What I did on my test was create a playlist for each composer breaking it down - ex- Bach:concertos, Bach:sonatas, etc. I have the Album column highlighted and it appears as if the movements stay together in the correct order. I fear that the task might be too large to create a playlist for each work, though that certainly is appealing.
    QUESTION #2 If the Album column is highlighted and the movements are in the correct order in iTunes in the playlist, will they stay that way in the iPod?
    "I tend to use just surnames for composers for example, or at least "surname, firstname"." I finally found in settings on the iPod the way to change sort by composer to last name, first name. In iTunes, the composer column which is imported from the internet search for info on the CDs gives composer with first name first and I can't find a place in iTunes to reverse this. Typing it or erasing the first name will be a huge chore.
    QUESTION #3 Is there a place in iTunes to change the order of the composers' name in the composer column?
    "For compilations etc I still create one for the whole CD or box set"
    I figured this out on my own before you corroborated my idea - I think I'm getting the hang of this...
    "The option iTunes has to "organise your music" is a good one"
    QUESTION #4 - are you referring to the preferences > advanced check box "Keep iTunes Music Folder Organized" ? If not, what are you referring to?
    "I have my library in its own dedicated disk. Wherever you put it, its important to then never change it or doing anything else with it: leave it for iTunes."
    QUESTION #5 "dedicated disk"? as in hard drive? I have been using SuperDuper to back up my Mac to an external HD; I plan to put a copy of the iTunes folder onto yet another HD where I keep copies of all our photos as well.
    "never change it"? I noticed a misspelling "Haendel" from the on-line CD/track info - no problem in fixing that - right? Since you later say you do change info, what is it you are never changing?
    QUESTION #6 - "Disk N of M capability" - what? Where do I find this option? And when you say "for multiple CD albums, don't include the cd number in the album name." Where? when you put the CD into a playlist entry? or just in the list of music in the album column - do you change the listing?
    ONE FINAL QUESTION - when I turn on the iPod when it's not attached to headphones or speakers, and I'm just looking at the screen to see settings or how the syncing worked, the iPod appears to begin playing something as soon as I turn it on. THIS IS A STUPID QUESTION, but I can't find the answer, how to I get it to stop playing without turning the iPod itself off???
    "I hope that helps a little. " A little?? It helps a lot - and I'll award those points as soon as I get it all resolved.
    Thanks again,
    Mrs H

Maybe you are looking for

  • How to delete a shortcut favorite from the browser in the WORK Area

    Hiho, creating a shortcut favorite icon of a browser-website in the work area shows up a symbol to use this shortcut. In the private area I can delete this favorite-symbol by tapping longer on the icon an a trashcan shows up, so I can delete the icon

  • Error 1053 when starting the Routing And Remote Access service

    Hi all, When I tried to start the "Routing And Remote Access" service on Windows 8.1 I got an error message as follow. Could some one help me please. Than's.

  • Deploying OIF for Oracle Weblogic Server

    Hi all, I'm facing a problem deploying OIF for Weblogic. I've installed Weblogic 10.0.0.3 and OIF 11g. I want to know the procedure of creating an IdP and a SP using weblogic server. Please help!!!

  • Format Forms in APEX

    Hello, we want to migrate a Portal 3.06 (DB 8.17) application to apex. In the Aplication there are several input forms. In Portal i use plsql Procedure to manage the input. The layout i build with html and very easy the item tags (e.g. #Name.item#, #

  • Using FLEX Visual Composer iViews in Guided Procedures and the UWL

    Hello Experts, I am trying to display a GP workitem and I am getting this error "The portal page builder required to execute this callable object is not available." I have a GP Process and it haves FLEX Visual Composer iView, it runs fine un the Runt