RuleEngine.invokeRuleset(projectName, rsName, input) returns NoSuchRuleExce

Hi,
I am referring the following blog to use implement one BRM scenario.
/people/julius.h/blog/2008/10/06/brm-integration-in-bpm-java-class
The issue is that the invokeRuleset method of ruleEngine returns an runtime exception NoSuchRuleException- "Error in fact.eval"
Thanks,
Chitrali

Hello Chitrali,
From the error message it seems to me that rules engine is unable to refer to the ruleset name provided to it. One reason for this may be that there was some internal problem in the deployment of your rules project. Can you deploy the rules project again and let me know if you still get this problem?
Thanks and Regards,
Arti
P.S - Please do keep in mind that the engine is case sensitive.

Similar Messages

  • Need right value to Load/Read Velocity Using Input/Return Vectors

    I have a servo motor with a encoder feedback of ( 4,000 counts per revolution ), maximum velocity of 6,000 rpm ( 100 rps ). I need to create 3 moving profiles with stroke time of 0.25 mm/sec, 1.0 mm/sec, and 25 mm/sec. I would like to use either Load Velocity VI or Load Velocity in RPM VI whichever is easy to set velocity, distance, and read position of my axis. More, I would like to be able to use onboard variables to set distance, velocity, and read position of the axis using input/return vectors, but I don't know how to set the right values. Do I need a conversion or multiplier number to get the right value?
    Any help would be greatly appreciated.
    Carlos D' Garcia.

    Carols –
    There is a simple vi on how to do vector moves at the following link (I also attached the file below):
    http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3DF9956A4E034080020E74861&p_node=DZ52480&p_source=External
    To have your axes move at different rates, you will have to replace the single ‘Load Velocity in RPM.vi’ that is wired to the Configure Vector Space.flx with three separate Load Velocity RPM.vi’s each with an axis constant (or control) wired to their axis input and the max velocity you want. This way, you will set the maximum velocity for each axis rather than all three at once.
    Best of luck with your project! Let me know if you have further questions with this.
    Marc C
    National Instruments
    Applications Engineer
    Attachments:
    Three-Axis_Vector_Move_with_Position_Monitor.zip ‏29 KB

  • My_BAPI shuldReceive input & returning back output?

    I hv a Prog. my_ALV, which out puts the ALV report, by taking the Selection criteria from Selection screen.
    So, now, the requirement is(I dont hv Functional Specs),
    1 - I hv to develop a my_BAPI
    This my_BAPI shuld(this BAPI in such a way that,),
    1 - import/use the Selection criteria
    SUBMIT my_ALV???????????
    2- input this selection criteria into my_ALV prog. as input and shuld yield the output(need not display)
    3-Again now, I hv to return/export this output to memory.
    EXPORT LIST TO MEMORY
    So,
    1) Wht is the ideal Prog. flow?
    2) What r the key syntxes I can use ?
    3) Wht r the structures I need to create?
    4) Wht is the addition for SUBMIT my_ALV??????????? syntax, Is it VIA SELECTION SCREEN or USING SELECTION SCREEN or else?
    5) Is this sytax is right one to get result,
    EXPORT LIST TO MEMORY
    or any additios needed?
    6) Do v hv any SAP bapi for this purpose?
    thanq.
    Message was edited by:
            Sridhar
    Message was edited by:
            Sridhar

    .

  • Inputs return minimum value

    I have RTX, DDK and a PCI-6254
    I've managed to get the interupts to work fine, it fills the FIFO and I an read the data back from the fifo via port commands, however, the data all returns either 0 or -32768 depending on which polarity I have selected. Any ideas why this would happen?
    P.s.
    Other technical info:
    I have a 5v reference voltage applied to the connector block from its own 5v pin. The AI-Sense is set to 0v from the AI-GND pin. This has been checked with a standard volt meter so the connector is making good contact with the card otherwise it would not give 5v. Secondly I read from all 32 channels which all return the same value. Ive loaded the calibration data correctly and manual testing shows that the calibration data maps very well to my voltage range (-+ 10v) and all 16bits.
    Any ideas?
    Thanks
    John

    Hi DiegoF
            Thank you for your infomation!
            I'm Get the problem when use RTX,DDK,PCI6259 do AI job. I got the random value when I acq. a value using "aiex1.cpp" . If i active the adcret() function,i got the  same small error value. That confused me all night.
            when i modify the code as you say,all right .
           Thank u.
         su
    帖子被eastf在04-28-2007 09:25 AM时编辑过了

  • Why does "To Timestamp" with 0 wired to the input return 01:00:00 01/01/1904 and not 00:00:00 01/01/1904?

    I am trying to display the elapsed time during my test. When I subtract my reference time from current time I end up with an additional hour.
    So if I plug in 173 seconds in I get 01:02:53.000 01/01/1904.
    I don't know if this relevant but I have noticed that timestamp constants are coerced to this number.
    I am in GMT Daylight Saving Time.
    cheers
    David

    Timezone. 
    When I run your VI, I get 0 seconds being 19:00:00 which is 5 hours behind 0 which is right as I am 5 hours behind GMT.  Zero at GMT is 19:00:00 local time (CST).  You are obviously one hour ahead (central europe). 
    It should work out OK if you have the same offset on both sides of the equation.  If you start at noon local time and stop at midnight local time, it should be 12 hours reguardless of where the local time is.
    Hope that this helps,
    Bob Young
    Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
    DISTek Integration, Inc. - NI Alliance Member
    mailto:[email protected]

  • Zip code input to return location

    I am wondering if there is a spry tool that I can use. I want
    the user to input one of about 50 zip codes in my area and then
    based on that input, return one of 3 locations(address).
    TIA,
    Bill

    If you're in the USA and your server supports PHP -
    A to Z store locator is fairly easy to work with:
    www.php4script.com/store-locator-script/
    Other flavors and zip code support can be found at HotScripts
    www.hotscripts.com/PHP/Scripts_and_Programs/Zip_Code_Locators/index.html
    --Nancy O.
    Alt-Web Design & Publishing
    www.alt-web.com
    "Brhaynes75" <[email protected]> wrote in
    message
    news:fc4cc8$dkt$[email protected]..
    > I am developing a website that requires me to have a
    store locator that
    can
    > return a list of results based off the user's zip code
    submission. Can
    anyone
    > point me in the right direction?
    >
    > If there are solutions out there that can be purchased,
    if the product is
    > good, I will do that as well.
    >
    > Thanks in advance.
    >
    >
    >

  • How to get return values from stored procedure to ssis packge?

    Hi,
    I need returnn values from my stored procedure to ssis package -
    My procedure look like  and ssis package .Kindly help me to oget returnn value to my ssis package
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author: <Author,,Name>
    -- Create date: <Create Date,,>
    -- Description: <Description,,>
    -- =============================================
    ALTER PROCEDURE [TSC]
    -- Add the parameters for the stored procedure here
    @P_STAGE VARCHAR(2000)
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;
    -- Insert statements for procedure here
    --SELECT <@Param1, sysname, @p1>, <@Param2, sysname, @p2>
    truncate table [INPUTS];
    INSERT
    INTO
    [INPUTS_BASE]
    SELECT
    [COLUMN]
    FROM [INPUTS];
    RETURN
    END
    and i am trying to get the return value from execute sql task and shown below
    and i am taking my returnn value to result set variable

    You need to have either OUTPUT parameters or use RETURN statement to return a value in stored procedures. RETURN can only return integer values whereas OUTPUT parameters can be of any type
    First modify your procedure to define return value or OUTPUT parameter based on requirement
    for details see
    http://www.sqlteam.com/article/stored-procedures-returning-data
    Once that is done in SSIS call sp from Execute SQL Task and in parameter mapping tabe shown above add required parameters and map them to variables created in SSIS and select Direction as Output or Return Value based on what option you used in your
    procedure.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Issue with displaying international characters returned by Search And Promote.

    Hi,
         I am trying to display international characters being returned by Search and Promote. The actual text returned by S&P is televisión, while the one being displayed is televisión
    I am usging r.get() to fetch values returned by S&P. The issue is only with data returned by S&P. Local international texts are being properly displayed.
    Thanks in advance!

    Thanks Sham! Found the fix. I am checking for invalid characters in the byte stream and then applying corresponding encoding.
    This method checks for invalid characters.
    public static boolean isValidUTF8( byte[] input ) {
        CharsetDecoder cs = Charset.forName("UTF-8").newDecoder();
        try {
            cs.decode(ByteBuffer.wrap(input));
            return true;
        catch(CharacterCodingException e){
            return false;
    This statement performs corresponding encoding.
    String utf8 = new String(inputString.getBytes(encoded format), Charset.forName("UTF-8"));

  • Disable Backspace when in input text fields

    Im trying to find a way to disable the keyboard backspace
    button from going back a page in the site but allowing it to
    function as a character delete when needed for typing in an input
    text field of a form.
    Strangely this problem only occurs for about a minute after
    the page is opened....after that it then works correctly. You can
    see what I mean by accessing the site's contact page
    www.safetybusiness.co.uk
    I have found two different sets of code to disable the
    Backspace completely, but this then means it doesn't work at all
    when wanting to delete in the text field.
    Method 1:
    <script type="text/javascript">
    if (typeof window.event != 'undefined')
    document.onkeydown = function()
    if (event.srcElement.tagName.toUpperCase() != 'INPUT')
    return (event.keyCode != 8);
    else
    document.onkeypress = function(e)
    if (e.target.nodeName.toUpperCase() != 'INPUT')
    return (e.keyCode != 8);
    </script>
    Method 2:
    <script>
    function checkShortcut()
    if(event.keyCode==8 || event.keyCode==13)
    return false;
    </script>
    <body onkeydown="return checkShortcut()">
    Anyone know how I can overcome this?

    The TextField class has a tab order property. You may want to
    look into this. As for disabling the backspace key, you can grab
    key presses from user input. I'm not 100% on this but you could use
    Flash to test the key being pressed. If backspace is pressed, find
    out the current object with focus (unsure of this part), if it's an
    input box in flash, have flash handle it or if a text box doesn't
    have focus, send it out to javascript to have it handle it.

  • Read input stream

    My function tried to parse a inputstream(xml format) but I keep getting exception: Exception org.xml.sax.SAXParseException: The root element is required in a well-formed document. I checked my XML format, it looks correct. Is there a way I can print out the input stream but still be able to parse it later with the sam input stream? Thanks.
    public static final Document getDOMTree(InputStream input) throws Exception
    try
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         DocumentBuilder builder = factory.newDocumentBuilder();
         Document doc = builder.parse(input);
    return doc;
    } catch(DOMException de) {
    System.out.println("parse error " +de);
         throw new Exception(de.toString());
    } catch(Exception e)
    System.out.println("Exception " +e);
         throw new Exception(e.toString());
    }

    Here's a class that I use for viewing outputstreams in a similar way - you can either adjust it to work as an input stream, or do a quick web search on TeeInputStream - I suspect you'll find some code.
    Cheers,
    - K
    * Copyright (c) 2001 Matthew Feldt. All rights reserved.
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided the copyright notice above is
    * retained.
    * THIS SOFTWARE IS PROVIDED ''AS IS'' AND WITHOUT ANY EXPRESSED OR
    * IMPLIED WARRANTIES.
    * TeeOutputStream.java
    * Java Examples In A Nutshell Copyright (c) 2000 David Flanagan
    * Exercise 3-7:
    * Write a subclass of OutputStream named TeeOutputStream that acts like a T
    * joint in a pipe; the stream sends its output to two different output streams,
    * specified when the TeeOutputStream is created. Write a simple test program
    * that uses two TeeOutputStream objects to send text read from System.in to
    * System.out and to two different test files.
    * @author Matthew Feldt <[email protected]>
    * @version 1.0, 02/12/2001 08:23
    import java.io.*;
    public class TeeOutputStream extends OutputStream {
        OutputStream ostream1, ostream2;
        /** sole TeeOutputStream constructor */
        public TeeOutputStream(OutputStream o1, OutputStream o2) throws IOException {
            ostream1 = o1;
            ostream2 = o2;
        public void close() throws IOException {
            ostream1.close();
            ostream2.close();
        public void flush() throws IOException {
            ostream1.flush();
            ostream2.flush();
        public void write(int b) throws IOException {
            byte[] buf = new byte[1];
            buf[0] = (byte)b;
            write(buf, 0, 1);
        public void write(byte[] b, int off, int len) throws IOException {
            ostream1.write(b, off, len);
            ostream2.write(b, off, len);
        /** test class */
        static class Test {
            public static void main (String args[]) {
                final String f1 = "tee1.out", f2 = "tee2.out";
                int ch;
                try {
                    // create a TeeOutputStream with System.out and a file
                    // as output streams
                    TeeOutputStream t1 = new TeeOutputStream(
                        System.out, new FileOutputStream(f1));
                    // create a TeeOutputStream with t1 and a second file as
                    // output streams
                    TeeOutputStream tee = new TeeOutputStream(
                        t1,    new FileOutputStream(f2));
                    // read characters from System.in and write to the tee
                    while ((ch = System.in.read()) != -1) {
                        tee.write(ch);
                    tee.close(); // close the tee
                } catch(FileNotFoundException e) {
                    System.err.println(e.getMessage());
                } catch(IOException e) {
                    System.err.println(e.getMessage());
    }

  • Command line input concurrency?

    I'm building an agent program with a number of classes that each require the user to input information at the command line (not with args, but using Scanner(System.in)). I've only just now realised that running two of these agents simultaneously will result in them both using the same input. Is there any way to allocate separate channels, or to allocate a flow of control so that one will not receive input that is destined for the other?
    Thanks to anybody who can help.

    I'm a bit confused about the Synchronise keyword. I've figured out that i'll need a separate shell/window/console/terminal/whatever for each agent. I'm not sure I can use System.in and System.out in this case.
    Currently each agent class uses a class called InputOutput. The code for it is pretty simple:
    import java.util.Scanner;
    class InputOutput {
        private Scanner reader;
        public InputOutput() {
            reader = new Scanner(System.in);
        public String input() {
            return reader.nextLine().trim().toLowerCase();
        public void output(String text) {
            System.out.print(text);
        public String prompt(String prompt) {
            output(prompt + "  ");
            return input();
        public boolean yesOrNo(String question) {
            while(true) {
                try {
                    output(question + " (Y/N)  ");
                    char correct = input().charAt(0);
                    switch(correct) {
                        case 'y': return true;
                        case 'n': return false;
                        default: throw new Exception();
                catch(Exception e) {
                    output("Invalid selection\n");
        public String convertToDollars(int cents) {
            StringBuffer price = new StringBuffer(Integer.toString(cents));
            price.insert(0, '$');
            price.insert((price.length() - 2), '.');
            if(price.toString().contains("$.")) {
                price.insert(1, '0');
            return price.toString();
        public int convertToCents(String dollars) throws NullPointerException {
            StringBuffer price = new StringBuffer(dollars);
            int index = 0;
            while(index < price.length()) {
                if(Character.isDigit(price.charAt(index)) || price.charAt(index) == '.') {
                    index++;
                else {
                    price.deleteCharAt(index);
            String[] splitPrice = price.toString().split("\\.");
            switch(splitPrice.length) {
                case 1: return (Integer.parseInt(splitPrice[0]) * 100);
                case 2: int convertedPrice = (Integer.parseInt(splitPrice[0]) * 100);
                        if(splitPrice[1].length() <= 2) {
                            convertedPrice += (Integer.parseInt(splitPrice[1]) * (Math.pow(10, (2 - splitPrice[1].length()))));
                            return convertedPrice;
                default: throw new NullPointerException("Incorrect price format");
    }The main methods are input() (basically just a Scanner call; saves typing) and output() (basically a System.out.print call). I'm basically wondering if I can have each instance of this class open a new terminal window (or text window of some sort) where all its outputs will be displayed and all its inputs accepted, without conflicting with other instances of the object.
    Sorry if I'm not being clear. I'm still fairly new to java and the only interactive methods I know are Scanner and print/println :(

  • Help - how to get 2 inputs

    hi, i am creating this basic program/game. i need to get two inputs from the user. the problem is when i run the program it gets the first input from the user but then doesn't get the second input.. please help, the code is as follows:
    public class game
    public static void main(String[] args)
    char rock = 'r';
    char paper = 'p';
    char sciccsors = 's';
    do
    System.out.println("Player 1 please enter a letter");
    char c1 = SavitchIn.readChar();
    System.out.println("Player 2 please enter a letter");
    char c2 = SavitchIn.readChar();
    winnercalculation(c1,c1);
    game.winnercalculation(c1,c2);
    } while (quitoption());
    public static void winnercalculation(char c1, char c2)
    char rock = 'r';
    char paper = 'p';
    char sciccsors = 's';
    if ((c1 == rock) && (c2 == paper))
    System.out.println("Player 2 Wins");
    private static boolean quitoption()
    System.out.print("Would you like to repeat this program?");
    System.out.println(" (y for yes or n for no)");
    char answer = SavitchIn.readLineNonwhiteChar();
    return ((answer == 'y') || (answer == 'Y'));
    thanks for your help
    alex
    (i will reply to this post with the code required to make the SavitchIn.readline thing work.

    this is the code required for the SavitchIn read- copy the below code and save it as SavitchIn.java:
    import java.io.*;
    import java.util.*;
    *Class for simple console input.
    *A class designed primarily for simple keyboard input of the form
    *one input value per line. If the user enters an improper input,
    *i.e., an input of the wrong type or a blank line, then the user
    *is prompted to reenter the input and given a brief explanation
    *of what is required. Also includes some additional methods to
    *input single numbers, words, and characters, without going to
    *the next line.
    public class SavitchIn
    *Reads a line of text and returns that line as a String value.
    *The end of a line must be indicated either by a new-line
    *character '\n' or by a carriage return '\r' followed by a
    *new-line character '\n'. (Almost all systems do this
    *automatically. So, you need not worry about this detail.)
    *Neither the '\n', nor the '\r' if present, are part of the
    *string returned. This will read the rest of a line if the
    *line is already partially read.
    public static String readLine()
    char nextChar;
    String result = "";
    boolean done = false;
    while (!done)
    nextChar = readChar();
    if (nextChar == '\n')
    done = true;
    else if (nextChar == '\r')
    //Do nothing.
    //Next loop iteration will detect '\n'
    else
    result = result + nextChar;
    return result;
    *Reads the first string of nonwhite characters on a line and
    *returns that string. The rest of the line is discarded. If
    *the line contains only white space, then the user is asked
    *to reenter the line.
    public static String readLineWord()
    String inputString = null,
    result = null;
    boolean done = false;
    while(!done)
    inputString = readLine();
    StringTokenizer wordSource =
    new StringTokenizer(inputString);
    if (wordSource.hasMoreTokens())
    result = wordSource.nextToken();
    done = true;
    else
    System.out.println(
    "Your input is not correct. Your input must");
    System.out.println(
    "contain at least one nonwhitespace character.");
    System.out.println(
    "Please, try again. Enter input:");
    return result;
    *Precondition: The user has entered a number of type int on
    *a line by itself, except that there may be white space before
    *and/or after the number.
    *Action: Reads and returns the number as a value of type int.
    *The rest of the line is discarded. If the input is not
    *entered correctly, then in most cases, the user will be
    *asked to reenter the input. In particular, this applies to
    *incorrect number formats and blank lines.
    public static int readLineInt()
    String inputString = null;
    int number = -9999;//To keep the compiler happy.
    //Designed to look like a garbage value.
    boolean done = false;
    while (! done)
    try
    inputString = readLine();
    inputString = inputString.trim();
    number = Integer.parseInt(inputString);
    done = true;
    catch (NumberFormatException e)
    System.out.println(
    "Your input number is not correct.");
    System.out.println("Your input number must be");
    System.out.println("a whole number written as an");
    System.out.println("ordinary numeral, such as 42");
    System.out.println("Minus signs are OK,"
    + "but do not use a plus sign.");
    System.out.println("Please, try again.");
    System.out.println("Enter a whole number:");
    return number;
    *Precondition: The user has entered a number of type long on
    *a line by itself, except that there may be white space
    *before and/or after the number.
    *Action: Reads and returns the number as a value of type
    *long. The rest of the line is discarded. If the input is not
    *entered correctly, then in most cases, the user will be asked
    *to reenter the input. In particular, this applies to
    *incorrect number formats and blank lines.
    public static long readLineLong()
    String inputString = null;
    long number = -9999;//To keep the compiler happy.
    //Designed to look like a garbage value.
    boolean done = false;
    while (! done)
    try
    inputString = readLine();
    inputString = inputString.trim();
    number = Long.parseLong(inputString);
    done = true;
    catch (NumberFormatException e)
    System.out.println(
    "Your input number is not correct.");
    System.out.println("Your input number must be");
    System.out.println("a whole number written as an");
    System.out.println("ordinary numeral, such as 42");
    System.out.println("Minus signs are OK,"
    + "but do not use a plus sign.");
    System.out.println("Please, try again.");
    System.out.println("Enter a whole number:");
    return number;
    *Precondition: The user has entered a number of type double
    *on a line by itself, except that there may be white space
    *before and/or after the number.
    *Action: Reads and returns the number as a value of type
    *double. The rest of the line is discarded. If the input is
    *not entered correctly, then in most cases, the user will be
    *asked to reenter the input. In particular, this applies to
    *incorrect number formats and blank lines.
    public static double readLineDouble()
    String inputString = null;
    double number = -9999;//To keep the compiler happy.
    //Designed to look like a garbage value.
    boolean done = false;
    while (! done)
    try
    inputString = readLine();
    inputString = inputString.trim();
    number = Double.parseDouble(inputString);
    done = true;
    catch (NumberFormatException e)
    System.out.println(
    "Your input number is not correct.");
    System.out.println("Your input number must be");
    System.out.println("an ordinary number either with");
    System.out.println("or without a decimal point,");
    System.out.println("such as 42 or 9.99");
    System.out.println("Please, try again.");
    System.out.println("Enter the number:");
    return number;
    *Precondition: The user has entered a number of type float
    *on a line by itself, except that there may be white space
    *before and/or after the number.
    *Action: Reads and returns the number as a value of type
    *float. The rest of the line is discarded. If the input is
    *not entered correctly, then in most cases, the user will
    *be asked to reenter the input. In particular,
    *this applies to incorrect number formats and blank lines.
    public static float readLineFloat()
    String inputString = null;
    float number = -9999;//To keep the compiler happy.
    //Designed to look like a garbage value.
    boolean done = false;
    while (! done)
    try
    inputString = readLine();
    inputString = inputString.trim();
    number = Float.parseFloat(inputString);
    done = true;
    catch (NumberFormatException e)
    System.out.println(
    "Your input number is not correct.");
    System.out.println("Your input number must be");
    System.out.println("an ordinary number either with");
    System.out.println("or without a decimal point,");
    System.out.println("such as 42 or 9.99");
    System.out.println("Please, try again.");
    System.out.println("Enter the number:");
    return number;
    *Reads the first nonwhite character on a line and returns
    *that character. The rest of the line is discarded. If the
    *line contains only white space, then the user is asked to
    *reenter the line.
    public static char readLineNonwhiteChar()
    boolean done = false;
    String inputString = null;
    char nonWhite = ' ';//To keep the compiler happy.
    while (! done)
    inputString = readLine();
    inputString = inputString.trim();
    if (inputString.length() == 0)
    System.out.println(
    "Your input is not correct.");
    System.out.println("Your input must contain at");
    System.out.println(
    "least one nonwhitespace character.");
    System.out.println("Please, try again.");
    System.out.println("Enter input:");
    else
    nonWhite = (inputString.charAt(0));
    done = true;
    return nonWhite;
    *Input should consist of a single word on a line, possibly
    *surrounded by white space. The line is read and discarded.
    *If the input word is "true" or "t", then true is returned.
    *If the input word is "false" or "f", then false is returned.
    *Uppercase and lowercase letters are considered equal. If the
    *user enters anything else (e.g., multiple words or different
    *words), then the user is asked to reenter the input.
    public static boolean readLineBoolean()
    boolean done = false;
    String inputString = null;
    boolean result = false;//To keep the compiler happy.
    while (! done)
    inputString = readLine();
    inputString = inputString.trim();
    if (inputString.equalsIgnoreCase("true")
    || inputString.equalsIgnoreCase("t"))
    result = true;
    done = true;
    else if (inputString.equalsIgnoreCase("false")
    || inputString.equalsIgnoreCase("f"))
    result = false;
    done = true;
    else
    System.out.println(
    "Your input number is not correct.");
    System.out.println("Your input must be");
    System.out.println("one of the following:");
    System.out.println("the word true,");
    System.out.println("the word false,");
    System.out.println("the letter T,");
    System.out.println("or the letter F.");
    System.out.println("You may use either upper-");
    System.out.println("or lowercase letters.");
    System.out.println("Please, try again.");
    System.out.println("Enter input:");
    return result;
    *Reads the next input character and returns that character. The
    *next read takes place on the same line where this one left off.
    public static char readChar()
    int charAsInt = -1; //To keep the compiler happy
    try
    charAsInt = System.in.read();
    catch(IOException e)
    System.out.println(e.getMessage());
    System.out.println("Fatal error. Ending Program.");
    System.exit(0);
    return (char)charAsInt;
    *Reads the next nonwhite input character and returns that
    *character. The next read takes place immediately after
    *the character read.
    public static char readNonwhiteChar()
    char next;
    next = readChar();
    while (Character.isWhitespace(next))
    next = readChar();
    return next;
    *The following methods are not used in the text, except for
    *a brief reference in Chapter 2. No program code uses them.
    *However, some programmers may want to use them.
    *Precondition: The next input in the stream consists of an
    *int value, possibly preceded by white space, but definitely
    *followed by white space.
    *Action: Reads the first string of nonwhite characters
    *and returns the int value it represents. Discards the first
    *whitespace character after the word. The next read takes
    *place immediately after the discarded whitespace.
    *In particular, if the word is at the end of a line, the
    *next reading will take place starting on the next line.
    *If the next word does not represent an int value,
    *a NumberFormatException is thrown.
    public static int readInt() throws NumberFormatException
    String inputString = null;
    inputString = readWord();
    return Integer.parseInt(inputString);
    *Precondition: The next input consists of a long value,
    *possibly preceded by white space, but definitely
    *followed by white space.
    *Action: Reads the first string of nonwhite characters and
    *returns the long value it represents. Discards the first
    *whitespace character after the string read. The next read
    *takes place immediately after the discarded whitespace.
    *In particular, if the string read is at the end of a line,
    *the next reading will take place starting on the next line.
    *If the next word does not represent a long value,
    *a NumberFormatException is thrown.
    public static long readLong()
    throws NumberFormatException
    String inputString = null;
    inputString = readWord();
    return Long.parseLong(inputString);
    *Precondition: The next input consists of a double value,
    *possibly preceded by white space, but definitely
    *followed by white space.
    *Action: Reads the first string of nonwhitespace characters
    *and returns the double value it represents. Discards the
    *first whitespace character after the string read. The next
    *read takes place immediately after the discarded whitespace.
    *In particular, if the string read is at the end of a line,
    *the next reading will take place starting on the next line.
    *If the next word does not represent a double value,
    *a NumberFormatException is thrown.
    public static double readDouble()
    throws NumberFormatException
    String inputString = null;
    inputString = readWord();
    return Double.parseDouble(inputString);
    *Precondition: The next input consists of a float value,
    *possibly preceded by white space, but definitely
    *followed by white space.
    *Action: Reads the first string of nonwhite characters and
    *returns the float value it represents. Discards the first
    *whitespace character after the string read. The next read
    *takes place immediately after the discarded whitespace.
    *In particular, if the string read is at the end of a line,
    *the next reading will take place starting on the next line.
    *If the next word does not represent a float value,
    *a NumberFormatException is thrown.
    public static float readFloat()
    throws NumberFormatException
    String inputString = null;
    inputString = readWord();
    return Float.parseFloat(inputString);
    *Reads the first string of nonwhite characters and returns
    *that string. Discards the first whitespace character after
    *the string read. The next read takes place immediately after
    *the discarded whitespace. In particular, if the string
    *read is at the end of a line, the next reading will take
    *place starting on the next line. Note, that if it receives
    *blank lines, it will wait until it gets a nonwhitespace
    *character.
    public static String readWord()
    String result = "";
    char next;
    next = readChar();
    while (Character.isWhitespace(next))
    next = readChar();
    while (!(Character.isWhitespace(next)))
    result = result + next;
    next = readChar();
    if (next == '\r')
    next = readChar();
    if (next != '\n')
    System.out.println(
    "Fatal Error in method readWord of class SavitchIn.");
    System.exit(1);
    return result;
    *Precondition: The user has entered a number of type byte on
    *a line by itself, except that there may be white space before
    *and/or after the number.
    *Action: Reads and returns the number as a value of type byte.
    *The rest of the line is discarded. If the input is not
    *entered correctly, then in most cases, the user will be
    *asked to reenter the input. In particular, this applies to
    *incorrect number formats and blank lines.
    public static byte readLineByte()
    String inputString = null;
    byte number = -123;//To keep the compiler happy.
    //Designed to look like a garbage value.
    boolean done = false;
    while (! done)
    try
    inputString = readLine();
    inputString = inputString.trim();
    number = Byte.parseByte(inputString);
    done = true;
    catch (NumberFormatException e)
    System.out.println(
    "Your input number is not correct.");
    System.out.println("Your input number must be a");
    System.out.println("whole number in the range");
    System.out.println("-128 to 127, written as");
    System.out.println("an ordinary numeral, such as 42.");
    System.out.println("Minus signs are OK,"
    + "but do not use a plus sign.");
    System.out.println("Please, try again.");
    System.out.println("Enter a whole number:");
    return number;
    *Precondition: The user has entered a number of type short on
    *a line by itself, except that there may be white space before
    *and/or after the number.
    *Action: Reads and returns the number as a value of type short.
    *The rest of the line is discarded. If the input is not
    *entered correctly, then in most cases, the user will be
    *asked to reenter the input. In particular, this applies to
    *incorrect number formats and blank lines.
    public static short readLineShort()
    String inputString = null;
    short number = -9999;//To keep the compiler happy.
    //Designed to look like a garbage value.
    boolean done = false;
    while (! done)
    try
    inputString = readLine();
    inputString = inputString.trim();
    number = Short.parseShort(inputString);
    done = true;
    catch (NumberFormatException e)
    System.out.println(
    "Your input number is not correct.");
    System.out.println("Your input number must be a");
    System.out.println("whole number in the range");
    System.out.println("-32768 to 32767, written as");
    System.out.println("an ordinary numeral, such as 42.");
    System.out.println("Minus signs are OK,"
    + "but do not use a plus sign.");
    System.out.println("Please, try again.");
    System.out.println("Enter a whole number:");
    return number;
    public static byte readByte() throws NumberFormatException
    String inputString = null;
    inputString = readWord();
    return Byte.parseByte(inputString);
    public static short readShort() throws NumberFormatException
    String inputString = null;
    inputString = readWord();
    return Short.parseShort(inputString);
    //The following was intentionally not used in the code for
    //other methods so that somebody reading the code could more
    //quickly see what was being used.
    *Reads the first byte in the input stream and returns that
    *byte as an int. The next read takes place where this one
    *left off. This read is the same as System.in.read(),
    *except that it catches IOExceptions.
    public static int read()
    int result = -1; //To keep the compiler happy
    try
    result = System.in.read();
    catch(IOException e)
    System.out.println(e.getMessage());
    System.out.println("Fatal error. Ending Program.");
    System.exit(0);
    return result;

  • Using AppleScript to return name in Automator

    Trying to create an AppleScript action to return the name of the item handed to it by the Automator. As it the script fails to complete with and error "Check the actionʼs properties.." If I remove "name of" in the return command, i get the path of target of the input returned. What is the datatype being handed from Automator into the AppleScript? I'm wanting to output a string datatype to use this input name later on.
    Thanks,
    Chris

    Try using:
    return name of (info for item 1 of input)
    (70482)

  • Role of left input and right input in merge join

    Hi All
    I really appreciate if someone explain me the difference between left input and right input in Merge Join.

    Think it in terms of transact sql join statement. The left input and right input represents the left and right part of join operation. So depending on type of operation chosen like LEFT JOIN,INNER JOIN etc it takes correspondig input as the base input and
    does join operation with the other input. Also it relies upon order of records in input which is why its essential that data should be sorted and also Issorted property must be tru for both the inputs.
    The real significance of choice is for left join as it will take left input as base table and does the comparison with other input returning all records from base input irrespective of whether or not it found a match. In all other cases (INNER/FULL JOIN)
    it gives similar output regardless of the which input you choose as left or right input.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How can i measure the time between a pulse output and a pulse back on the input?

    Llo,
    I have a problem i use a ultrsonic sensor, and when i send a pulse out of 4V then a couple of ms i have a pulse back on the input, how can i exactly know how much time there is between the 2 ^pulse??

    Use the output pulse to trigger a counter in period measuring mode and stop the counter on the return signal (if the input return signal is large enough to reliably trigger a logic circuit). If the signal is not large enough to trigger the counter directly, an external comparator can be used to generate the stop signal.
    Another approach is to use two channels of analog input. Feed the output signal to one of them and the return signal to the other channel. The time between outgoing and return pulses can be determined from the sampling rate. If precise timing is required and your AI board does not have simultaneous sampling, you have to account for the inter-channel time as well.
    Lynn

Maybe you are looking for