Scanner class and Ready to Program

Hi I have only been programming for about 3 years. I have always used Ready to Program as my environment and I rly like it. I used to always used the BufferedReader to read in inputs from the keyboard. now I am in university and we always use the Scanner class to read in the inputs and i have unfortunately had to conform because my narrow minded professors don't want to help me when I code my way, ughhh, but ya.
pretty much, I believe when i have gone in the properties of Ready to Program it says it is using JDK 1.4. so I'm guessing it is styll using that version of Java or something ( I have never had to go into the propeties of java to change anything so I am not sure if there is a way to import the new version of Java or not) but basically I went to Ready's site and it said that a new Beta is out that I have to wait for them to email to recieve. http://www.holtsoft.com/ready/support/ . and the beta is version 1.6 so I am asumming that it is the one that comes packaged with 1.6. my question, as I believe it will be a while before i recieve the link, is there anyway to import and make java look at my jdk 1.6 at all. I have put them in the same folder but I don't know where to put the JDK or JRE 1.6 folders to allow Ready to read it.

oh, and has anyone recieved the new Ready to program beta v1.6? I was wondering if I could get a copy because its taking so long ot get it, I think i applied about a week and a half ago

Similar Messages

  • Which table stores all development class and names of programs

    Hi All,
    can any one tell me which table stores all development classes and programs we made.

    thanks for the answer , i got info also.
    TADIR is also one table in which you can find out the prog names and dev class.
    check table for dev class is TDEVC.

  • Problems with the Scanner class and the decimal point

    I'm creating a GUI so to get the user input (double value) I use a jText field and the Scanner to read that value:
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
            String time = jTextTime.getText();
           double t = new Scanner(time).nextDouble();
            String cy = Double.toString(t);
            jTextCycles.setText(cy);
        }                                  The problem is that the decimal point it's a comma so if I write:
    1.2
    t = (Error InputMismatchException)
    1.236
    t = 1236.0
    1,2
    t = 1.2
    So I try using the parse method to get the double value:
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
            String time = jTextTime.getText();
           double t = Double.parseDouble(time);
            String cy = Double.toString(t);
            jTextCycles.setText(cy);
        }                            In this case the method parseDouble() takes the dot as the decimal point so if i write:
    1.2
    t = 1.2
    1.236
    t = 1.236
    1,2
    t = (Error InputMismatchException)
    � What can I do to Scanner class to accept the dot as the decimal point?
    I think that the problem is becouse in some countries (I'm from Colombia) the decimal point is a comma and in others is the dot.
    Thanks

    From the Javadocs for Scanner:
    Localized numbers
    An instance of this class is capable of scanning numbers in the standard formats as well as in the formats of the scanner's locale. A scanner's initial locale is the value returned by the Locale.getDefault() method; it may be changed via the useLocale(java.util.Locale) method.
    If you change your locale to one of those that does use a comma for a decimal point, it should work.

  • Scanner Class Help

    Hi, in a program I'm writing, I've read a line using the scanner class, and after finding a character that's not a digit (using an if(! Character.isDigit) ), I need to go back to the initial position and read the integer. But, since I've already used Scanner to scan the line, I can't seem to get it to go back without closing the file stream and re-opening it. Is there any way around this?

    right, that's what i've done, and then i examine that string until i find a character that's not a digit... so i need to set it as a delimiter (which i know how to do) and then read the integer before it... but i have no idea how many digits the integer before it will have (probably at most 3, but my program's supposed to encompass a large amount of possibilities)
    [edit]
    And I don't know of any string methods that will let me read an integer from the string...
    Edited by: Hawx on Oct 11, 2007 12:13 PM

  • Transport classes and programs to another server

    Except for transport routing and charm copy function, do we have other ways to do so?
    for example copy or so forth.
    best regards,
    Blake Le

    Hi Blake
    SAP R/3 Correction and Transport System
    Operating system level files in the transport process:
    The SAP C program TP, requires a special file structure for the transport process. The file system is operating system dependent. TP uses a transport directory or file system, which is called /usr/sap/trans.
    The /usr/sap/trans file system is generally NFS mounted form the development system to other systems unless a system is defined as a single system in the CTS pipeline. All the sub directories should have <SID>adm as the owner and sapsys as the group; and proper read, write and execute access should be given to owner and the group. The TP imports are always performed by <SID>adm.
    The following are the subdirectories in /usr/sap/trans:
    /data
    /cofiles
    /bin
    /log
    /actlog
    /buffer
    /sapnames
    /tmp
    /usr/sap/trans/data: holds the data of transport objects after they are released . The example of a data file is R904073.DEV. The extension DEV means the data file was released from the DEV or development system.
    /usr/sap/trans/cofiles: The cofiles directory holds the command files for all change requests. These files are like a command or control files used to import the data files. The common directory for CTS system is /usr/sap/trans. After a change request is released from the source system , the data is exported immediately to the file system of the operating system. The SAP transport utility TP uses the cofile to transport a data file. The example of a file in cofiles directory is K904073.DEV.
    /usr/sap/trans/bin: holds the most important file TPPARAM in the CTS system. TPPARAM file has all the information about the CTS systems in the CTS pipeline. TPPARAM file is the parameter file for the transport program TP and it is the common file for all the systems in the CTS pipeline. As you know already that /usr/sap/trans should be NFS mounted to all the systems in a CTS pipeline, TP program has access to the TPPARAM file from all the systems. The following is an example of typical TPPARAM file for five SAP systems in the CTS pipeline:
    #@(#) TPPARAM.sap 20.6 SAP 95/03/28
    Template of TPPARAM for UNIX #
    First we specify global values for some parameters, #
    later the system specific incarnation of special parameters #
    global Parameters #
    transdir = /usr/sap/trans/
    dbname = $(system)
    alllog = ALOG$(syear)$(yweek)
    syslog = SLOG$(syear)$(yweek).$(system)
    System spezific Parameters #
    Beispiel T11 #
    DEV/dbname = DEV
    DEV/dbhost = sap9f
    DEV/r3transpath = /usr/sap/DEV/SYS/exe/run/R3trans
    QAS/dbname = QAS
    QAS/dbhost = sap8f
    QAS/r3transpath = /usr/sap/QAS/SYS/exe/run/R3trans
    TRN/dbname = TRN
    TRN/dbhost = sap17
    TRN/r3transpath = /usr/sap/TRN/SYS/exe/run/R3trans
    PRE/dbname = PRE
    PRE/dbhost = sap19f
    PRE/r3transpath = /usr/sap/PRE/SYS/exe/run/R3trans
    PRD/dbname = PRD
    PRD/dbhost = sap18f
    PRD/r3transpath = /usr/sap/PRD/SYS/exe/run/R3trans
    /usr/sap/trans/log: holds the entire log files, trace files and statistics for the CTS system. When the user goes to SE09 (workbench organizer) or SE10 (customizing organizer) transaction and opens the log for a transport, the log file for that transport will be read from /usr/sap/trans/log directory. Each change request should have a log file. Examples of log files are DEVG904073.QAS, DEVI904073.QAS and DEVV904073.QAS. The name of a log file consists of the names of the change request, the executed step, and the system in which the step was executed:
    <source system><action><6 digits>.<target system>
    Now we can analyze the above example DEVG904073. QAS. The <source system> = DEV, <action> = G or report and screen generation, <6 digits> = 904073 (these six digits numbers are exactly the same number as the six digits of the transport) and the <target system> = QAS
    Possible values for <action> are:
    A: Dictionary activation
    D: Import of application-defined objects
    E: R3trans export
    G: Report and screen generation
    H: R3trans dictionary import
    I: R3trans main import
    L: R3trans import of the command files
    M: Activation of the enqueue modules
    P: Test import
    R: Execution of reports after put (XPRA)
    T: R3trans import of table entries
    V: Set version flag
    X: Export of application-defined objects.
    /usr/sap/trans/actlog: holds action log files. The example of an action file is DEVZ902690.DEV. The following are the contents of the file:
    1 ETK220 u201C==================================================u201D u201C=================
    =============================
    1 ETK191 u201C04/30/1998u2033 Action log for request/task: u201CDEVK902690u2033
    1 ETK220 u201C==================================================u201D u201C=================
    =============================
    1 ETK185 u201C04/30/1998 18:02:32u2033 u201CMOHASX01u2033 has reincluded the request/task
    4 EPU120 Timeu2026 u201C18:02:32u2033 Run timeu2026 u201C00:00:00u2033
    1 ETK193 u201C04/30/1998 18:02:33u2033 u201CMOHASX01u2033 owner, linked by u201CMOHASX01u2033 to u201CDEVK902691u2033
    4 EPU120 Timeu2026 u201C18:02:33u2033 Run timeu2026 u201C00:00:00u2033
    1 ETK190 u201C05/04/1998 11:02:40u2033 u201CMOHASX01u2033 has locked and released the request/task
    1 ETK194 u201C05/04/1998 11:02:40u2033 **************** End of log *******************
    4 EPU120 Timeu2026 u201C11:02:40u2033 Run timeu2026 u201C00:00:09u2033
    ~
    ~u201DDEVZ902690.DEVu201D 10 lines, 783 characters
    /usr/sap/trans/buffer: transport buffer of the target systems; contains control information on which requests are to be imported into which systems and in what order the imports must occur. The /usr/sap/trans/buffer will have a directory for each system in the CTS pipeline. For example the buffer file for DEV system is /usr/sap/trans/buffer/DEV.
    /usr/sap/trans/sapnames: holds information pertaining to transport requests for each system user. There are files for each user who released change requests from the system.
    /usr/sap/trans/tmp: holds information about temporary data and log files. While the transport is occurring the Basis administrator can find a file that is related to the transport in the tmp directory; that file shows the exact status if the transport (What objects are being imported at that time).
    Important SAP delivery class and table types and tables in the CTS process:
    Delivery class
    The delivery class defines who (i.e. the SAP system itself or the customer) is responsible for maintaining the table contents. In addition the delivery class controls how the table behaves in a client copy and an upgrade. For example when you select a SAP defined profiles to perform a client copy, certain tables are selected according to their delivery class. DD02L table can show what delevery class a table belongs to.
    The following delivery classes exist:
    A: Application table.
    C: Customizing table, maintenance by customer only.
    L: Table for storing temporary data.
    G: Customizing table, entries protected against overwriting.
    E: Control table.
    S: System table, maintenance only by SAP.
    W: System table, contents can be transported via own TR objects.
    Table type
    The table type defines whether a physical table exists for the logical table description defined in the ABAP/4 Dictionary and how the table is stored on the database.
    The following are different table types in SAP:
    Transparent Tables
    There is a physical table on the database for each transparent table. The names of the physical table and the logical table definition in the ABAP/4 Dictionary are same. For every transparent table in SAP, there is a table in database. The business and application data are stored in transparent tables.
    Structure
    No data records exist on the database for a structure. Structures are used for the interface definition between programs or between screens and programs.
    Append Structure
    An Append structure defines a subset of fields which belong to another table or structure but which are treated as a separate object in the correction management. Append structures are used to support modifications.
    The following table types are used for internal purposes, for example to store control data or for continuous texts:
    Pooled table
    Pooled tables can be used to store control data (e.g. screen sequences, program parameters or temporary data). Several pooled tables can be combined to form a table pool. The table pool corresponds to a physical table on the database in which all the records of the allocated-pooled tables are stored.
    Cluster table
    Cluster tables contain continuous text, for example documentation. Several cluster tables can be combined to form a table cluster. Several logical lines of different tables are combined to form a physical record in this table type. This permits object-by-object storage or object-by-object access. In order to combine tables in clusters, at least part of the keys must agree. Several cluster tables are stored in one corresponding table on the database.
    Tables in CTS process:
    TRBAT and TRJOB:
    TRJOB and TRBAT are the major tables in the CTS process. After TP program has sent the event to the r3 system, RDDIMPDP checks table TRBAT in the target system to find out if there is an action to be performed. Mass activation, distribution, or table conversions are the examples of actions. If there is action to be performed, RDDIMPDP starts the appropriate program in the background task. RDDIMPDP then reschedules itself.
    By checking table TRJOB, RDDIMPDP automatically recognizes if a previous step was aborted, and restarts this step. For each transport request , TP program inserts an entry into table TRBAT. If the return code 9999 in this table then the step is waiting to be performed. Return code 8888 indicates that the step is active and currently being processed. A return code of 12 or less indicates that the step is finished. In addition, TP inserts a header entry to let the RDDIMPDP program know to start processing. The column return code will therefore contain a B for begin. When RDDIMPDP is started, it sets the header entry to R(un), and starts the required program. When all the necessary actions are performed for all the transport requests, the column return code contains all the return codes received, and the column TIMESTAMP contains the finishing time. The header entry is set to F(inished). TP monitors the entries in TRBAT and TRJOB tables. When the header entry in TRBAT is set to finished. The entry in TRJOB is deleted.
    Transport Tables SE06
    TDEVC - Development classes
    TASYS - Details of the delivery. Systems in the group that should automatically receive requests, have to be specified in table TASYS.
    TSYST - The transport layers will be assigned to the integration systems. ( Define all systems)
    TWSYS - Consolidation routes ( define consolidation path)
    DEVL - Transport layers are defined here
    In u201CConfiguring the CTS systemu201D section, We will learn more about the transport tables in SE06 transaction
    Programs in the CTS process:
    In the CTS table section we learned about the RDDIMPDP program. RDDIMPDP program needs to be scheduled in all the clients in an instance. It is recommended to schedule the RDDIMPDP as event driven.
    RDDPUTPP and RDDNEWPP programs can be used to schedule RDDIMPDP program in the background.
    The ABAP/4 programs that RDDIMPDP starts are determined by the transport step to be executed that is entered in the function field of table TRBAT.
    Function Job Name Description of transport Steps
    J RDDMASGL Activation of ABAP/4 dictionary objects
    M RDDMASGL Activation of match codes and lock objects
    S RDDDISOL Analysis of database objects to be converted
    N RDDGENOL Conversion of database objects
    Y RDDGENOL Conversion of matchcode tables
    X RDDDICOL Export of AD0 objects
    D RDDDIC1L Import of AD0 objects
    E RDDVERSE Version management update during export
    V RDDVERSL Version management update during import
    R RDDEXECL Execution of programs for post - import processing
    G RDDDIC3L Generation of ABAP/4 programs and screens
    Version Management:
    One of the important features of Workbench Organizer is Version Management. This feature works for all the development objects. Using the version management feature the users can compare and retrieve previous versions of objects.
    Version management provides for comparisons, restore of previous versions, documentation of changes and assistance in the adjustment of data after upgrading to a new release. With the release of a change request, version maintenance is automatically recorded for each object. If an object in the system has been changed N times, it will have N delta versions and one active version. To display version management, for ABAPs use transaction SE38 and for tables, domains and data elements use SE11. The path to follow is Utilities -> Display version. Using version management the users can view existing version for previously created ABAP code, make changes to the code, compare code versions and restore original version of the code. Now the users will be restore previous versions without cut and paste steps of the past.
    TP and R3trans program:
    The basis administrator uses TP program to transport SAP objects from one system to another. TP is a C program delivered by SAP that runs independently of the R/3 system. TP program uses the appropriate files located in a common transport directory /usr/sap/trans. TP starts C programs, ABAP/4 programs and special operating system commands to its job. R3trans is one of the most important utility program called by TP. Before using the TP program, the basis administrator needs to make sure that the CTS system is setup properly and the right version of TP is running in the system. The TP program is located in the run time directory /usr/sap/<SID>/SYS/exe/run directory. It is automatically copied in the install process. A global parameter file TPPARAM that contains the databases of the different target systems and other information for the transport process controls TP. The global parameter file determines which R3trans is used for each system. If the parameter r3transpath is not defined properly then no export and import can be done. The basis administrator should make sure that the default value u201Cr3transpathu201D is properly defined. Later in this chapter we will learn more about TP and R3trans; also we are going to see how they are used.
    Configuring the TPPARAM file:
    Each time TP is started, it must know the location of the global parameter file. As we have seen before TPPARAM file should be in directory /usr/sap/trans/bin. The parameters in TPPARAM can either global (valid for each and every system in the cts pipeline) or local to one system. Th parameters are either operating system dependant (these parameters preceded by a keyword corresponding to the specific operating system) or database dependant (contain a keyword corresponding to a specific database system).
    The global parameter file provides variables that can be used for defining parameters. The variables can be defined in format: $(xyz). The brackets can be substituted with the u201C\u201D-character if required.
    The following pre-defined variables are available for the global parameter file:
    $(cpu1): The CPU name can be sun or as4 for example. In heterogeneous networks this variable is very important.
    $(cpu2): Acronym for the name of the operating system. The example for this variable can be
    hp-ux, or sunos . This is an operating system specific variable.
    $(dname): Used for the day of the week (SUN,MON,u2026.).
    $(mday): Used for the day of the current month (01-31).
    $(mname): Used for the name of the month (JANu2026DEC).
    $(mon): Used for the Month (01-12).
    $(system): R/3 System name.
    $(wday): Day of the week (00-06, Sunday=00, Monday=01, Tuesday=02 and so on).
    $(yday): Day of the current year (001-366). Using the number any day of the year can be chosen.
    $(year): Year (Example:1998 or 1999).
    $(syear): Short form of the year (two positions).
    $(yweek): Calendar week (00-53). The first week begins with the first Sunday of the year.
    For the database connection:
    The transport environment also needs parameters to connect to the R/3 System database. As we know already the every instance in the R/3 CTS pipeline has its own database, therefore specific parameters should be defined for each database system. From dbtype parameter of RSPARAM file, TP program identifies the database system.
    The two parameters u201Cdbnameu201D and u201Cdbhostu201D are required for ORACLE databases.
    DBHOST: is the name of the computer on which the database processes execute. TCP/IP name of the host if NT is being used.
    DBNAME: is the name of the database instance.
    As of Release 3.0E, two new parameters have been introduced.
    DBLOGICALNAME: The default value is $(system). The logical name that was used to install the database.
    DBCONFPATH: The default value is $(transdir).
    The parameters u201Cdbnameu201D and u201Cdbhostu201D are also used for INFORMIX databases in an installation:
    DBHOST: Same as Oracle.
    DBNAME: Name of the database instance, uppercase and lowercase are distinguished here.
    INFORMIXDIR : u201C/informix/<SAPSID>u201D is the default value. Defines the directory namewhere the database software can be found.
    INFORMIXSQLHOSTS: u201C$(informixdir)/etc/sqlhosts[.tli|.soc]u201Cis default value under Unix. The name of the SQLhosts file with its complete path is defined with this parameter.
    INFORMIX_SERVER: u201C$(dbhost)$(dbname)shmu201D is the default value. The name of the database server may be specified for a local connect.
    INFORMIX_SERVERALIAS: u201C$(dbhost)$(dbname)tcpu201Dis the default vlue. The name of the database server can be specified for a remote connect.
    For Microsoft SQL Server database the two parameters u201Cdbnameu201D and u201Cdbhostu201D are also required. DBHOST: The TCP/IP name of the host on which the database is running.
    DBNAME: The database instance name.
    For DB2 in AS/400 only u201Cdbhostu201D is required.
    DBHOST: System name of the host on which the database is running.
    If theu201DOptiConnectu201D is used, the following line should be specified:
    OPTICONNECT 1
    For DB2/ AIX
    The two parameters u201Cdbnameu201D and u201Cdbhostu201D are required
    DBHOST: The host on which the database processes are running. It is the TCP/IP name of the host for Windows NT (As we have seen in the earlier examples).
    DBNAME: Database instance name.
    The DB2 for AIX Client Application Enabler Software must also be installed on the host on which tp is running.
    ALLLOG: u201CALOGu201D $(syear) $(yweek)u201Dis the default value. This variable can be used in TPPARAM file to specify the name of a file in which tp stores information about every transport step carried out for a change request anywhere in the transport process. The file always resides in the log directory.
    SYSLOG: u201CSLOG $(syear) $(yweek).$(system)u201D is the default value. This variable can be used to name a file in which tp stores information about the progress of import actions in a certain R/3 System. The file does not store information for any particular change request. The file always resides in the log directory.
    tp_VERSION: Zero is the default value. If this parameter is set to not equal to zero, a lower version of tp may not work with this TPPARAM file. If the default value (zero) is set, the parameter has no affect.
    STOPONERROR: (Numeric value) The default value is 9. When STOPONERROR is set to zero, tp is never stopped in the middle of an u201Cimportu201D or u201Cputu201D call. When STOPONERROR is set to a value greater than zero, tp stops as soon as a change request generates a return code that is equal to or greater than this value (The numeric value of the STOPONERROR parameter is stored in the variable BADRC). Change requests, which still have to be processed for the current step, are first completed. A u201CSYNCMARKu201D in the buffer of the R/3 System involved, sets a limit here. tp divides the value of this parameter between two internal variables. STOPONERROR itself is treated as a boolean variable that determines whether tp should be stopped, if the return code is too high.
    REPEATONERROR (Numeric value too): The default value is 9. The REPEATONERROR parameter is similar to STOPONERROR. The difference is, REPEATONERROR specifies the return code up to which a change request is considered to be successfully processed. Return codes less than REPEATONERROR are accepted as u201Cin Orderu201D. Change requests that were not processed successfully stay in the buffer.
    NEW_SAPNAMES: Default value is u201CFALSEu201D. A file is created for each user of the R/3 System group in the u201Csapnamesu201D subdirectory of the transport directory. Except some of the operating system,the name of the user is the name of the file. It is very important to remember hat the special characters or length of the file name could cause problems. If all the R/3 Systems in the transport group have at least Release level 3.0.; TP program is efficient to handle this problem. The user names are modified to create file names that are valid in all operating systems and the real user names are stored in a corresponding file.
    Though we have seen so many parameters, for the minimum configuration the following two parameters are very important.
    TRANSDIR: specifies the name of the common transport directory. The following is a typical example from TPPARAM of Unix as we have seen before.
    transdir = /usr/sap/trans/
    DBHOST: contains the name of the database host. In Windows NT environment, this is the TCP/IP host name. The following is an example in Unix:
    DEV/dbname = DEV
    DEV/dbhost = sap9f
    DEV/r3transpath = /usr/sap/DEV/SYS/exe/run/R3trans
    For TP, to control u2018Start and Stopu2019 command files and database in R/3 the following important parameters are specified in TPPARAM:
    Parameters for the tp Function u201CPUTu201D: LOCK_EU (boolean) default value is u201CTRUEu201D. Though from version 3.1 onward the tp put command is used seldom in cts process still it is important to know how this parameter works. When u201Ctp putu201D is used, it changes the system change option . If the parameter is set to u201CFALSEu201D nothing gets changed. If the parameter is set to u201CTRUEu201D, the system change option is set to u201CObjects cannot be changedu201D at the beginning of the call, and gets changed back to its previous value at the end of the call. The u201Ctp putu201D command will give the exact status of the locking mechanism.
    LOCKUSER (used as boolean value): Default value is u201CTRUEu201D. This parameter is about the user login while tp put call is executed. If this parameter is set to u201CFALSEu201D, no locking mechanism for the users takes affect. If this parameter is defined as u201CTRUEu201D then a character is set in the database level; so only DDIC and SAP* can log on to the system. Users that have already logged on are not affected (this is a reason for activating the parameters STARTSAP and STOPSAP). The charactertor is removed at the end of the call, and all the users can log on to the SAP R/3 System again.
    STARTSAP: Default value is u201D u201C.or u201CPROMPTu201D for Windows NT . This parameter is used by TP to start an R/3 System. It is not necessary for the clients to make tp start and stop R/3 system..
    STOPSAP: Default value is u201D u201Cor u201CPROMPTu201D for Windows NT. TP uses this parameter to stop an R/3 System.
    STARTDB: Default value is u201D u201C. TP uses the value of this parameter to start the database of an R/3 System.
    The parameter is not active under Windows NT.
    STOPDB: Default value is u201D u201C. TP uses the value of this parameter to stop the database of an R/3 System.
    This parameter is not active under Windows NT.
    The above parameters in UNIX can be used as following:
    STARTSAP = startsap R3
    STOPSAP = stopsap R3
    STARTDB = startsap db
    STOPDB = stopsap db
    In Windows NT:
    STARTSAP =
    $(SAPGLOBALHOST)\sapmnt\$(system)\sys\exe\run\startsap.exe
    R3 <SID> <HOST NAME> <START PROFILE>
    STOPSAP =
    $(SAPGLOBALHOST)\sapmnt\$(system)\sys\exe\run\stopsap.exe
    R3 <SID> <HOST NAME> <INSTANCE> <PROFILE PATH + Instance profile>
    The parameters STARTDB and STOPDB are not active under Windows NT.
    Parameters for the tp function u201CCLEAROLDu201D
    DATALIFETIME (Numeric): Default value is u201C200u2033. When the data file has reached a minimum age, it is moved to the subdirectory old data with tp check. tp clearold all. The life span of the data files in the data sub directory can be set in days with this all, parameter.
    OLDDATALIFETIME (Numeric): Default value is u201C365u2033. When a file located in the olddata subdirectory is no longer needed for further actions of the transport system and has reached a minimum age, it is removed with tp check.all, tp clearold all. The minimum age in days can be set with this parameter.
    COFILELIFETIME (Numeric): Default value is u201C365u2033. This parameter is used just like DATALIFETIME parameter.
    LOGLIFETIME (Numeric): Default value is u201C200u2033. This parameter applies to the life span of the log files. When the log files in log subdirectory is no longer needed for the transport system and has reached a minimum age, it is deleted with the calls tp check.all, tp clearold all. The minimum age in days can be defined with this parameter.
    The Three Key Utilities of the CTS system (TP, R3trans and R3chop):
    TP: Earlier in this chapter we have seen the objectives of TP. The TP transport control program is a utility program that helps the user to transport objects from one system to another. TP program is the front-end for the utility R3trans. TP stands for u201CTransports and Putsu201D. To make the TP work successfully the CTS system needs to be correctly configured. The following steps are very important for TP to run properly.
    The transport directory /usr/sap/trans must be installed and NFS mounted to all the systems in the CTS pipe line.
    RDDIMPDP program must be running (event driven is recommended) in each client. RDDIMPDP can be scheduled in the background by executing RDDNEWPP or RDDPUTPP. Use the tp checkimpdp <sap sid> command in /usr/sap/trans/bin directory as <sid>adm user to check RDDIMPDP program.
    Use the tp connect <sap sid> command in /usr/sap/trans/bin directory to see whether the tp program is connecting to the database successfully or not. To run TP command the user has to logon as <sid>adm in source or target system.
    The R/3 Systems in the CTS pipeline must have different names.
    The Global CTS Parameter File TPPARAM must be correctly configured.
    The source system (for the export) and target system ( for the import) must have at least two background work processes. TP always schedules the C class job, so if all the background jobs are defined as A class job then there will be problems in transport steps.
    Important Tips :.It is always better to have the up to date TP version installed in your system. A user can ftp a current version of TP from SAPSERV4 of SAP. Though R3trans and other utility programs can be used to do the transport, it is recommended to use TP whenever possible for the following reasons..
    The exports and imports are done separately using TP program. For example: when a transport is released from the system, the objects are exported from the source database to the operating system and then the import phase starts to transport those objects to the target system.
    TP takes care of the order of the objects. The order, that was followed to export the objects; the same order will be followed to import them to the target database.
    The TP command processes all change requests or transports in the SAP system buffer that have not yet been imported successfully. All the import steps are executed automatically after TP calls R3trans program to execute the following necessary steps:
    Dictionary Import: ABAP/4 dictionary objects will be imported in this step.
    Dictionary Activation: Name tabs or runtime descriptions will be written inactively. The R/3 system keeps running until the activation phase is complete. The enqueue modules are the exceptions in the running phase. After the activation of new dictionary structure the new actions are decided to get the runtime objects to the target system.
    Structure conversion: If necessary the table structure is changed in this phase.
    Move Nametabs: The new ABAP/4 Dictionary runtime objects which were inactive up to now are moved into the active runtime environment in this process. The database structures are adjusted accordingly. From the first step to the Main import step inconsistencies can occur to the R/3 system. After the main import phase all the inconsistency ca be solved.
    Main import with R3trans: All the data are imported completely and the system comes to a consistent state.
    Activation of enqueue-objects: The enqueue-objects cannot be activated in the same way as the objects of the ABAP/4 Dictionary, so they have to be activated after the main import in this step. They are then used directly in the running system.
    Structure Conversion of match codes, Import application defined objects, versioning and execution of user defined activities are some of the steps after activation of enqueue-objects. The next step is generation of ABAP/4 programs and screens, where all the programs and screens associated with the change request are generated. When all the import steps are completed successfully, the transport request is removed from the import buffer.
    It is recommended by SAP to schedule regular periods for imports into the target system (e.g. daily, weekly or monthly). Shorter periods between imports are not advisable. The transport to production should not be done in the off hours when the users are not working
    TP can be started with different parameters. The u201Ctp helpu201D command can help user to generate a short description about the use of the command.
    The following are the some important commands of TP:
    For export:
    tp export <change request>: The complete objects in the request from the source system will be transported. This command also used by SAP System when it releases a request.
    tp r3e <change request>: R3trans export of one transport request.
    tp sde <change request>: Application defined objects in one transport request can be exported.
    tp tst <change request> <SAP system >: The test import for transport request can be done using this command.
    tp createinfo <change request>: This command creates a information file that is automatically done during the export.
    tp verse <request>: This command creates version creates versions of the objects in the specified request.
    To Check the transport buffer, global parameter file and change requests:
    tp showbuffer <sid>: Shows all the change requests ready to be imported to the target system.
    tp count <sid>: Using this command users can find out the number of requests in the buffer waiting for import.
    tp go <sid>: This command shows the environment variables needed for the connection to the database of the <sid> or target system.
    tp showparams <sid>: All the values of modifiable tp parameters in the global parameter file. The default value is shown for parameters that have not been set explicitly.
    To import the change requests or transports:
    tp addtobuffer <request>.<sid>: If a change request is not in the buffer then this command is used to add it to the buffer, before the import step starts.
    tp import all <sid>: This command imports all the change requests from the buffer to the target system.
    tp put <sid>: The objective of this command is same as u201Ctp import all <sid>u201D, but this command locks the system. This command also starts and stops the SAP system, if the parameters startsap and stopsap parameters are not set to u201D u201C.
    tp import <change request> <sid>: To import a single request from the source system to target system.
    tp r3h <change request>| all <sid>: Using this command user can import the dictionary structures of one transport or all the transport from the buffer.
    tp act <change request>|all <sid>: This command activates all the dictionary objects in the change request.
    tp r3i <change request> | all <sid>: This command imports everything but dictionary structures of one.
    tp sdi <change request>|all <sid>: Import application-defined objects.
    tp gen <change request>|all <sid>: Screen and reports are generated using this command.
    tp mvntabs <sid>: All inactive nametabs will be activated with this command.
    tp mea <change request>|all <sid>: This command will activate the enqueue modules in the change request.
    When you call this command, note the resulting changes to the import sequence.
    Additional tp utility options:
    tp check <sid>|all (data|cofiles|log|sapnames|verbose): User uses this command to find all the files in the transport directory that are not waiting for imports and they have exceeded the minimum time specified using the COFILELIFETIME, LOGFILELIFETIME, OLDDATALIFETIME and DATALIFETIME parameters of TPPARAM file.
    tp delfrombuffer <request>.<sid>: This command removes a single change request from the buffer. In case of TMS, the request will be deleted from the import queue.
    tp setstopmark <sid>: A flag is set to the list of requests ready for import into the target system. When the user uses the command tp import all <sapsid> and tp put <sapsid>, the requests in front of this mark are only processed. After all the requests in front of the mark have been imported successfully, the mark is deleted.
    tp delstopmark <sid>: This command deletes the stop mark from the buffer if it exists.
    tp cleanbuffer <sapsid>: Removes all the change requests from the buffer that are ready for the import into the target system.
    tp locksys <sid>: This command locks the system for all the users except SAP* and DDIC. The users that have already logged on are not affected by the call.
    tp unlocksys <sid>: This command unlocks the system for all the users.
    tp lock_eu <sid>: This command sets the system change option to u201Csystem can not be changedu201D tmporarily.
    tp unlock_eu <sid>: This command unlocks the system for all the changes.
    tp backupall <sid>: This command starts a complete backup using R3trans command. It uses /usr/sap/trans/backup directory for the backup.
    tp backup delta <sid>: Uses R3trans for a delta backup into /usr/sap/trans/backup directory.
    tp sapstart <sid>: To start the R/3 system.
    tp stopsap <sid>: To stop the R/3 system.
    tp dbstart <sid>: To start the database.
    tp dbstop <sid>: To stop the database.
    Unconditional modes for TP: Unconditional modes are used with the TP program and these modes are intended for the special actions needed in the transport steps. Using unconditional mode user can manipulate the rules defined by the workbench organizer. The unconditional mode should be used when needed, otherwise it might create problems for the R/3 system database. Unconditional mode is used after the letter u201CUu201D in the TP command. Unconditional mode can be a digit between 0 to 9 and each has a meaning to it. The following is a example of a import having unconditional mode.
    tp import devk903456 qas client100 U12468
    0: Called a overtaker; change request can be imported from buffer without deleting it and then uncoditional mode 1 is used to allow another import in the correct location.
    1: If U1 is used with the export then it ignores the correct status of the command file; and if it is used with import then it lets the user import the same change request again.
    2: When used with tp export, it dictates the program to not to expand the selection with TRDIR brackets. If used in tp import phase, it overwrites the originals.
    3: When used with tp import, it overwrites the system-dependant objects.
    5: During the import to the consolidation system it permits the source systems other than the integration system.
    6: When used in import phase, it helps to overwrite objects in unconfirmed repairs.
    8: During import phase it ignores the limitations caused by the table classification.
    9: During import it ignores that the system is locked for this kind of transport.
    R3trans: TP uses R3trans program to transport data from one system to another in the CTS pipeline. efficient basis administrator can use R3trans directly to export and import data from and into any SAP systems. Using this utility transport between different database and operating system can e done without any problems. Different versions of R3trans are fully compatible with each other and can be used for export and import. The basis administrator has to be careful using R3trans for different release levels of R/3 software; logical inconsistency might occur if the up to date R3trans is not used for the current version of R/3 system.
    The syntax for using the control file is following:
    R3trans [<options>] <control file> (several options used at the same time; at least one option must be there)
    For example: R3trans u2013u 1 u2013w test.log test
    In the above example a unconditional mode is used, a log file u201Ctest.logu201D file is used to get the log result and a control file u201Ctestu201D, where the instructions are given for the R3trans to follow. The user needs to logon as <sid>adm to execute R3trans.
    The following options are available for the R3trans program:
    R3trans -d : This command is used to check the database connection .
    R3trans -u <int>: Unconditional mode can be used as we have seen in the above example.
    R3trans -v : This is used for verbose mode. It writes additional details to the log file
    R3trans -i <file>: This command directly imports data from data file without a control file.
    R3trans -l <file>: This provides output of a table of contents to the log file.
    R3trans -n : This option provides a brief information about new features of R3trans.
    R3trans u2013t: This option is used for the test mode. All modifications in the database are rolled back.
    R3trans -c <f1> [<f2>]: This command is used for conversion. The <f1> file will be copied to <f2> file after executing a character set conversion to the local character set.
    Important tips: Do not confuse the backup taken using R3trans with database backup. The backups taken using R3trans are logical backups of objects. In case something happens to the SAP system these backups can not be used for recovery. R3trans backups can be only used to restore a copy of a particular object that has been damaged or lost by the user.
    R3trans -w <file>: As we have seen in the above example this option can be used to write to a log file. If no file is mentioned then trans.log is default directory for the log.
    R3trans also can be used for the database backup.
    R3trans u2013ba: This command is used for a complete backup. we will see in the next paragraph how to use
    the control file for the backup.
    R3trans u2013bd: This command is used for a delta backup if the user does not want a complete backup.
    R3trans u2013bi: This option will display backup information.
    The following are some of the examples of control files:
    We have already learned how to use a command for the logical backup of the objects in the database. To get a complete backup the following example control file can be used.
    backup all
    file = /usr/sap/trans/backall
    The option u201Cfile = u2026u201D is the name of the directory into which the data files are to be written. If you are taking a complete backup of DEV system then the backup file is going to look like u201CDEV.A000.bcku201D the next complete
    Reward if useful
    Regards
    divya

  • How do i get itunes or any other program for ipod to play one song and then stop instead of contiuing playing. I need it to be in the same playlist and ready to play the next song when I press play?

    how do i get itunes or any other program for ipod to play one song and then stop instead of contiuing playing. I need it to be in the same playlist and ready to play the next song when I press play?

    Good luck.  I tried to do this to cue sound effects for a theater, and never found anything.  iTunes will definitely *not* do this, nor was I able to find any player that would play one song at a time in a single playlist. 
    In my case, I ended up using AutoHotkey to tie individual tracks to the keys on an external keypad. This was an excellent solution for my problem, but I don't think AHK runs on Macs.
    One workaround is to make a folder, and fill it with *shortcuts* to the songs you want (ie, the actual files).  You can change the names to start with numbers to get them in the right order.  Then if you double-click on one it will play just that song.  You'll still have to double-click on each song.
    Might be a good time to learn AppleScript   It would  also be pretty easy to write a Java app to do this.

  • Hi when i use treeMap class and if i exit the program

    hi
    hi when i use treeMap class and if i exit the program,
    what will happen? the information that i put in the treeMap will be disappear??
    if it is like that,,how am i able to retrieve my data...when i restart my program..
    once i put ID as key and put my customer information,
    in it, after exit my program,, and i can't find
    my customers by their ID,,,,,,,,,how can,,i solve it......

    what will happen? the information that i put in the
    treeMap will be disappear??Yes. Of course. If you want data to hang around you have to tell the computer. If you want anything to happen you have to tell the computer.
    if it is like that,,how am i able to retrieve my
    data...when i restart my program..Tada! Tell the computer. Your simplest option is to use Serialization.
    Before exiting your program, serialize your TreeMap to disk. After starting your program serialize your TreeMap from disk.
    First stop should be your text book to learn what Serialization is and how it works, then try to write some code, then ask us to help with any problems.
    Dave.

  • How to create Package( development class) and how to assign the program

    Hi,
    Can any body give me the steps to create the package (developement class) and also please give me the steps to assign the local object ( program) to that development class.
    thanks in advance
    KP

    Hi,
       This document will help you to create package and move local package name to your package.
    Package  Creation:
    1.T-code=SE80.
    2. give the option 'PACKAGE' in text field, give 'PACKAGE NAME' then enter.
    3. The next screen will open in that screen you shoul give short text and Software Component-'HOME'.  then enter.
    4. Next screen will open here you should give create request then next page will open
    5.In the next page give short description this is your package identification,then click 'SAVE ' button now one  unique number will open then give 'YES' button, now your package is created.
    HOW TO MOVE LOCAL PACKAGE DATA TO YOUR PACKAGE
    1.IN  the same screen you should give program option, then open your local program ,
    2.'WRITE  CLICK YOUR PROGRAM NAME', then give 'COPY' option
    3.Next window will open here you should give 'TARGET PROGRAM NAME'.
    4. THEN you should give you 'PACKAGE NAME'.
    now you can store local package program's to your package.
    IF HELPFULL GIVE REWARD POINTS

  • My daughter is a college student. she needs to write and compile c programs on her mac for a class this semester. what is the best place for her to start to get the correct compiler etc. to use ? thanks

    my daughter is a college student. she needs to write and compile c programs on her mac for a class this semester. what is the best place for her to start to get the correct compiler etc. to use ? thanks

    If you know that you will not be asked to design GUI interfaces, and the C programming course will adhere to command line compilation environments, then get the Xcode command-line developer tools, and skip the extra complication of Xcode until you absolutely need it. Apple has kicked GNU C to the curb and is rightly so, using Clang/LLVM compiler technology.
    Sign up for a free Apple Developer account using your Apple ID, and then visit the Mac Dev Center, and towards the bottom of the page, you will see additional downloads. Click on the associated, all down loads link. Know your OS X version beforehand, as the command-line tool releases are tied to general operating system versions, and the most recent Xcode version.  That said, there are currently two March 9, 2015 command-line tools for Xcode 6.2 — one for OS X 10.9 Mavericks, and the other for OS X Yosemite.

  • Problem with 1.5 Scanner class

    I'm trying to learn to use the new Scanner class in Java 1.5. I wrote this little program:
    import java.util.*;
    public class Howdy {
      public static void main(String[] args) {
        Scanner reader = Scanner.create(System.in);
        String name = reader.readLine();
        System.out.println("Hello, " + name);
    }When I try to compile it, I get these complaints:
    Howdy.java:5: cannot find symbol
    symbol  : method create(java.io.InputStream)
    location: class java.util.Scanner
        Scanner reader = Scanner.create(System.in);
                                ^
    Howdy.java:6: cannot find symbol
    symbol  : method readLine()
    location: class java.util.Scanner
        String name = reader.readLine();
                            ^
    2 errorsI know I have the 1.5 goodies turned on, because I can (for example) use the enhanced for loop.
    What's the problem?

    Can someone tell me what I'm doing wrong here.....I have a input file that has 7 rows and 10 columns. I posted the error I'm getting below. Thanks.
    import java.util.Scanner;
    import java.io.File;
    import java.io.IOException;
    public class windChill
    public static void main(String[] args) throws IOException
    File inputFile = new File("input.txt");
    Scanner fscan = new Scanner ( inputFile );
    Scanner lscan;
    lscan = new Scanner(fscan.nextLine());
    int [][] chill = new int [7][10];
    for (int i = 0;i < 7; i++)
    for (int j = 0;j < 10; j++)
    chill[i][j] = lscan.nextInt();
    lscan = new Scanner(fscan.nextLine());
    System.out.println(chill[1][9]);          
    ----jGRASP exec: java windChill
    Exception in thread "main" java.util.NoSuchElementException: No line found
         at java.util.Scanner.nextLine(Unknown Source)
         at windChill.main(windChill.java:37)
    ----jGRASP wedge2: exit code for process is 1.
    ----jGRASP: operation complete.

  • Help with using Scanner Class

    Hi there - I'm a newbie to Java and may have posted this in the wrong forum previously.
    I am trying to modify a program so instead of using a BufferReader, a scanner class will be used. It is basically a program to read in a name and then display the variable in a line of text.
    Being new to Java and a weak programmer, I am getting in a mess with this and missing something somewhere. I don't think I'm using scanner in the correct way.
    Any help or pointers would be good. There are 2 programs of code being used. 'Sample' and 'Run Sample'
    Thanks in advance.
    Firstly, this program will run named 'Sample'
    <code>
    * Sample.java
    * Class description and usage here.
    * Created on 15 October 2006
    package internetics;
    * @author John
    * @version 1.2
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    // import com.ralph.*;
    public class Sample extends JFrame
    implements java.awt.event.ActionListener{
    private JButton jButton1; // this button is for pressing
    private JLabel jLabel1;
    private String name;
    /** Creates new object ChooseFile */
    public Sample() {
    initComponents();
    name = "";
    selectInput();
    public Sample(String name) {
    this();
    this.name = name;
    private void initComponents() {
    Color bright = Color.red;
    jButton1 = new JButton();
    jLabel1= new JLabel();
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent evt) {
    exitForm(evt);
    getContentPane().setLayout(new java.awt.GridLayout(2, 1));
    jButton1.setBackground(Color.white);
    jButton1.setFont(new Font("Verdana", 1, 12));
    jButton1.setForeground(bright);
    jButton1.setText("Click Me!");
    jButton1.addActionListener(this);
    jLabel1.setFont(new Font("Verdana", 1, 18));
    jLabel1.setText("05975575");
    jLabel1.setOpaque(true);
    getContentPane().add(jButton1);
    getContentPane().add(jLabel1);
    pack();
    public void actionPerformed(ActionEvent evt) {
    System.out.print("Talk to me " name " : ");
    try {
    jLabel1.setText(input.readLine());
    } catch (IOException ioe) {
    jLabel1.setText("Ow! You pushed my button");
    System.err.println("IO Error: " + ioe);
    /** Exit this Application */
    private void exitForm(WindowEvent evt) {
    System.exit(0);
    /** Initialise and Scan input Stream */
    private void selectInput() {
    input = new Scanner(new InputStreamReader(System.in));
    /**int i = sc.nextInt(); */
    /** Getter for name prompt */
    public String getName() {
    return name;
    /** Setter for name prompt */
    public void setName(String name) {
    this.name = name;
    * @param args the command line arguments
    public static void main(String args[]) {
    new Sample("John").show();
    </code>
    and this is the second program called 'RunSample will run.
    <code>
    class RunSample {
    public static void main(String args[]) {
    new internetics.Sample("John").show();
    </code>

    The compiler I'm using is showing errors in these areas of the code. I've read the tutorials and still can't get it. They syntax for the scanner must be in the wrong format??
    the input.readLine appears incorrect below.
      public void actionPerformed(ActionEvent evt) {
        System.out.print("Talk to me " +name+ " : ");
        try {
            jLabel1.setText(input.readLine());
        } catch (IOException ioe) {
          jLabel1.setText("Ow! You pushed my button");
          System.err.println("IO Error: " + ioe);
        }and also here...
    the input is showing errors
      /** Initialise and Scan input Stream */
      private void selectInput() {
        input = new Scanner(new InputStreamReader(System.in));
       /**int i = sc.nextInt(); */
      }Thanks

  • Help using scanner.class someone help me

    ive been working on some code and the thing is i am stuck on how do i count the number of intergers between 1 and 5. for example lets say i inputted using a scanner.class 1,2,2,3,3,3 i want my program to then say how many 2's I have entered and and how many 3's i have entered. So basically if using a scanner.class (keyboard class) in java instead of hardwiring the numbers into an array how do i count out the number of intergers and display them in my output

    hardwiring the numbers into an array how do i count
    out the number of intergers and display them in my
    outputTry this.
            Scanner sc = new Scanner(System.in);
            System.out.println("Enter numbers:");
            int i = 0;
            int count = 0;
            Map <Integer, Integer> intMap = new TreeMap <Integer, Integer>();
            while( true ) {
                i = sc.nextInt();
                if(i < 0 || i > 5) break;
                // Code to count the numbers entered.
                if(intMap.containsKey(new Integer(i))) {
                    count = intMap.get(new Integer(i)).intValue();
                    count++;
                } else {
                    count = 1;
                intMap.put(new Integer(i), new Integer(count));
            System.out.println(intMap);At forum users: Pardon me for all my variable names and poor coding style and lack of comments and...

  • HELP, date class and parsing input

    I have reviewed many posts in these forums and have found that detail gets the best results so I apologize in advance if this is detailed. I am taking a Java class and am not doing so hot. The last time I programmed was in 1998 and that was Ada, I very soon moved to Networking. I guess those that can't program become networkers, I don't know, but I am frustrated here.
    Any how I am trying to write a rather simple program, but it is the manipulation of the date I am having difficulty with. Here are the requirements:
    Overall Requirements
    Create a class named Date that stores date values and prints out the date in either a pure numeric format or a name and number format (see sample session for format details).
    Date.java class file
    ? Date objects should store the date in two int instance variables &#9472; day and month, and it should include the String instance variable, error, initialized with null.
    Implement a 1-parameter Date constructor that receives a dateStr string parameter and performs complete error checking on the given dateStr value. The Date constructor is the entity that?s responsible for date error checking. That way, if a Date object is instantiated and if there are no errors, then you?re guaranteed that the Date object holds a legitimate date value. If any kind of error occurs, change the value of the error instance variable to a non-null string value, using an appropriate concatenation of a string constant, input substring, and/or API exception message.
    Constructors use the same exception handling rules as methods: In a try block, include the parsing of the month and day substrings and other error-checking logic that will not work if parsing fails.
    ? Take into account the actual number of days in each month, but assume that there are always 28 days in February.
    ? To extract day and month numbers from the given date string, use String?s indexOf method to find the location of the slash character, and String?s substring method to extract month and day substrings from the input string.
    ? Include a method for printing the date with a numeric format. Use the zero-pad flag in a printf method call to get exactly two digits for each month and day.
    ? Include a method for printing the date with an alphabetic format.
    Include a getError method which returns the value of the error instance variable.
    DateDriver.java class file : In your driver class, include a loop that repeatedly:
    ? Asks the user to enter a date or ?q? to quit. ? If the entry is not ?q?, instantiate a Date object.
    ? If the error variable is null: o Print the date using numeric format.o Print the date using alphabetic format. Otherwise, print the value of the error variable.
    I want to figure this out on my own as much as possible but have until tomorrow night to do so..............I need to understand how I can use Strings indexOf to parse the dateStr so I can locate the /. I see I can use it to find the position of a specified character, but I am not sure of the syntax I need to use. But then once I find the / I need to use the String's substring method to extract month and day. I think I might be able to get that, if I can get the / figured out.
    The below is what I have in my Class and my Driver so far:
    *DateDriver.java (driver program)
    * Christine Miller-Lane
    *Overall Requirements
    *Create a class named Date that stores date values and prints out the date in either a pure numeric
    format or a name and number
    *format (see sample session for format details).
    *DateDriver.java class file
    *In your driver class,
    *????????? If the error variable is null:
    *     &#9702;     Otherwise, print the value of the error variable.
    import java.util.*;
    public class DateDriver
    Date datevalue;
    public static void main(String[] args)
         Scanner stdIn = new Scanner(System.in);
         while (!xStr.equalsIgnoreCase("q"))
         try
              System.out.println("Enter a date in the form mm/dd ("q" to quit): ";
              value = stdIn.nextLine();
              datevalue = new Date(value);                                                        //instaniate the date object
              System.out.println //print date in numeric format
              System.out.println //print date in alphabetic format
              break;
              catch
              System.out.println("print value of error variable.");
              stdIn.next(); // Invalid input is still in the buffer so flush it.
         } //endloop
         }//end main
    } //end class?
    * Date.java
    * Christine Miller-Lane
    *Overall Requirements
    *Create a class named Date that stores date values and prints out the date in either a pure numeric format or a name
    *and number format (see sample session for format details).
    *Date.java class file
    *????????? Date objects should store the date in two int instance variables &#9472; day and month, and it should include
    *the String instance variable, error, initialized with null.
    *     ?     Implement a 1-parameter Date constructor that receives a dateStr string parameter and performs complete
    *     error checking on the given dateStr value. The Date constructor is the entity that?s responsible for date error
    *     checking. That way, if a Date object is instantiated and if there are no errors, then you?re guaranteed that the
    *     Date object holds a legitimate date value. If any kind of error occurs, change the value of the error instance
    *     variable to a non-null string value, using an appropriate concatenation of a string constant, input substring,
    *     and/or API exception message.?
    *     ?     Constructors use the same exception handling rules as methods: In a try block, include the parsing of the
    *     month and day substrings and other error-checking logic that will not work if parsing fails.
    *????????? Take into account the actual number of days in each month, but assume that there are always 28 days in February.
    *????????? To extract day and month numbers from the given date string, use String?s indexOf method to find the
    *location of the slash character, and String?s substring method to extract month and day substrings from the input string.
    import java.util.*;
    public class Date
         Scanner stdIn = new Scanner(System.in);
         boolean valid = false
         int day;
         int month;
         String error = null;
         String dayStr;
         String monthStr;
         String dateStr;
         public Date(String dateStr)
    // Look for the slash and set appropriate error if one isn't found. use String?s indexOf method to find the
    //location of the slash character and String?s substring method to extract month and day substrings from the input string.
    // Convert month portion to integer. Catch exceptions and set appropriate error if there are any.
    Integer.parseInt(dateStr);
    // Validate month is in range and set appropriate error if it isn't.
    // Convert day portion to integer. Catch exceptions and set appropriate error if there are any.
    // Validate day is in range based on the month (different days per month) and set appropriate error if it isn't.
    //public void printDate()      //Include a method for printing the date with a numeric format. Use the zero-pad flag in a printf method
                                       //call to get exactly two digits for each month and day.
    //{                                   //Include a method for printing the date with an alphabetic format.      
    //     } // end print report
    //     public getError()
                                  //Include a getError method which returns the value of the error instance variable.
    }//end class Date
    Here is sample out put needed::::::::
    Sample Session:
    Enter a date in the form mm/dd ("q" to quit): 5/2
    05/02
    May 2
    Enter a date in the form mm/dd ("q" to quit): 05/02
    05/02
    May 2
    Enter a date in the form mm/dd ("q" to quit): 52
    Invalid date format ? 52
    Enter a date in the form mm/dd ("q" to quit): 5.0/2
    Invalid format - For input string: "5.0"
    Enter a date in the form mm/dd ("q" to quit): 13/2
    Invalid month ? 13
    Enter a date in the form mm/dd ("q" to quit): 2/x
    Invalid format - For input string: "x"
    Enter a date in the form mm/dd ("q" to quit): 2/30
    Invalid day ? 30
    Enter a date in the form mm/dd ("q" to quit): 2/28
    02/28
    February 28
    Enter a date in the form mm/dd ("q" to quit): q
    I am trying to attack this ONE STEP at a time, even though I only have until Sunday at midnight. I will leave this post and get some rest, then attack it again in the morning.
    Edited by: stillTrying on Jul 12, 2008 8:33 PM

    Christine,
    You'r doing well so far... I like your "top down" approach. Rough out the classes, define ALL the methods, especially the public one... but just sketch out the requirements and/or implementation with a few comments. You'll do well.
    (IMHO) The specified design is pretty crappy, especially the Exception handling
    [The Constructor] performs complete error checking on the given dateStr value. The Date constructor is the entity that?s responsible for date error checking. That way, if a Date object is instantiated and if there are no errors, then you?re guaranteed that the Date object holds a legitimate date value. If any kind of error occurs, change the value of the error instance variable to a non-null string value, using an appropriate concatenation of a string constant, input substring, and/or API exception message.Please allow me to shred this hubris piece by piece.
    [The Constructor] performs complete error checking on the given dateStr value. The Date constructor is the entity that?s responsible for date error checking.Umm... Well I suppose it could... but NO, the constructor should delegate such "complex validation" to a dedicated validate (or maybe isValid) method... which might even be made publicly available... it's a good design.
    That way, if a Date object is instantiated and if there are no errors, then you?re guaranteed that the Date object holds a legitimate date value. If any kind of error occurs, change the value of the error instance variable to a non-null string value ...Utter Bollocks! When passed an invalid input string the, Date constructor should throw an InvalidDataException (or similar). It should not SILENTLY set some dodgy error errorMessage attribute, which is returned later by a "print" method. We tried that in masm, fortran, ada, basic, c, and pascal for twenty odd years. It sucked eggs. And it STILL sucks eggs. Java has a "proper" try/catch exception handling mechanism. Use it.
    I mean, think it through...
      someDate = get a date from the user // user enters invalid date, so someDate is null and errMsg is set.
      report = generateReport() // takes (for the sake of argument) three hours.
      emailReport(someDate, report) // only to fail at the last hurdle with an InvalidDataException!And anyways... such implementation details are traditionally the implementors choice... ie: it's usually between the programmer and there tech-manager (if they're lucky enough to have one).
    Cheers. Keith.

  • UML diagrams and Object Oriented programming

    In a project for CSC120 at school we have to program a casino using java. We were given a UML diagram of how the professor wants it set up, and I am having some difficulty understanding exactly what some of this means, code wise.
    Part of the UML diagram:
    Game
    userMoney: int
    bet: int
    playAgain() : bool
    askBet() : int
    Payout(amt: void) : void
    takeBet(amt:void) : bool
    I understand the first two blocks, but the last one confuses me. I get that these are the different functions the class will use, but what does the text inside the parentheses mean, and the text after the colon? And what would this look like in code? If someone could post a link to an example program it would greatly help, or just post a simple example here.
    Here is what I have so far in the class file:
    * ASCIIcasino.java
    * Version 1.0
    * Alachine
    * Last Modified: 01/19/2006
    public class Game
         int usermoney;
         int bet;
        public boolean playAgain()
        public int askBet ()
             do
                   System.out.println("How much do you wish to bet?");
                   scannergameinput = new Scanner(System.in);
              while(!scannergameinput.hasNextInt());
              bet = scannergameinput.nextInt();
              System.out.print("Your bet: ");
             return bet;
        public void Payout ()
             int amt;
        public boolean takeBet ()
             int amt;
    }Am I doing this correctly so far, or what am I not getting? Thank you for your time.
    Edited to update code.
    Message was edited by:
    Alachine

    playAgain() : bool
    askBet() : int
    Payout(amt: void) : void
    takeBet(amt:void) : boolThese are methods of the "Game" class, and what is inside parentheses are called parameters.
    "void" and "bool" are return types.
    public boolean playAgain()
        }In this code you have specified boolean as a return type, so you need to return a value of type bool.
    As for the void part, you don't need to return anything.
    Code should look like:
    public boolean playAgain()
             return true; //Or return false
    public void Payout ()
             int amt;
        }You need to get :int amt" in the parameters, and since its voide nothing needs to be returned.
    public void Payout (int amt)
        }

  • Nuances of the Scanner Class

    I'm having trouble with the Scanner class... here is a snippet of code from a program I am writing.
    ==========
    1 System.out.print("Enter the name of the new passenger-> ");
    2      String passengerName = scan.nextLine();
    3      System.out.println(passengerName);
    4      
    5      System.out.print("Enter the ticket type (E or F)-> ");
    6      String desiredClassType = scan.nextLine();
    7      System.out.println(desiredClassType);
    8      char desiredClassTypeCode = (desiredClassType.toUpperCase()).charAt(0);
    9      
    10
    11      System.out.print("Enter the desired row-> ");
    12      int desiredRow = scan.nextInt();
    13      System.out.println(desiredRow);
    14      
    15      System.out.print("Enter the desired seat-> ");
    16      String desiredSeat = scan.nextLine();
    17      System.out.println(desiredSeat);
    18      char desiredSeatCode = desiredSeat.charAt(0);
    19      
    20      System.out.print("Smoking or non-smoking (S or N)-> ");
    21      String desiredSmoking = scan.nextLine();
    22      System.out.println(desiredSmoking);
    23      char desiredSmokingCode = (desiredSmoking.toUpperCase()).charAt(0);
    ==========
    The problem is, after the scan.nextInt() on line 12, the user never gets a chance to enter input for the scan.nextLine() on line 16. The program just plows right on through and returns the following error at line 18:
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
    If I change the scan.nextLine() in line 16 to scan.next(), it works alright until the next time I call a scan.nextLine at line 21. Then the same error message appears at line 23. Is there something I'm missing? I can't just change everything to scan.next because some inputs require a string that includes whitespace. However, scan.nextLine keeps giving me these errors...?

    when the program asks you to enter a number, you enter a number and press enter. The nextInt method reads the number but leaves the line feed. Next, the program calls nextLine. What will it return? It will return the 0-length string from where the number ended until the line feed, and removes the line feed from the stream. This is why the user never gets a chance to enter anything: he's already entered what the program was looking for.
    To get rid of the line feed, call nextLine directly after calling nextInt and throw away the return value.
    int desiredRow = scan.nextInt();
    scan.nextLine(); // throw away rest of line

Maybe you are looking for

  • Flex Mobile 4.6 introduces Stage Text - how do you render HTML text with it?

    I have a little chat component in a Flex Mobile app that I just upgraded to SDK 4.6.  The chat component has a text area displaying messages and they are HTML formatted via the following: StyleableTextField(textArea).htmlText += myHTMLText; Worked in

  • My iTunes doesn't have all the icons for categories,how do I get them?

    I have a new iPad with the pre loaded iTunes but along the botto where it should have all the icons such as music videos etc, mine onyhas podcasts, iTunes u and downloads. How do I get the other icons there to download music etc? Please help!

  • Priority query

    hi i have two tables like forderung and anspourch having of columns fordnr, glaeubigernr, fordergnr, extfordnr, erledigtmm 8967 11 0 23/245/60 0 8968 11 0 24/245/60 0 8969 11 0 45/98/700 1 8970 11 0 23/56/71 1 the second table is like fordnr, glaeubi

  • Fade a title in Premiere Pro CS3

    How can I fade a title in/or/out in Premiere Pro CS3???

  • PO reference details

    HI, I need to know the db table from where the PO reference details are getting populated in MIR4 transaction for invoice documents. Also from which table I shall get the information such as basic data, payment for the same invoice. Thanks in advance