Simulating console activity in Java

Hello,
I have a small Java program that basically uses telnet to connect to another server. Currently, the program basically acts like the regular telnet client. When I run it, I get the basic login screen that I normally get in the standard command line. I can input my username and password and login normally through the console of this program.
I want to automate this. Basically, I want the program to detect that there is a prompt and input the correct information accordingly. So when it sees the word "login:" it puts in a username etc.
I am using the apache.commons.net package to do this (as I was unable to find something else). The code was taken from http://www.java2s.com/Code/Java/Network-Protocol/ExampleofuseofTelnetClient.htm
The program uses a thread to display the text onto the screen. Here is the function that takes care of this:
    public void run()
        InputStream instr = tc.getInputStream();
        try
            byte[] buff = new byte[1024];
            int ret_read = 0;
            do
                ret_read = instr.read(buff);
                if(ret_read > 0)
                    System.out.print(new String(buff, 0, ret_read));
            while (ret_read >= 0);
        catch (Exception e)
            System.err.println("Exception while reading socket:" + e.getMessage());
        try
            tc.disconnect();
        catch (Exception e)
            System.err.println("Exception while closing telnet:" + e.getMessage());
    }Something needs to be changed in here I'm guessing, but I have no clue what to use to achieve this. I already have it implemented using a perl script but the organization I'm with wants to standardize everything and eliminate the dependencies for this application. Any help would be greatly appreciated.
Cheers
P.S. I wasn't sure if this is the correct forum to post this stuff into. Please move the thread if it belongs elsewhere

I have a bot that run inside of our subnet and monitor all our Solaris servers via telnet. The gist of the solution is to read from the stream and buffer the input until you see something you can parse. You then interpret the result and send the corresponding commands though the wire. The reason for the buffering is that the read can be discontinuous, so you might see "log" first and then follow by "in:" on the next read. The parsing won't be trivial, but you can just treat it like a simple state machine. Line length can also be problematic, as some commands could wrap its output arbitrarily, so a newline is not a reliable delimiting token.

Similar Messages

  • Activity Management Java iViews displaying No Data Obtained

    Activity Management Java iViews displaying No Data Obtained. In our portal we are using several SAP delivered Java iViews. All of them work in our QA environment except the Activity Management ones.
    However, they DO work in our development.  Does anyone know what we are missing in the backend configuration that would cause the Activity Management Java iViews to display "No Data Obtained"
    Thanks.
    Jason

    Hi Gregor
    The User is assigned to a business partner. I'm not familiar with CRM's Org Management structure, so if I had to ask this question to someone that is, what should I ask specifically?
    Advanced search doesn't provide an option for "My Team" but it does for "My Group" is that the same thing? And when I do a search on that criteria I do get results. Another question is even if there weren't any results shouldn't the iView still say "No entries exist" similar to the "My Teams Open Leads"?
    Thanks,
    Julian

  • How to check if a user session is active in Java application server

    Hi Experts,
          We have a online scenario with a third party system by which a portal user will launch the third party application in a new window from portal. The SSO will work at the third party web application with the dynamic key that is generated by calling a webservice for that user. Now, as the user works on the launched screen, they will have to check whether the user (logged in portal) session is still active. ie., they will be periodically calling a service hosted by SAP java application server to find out whether the corresponding user who launched the session is still logged in or logged out.
    So, my question is, how can i find out programatically whether a user/user's session is still logged in/active in SAP Netweaver Java AS? We are in version 7.3.
    Kindly help me in this regard.
    Regards
    Vijay.K

    Hi Vijay,
    Could you check below links
    Tracing Single User Sessions - Administration - SAP Library
    Display and Manage User Sessions (SAP Library - Tools for Monitoring the System)
    Hope this helps.
    Regards,
    Deepak Kori

  • Opening an additional console in a Java program

    Is it possible to open an additional console to be used similarly to
    System.in/out from a Java program?
    How?
    Thanks for any help!

    You can create InputStream(System.in) and PrintStream(System.out/err).
    regards,

  • Webdynpro activation - ABAP/JAVA

    Hi ,
    I activated the components neccessary for ABAP Webdynpro in SICF.
    But still when i click show/hide layout preview, its saying NO VENDOR SPECIFIED
    I am able create a view,component..and other things..but only when i clik to create elements inside the view...
    its giving this error...
    Meanwhile..I dont think JAVA webdynpro server installed in my landscape..
    Could anyone provide some information regarding the above queries....
    Regards,
    Ashok

    Java has no part in Web Dynpro ABAP. It is in no way a prerequisite.  The only part of Web Dynpro ABAP that needs Java is the call to the Adobe Document Services for the InteractiveForm UI element.
    >But still when i click show/hide layout preview, its saying NO VENDOR SPECIFIED
    >I am able create a view,component..and other things..but only when i clik to create elements inside the view...
    its giving this error...
    I've never heard of anyone getting such an error. It doesn't really make sense in this place. Is the error within the preview area or is the error coming as a SAPGUI error from the workbench?  Is this a trial/sneak preview system or an offically supported installation?

  • Button activation in Java vs windows

    first, let me say I am a novice programmer.................
    I am attempting to activate a "push button" in a java application (AWT) which is deployed on a windows 2000 environment (a commerical software package which controlls a piece of equipment). I am attepting to activate a button in this application by establishing a windows level control over the window with the push button and acivete the button with windows commands all writtin in C#.net. I wrote a routine to esstablish a focus on the window with the "push button" and am able to manually depress the space bar to activate the button, however when I try to simulate this by activating the windows "space bar" key stroke command the java button depresses but the background java application does not activate. Is there a special command sequence that JAVA recognizes to initiate an action via "spacebar" press?

    crosspost

  • WebLogic 7.0sp4 - Console Servlet causes java.lang.OutOfMemoryError

    I downloaded various copies of WebLogic. I'm trying to work with WebLogic 7.0sp4
    on a Windows 2000 Server machine, but it's not working well at all. I have a
    very simple set-up - one JDBC connection pool to an Oracle database, and one EAR
    file. This should work easily.
    I have a WebLogic 6.0 produced EAR file. The EAR files contains about 110 Entity
    BMP EJBs, about 35 Stateless Session EJBs, and 1 Stateful Session EJB, as well
    as a collection of supporting Java classes.
    WebLogic 6.0 imports the EAR and deploys the beans with no problem. AND after
    deploying the beans, WebLogic 6.0 still lets you start a WebLogic Administrative
    Console to interact with and manage the WebLogic server. WebLogic 6.0 doesn't
    seem to have any problems.
    WebLogic 7.0 imports the EAR file, recompiles the beans, and deploys them. If
    you DON'T start an admin console, then you can ping the server, ask the server
    for its state, etc. - and everything seems fine. Once you start an admin console
    and try to get to the login page of the admin console, THEN WebLogic 7.0 runs
    out of memory. I've already bumped the minimum heapsize up to 350MB and maxsize
    to over 600MB. The application never even uses more than 100MB of real memory
    before it crashes with an out-of-memory error. Something about starting the admin
    console is crashing the server. The console servlet runs out of memory. Why?
    Is there a separate setting to increase the Heap Size used by the Console Servlet?
    I'm already using the "-Xms350m -Xmx600m" options when starting WebLogic to set
    aside at least 350MB of heap space.
    I'm including:
    - log files
    - config.xml
    - startweblogic.cmd
    [files.zip]

    I do not think this is the right group for your issue. Please post it in the appropriate
    one.
    "Bill Horan" <[email protected]> wrote:
    >
    >
    >
    I downloaded various copies of WebLogic. I'm trying to work with WebLogic
    7.0sp4
    on a Windows 2000 Server machine, but it's not working well at all.
    I have a
    very simple set-up - one JDBC connection pool to an Oracle database,
    and one EAR
    file. This should work easily.
    I have a WebLogic 6.0 produced EAR file. The EAR files contains about
    110 Entity
    BMP EJBs, about 35 Stateless Session EJBs, and 1 Stateful Session EJB,
    as well
    as a collection of supporting Java classes.
    WebLogic 6.0 imports the EAR and deploys the beans with no problem.
    AND after
    deploying the beans, WebLogic 6.0 still lets you start a WebLogic Administrative
    Console to interact with and manage the WebLogic server. WebLogic 6.0
    doesn't
    seem to have any problems.
    WebLogic 7.0 imports the EAR file, recompiles the beans, and deploys
    them. If
    you DON'T start an admin console, then you can ping the server, ask the
    server
    for its state, etc. - and everything seems fine. Once you start an admin
    console
    and try to get to the login page of the admin console, THEN WebLogic
    7.0 runs
    out of memory. I've already bumped the minimum heapsize up to 350MB
    and maxsize
    to over 600MB. The application never even uses more than 100MB of real
    memory
    before it crashes with an out-of-memory error. Something about starting
    the admin
    console is crashing the server. The console servlet runs out of memory.
    Why?
    Is there a separate setting to increase the Heap Size used by the Console
    Servlet?
    I'm already using the "-Xms350m -Xmx600m" options when starting WebLogic
    to set
    aside at least 350MB of heap space.
    I'm including:
    - log files
    - config.xml
    - startweblogic.cmd

  • Management console 3.0 Java Errors

    I have just installed Sun Management Console 3.0 and the install reported no errors
    When I go to start the console es-start -c I get a list of fonts not installed and the a list of Java errors. The path for the fonts seems correct in the startup.profile. Any help on this would be much appreciated.
    Thanks
    Joe

    Hi,
    You can use Ctrl+ALT+End to open the menu for the remote computer.
    Tim Quan
    TechNet Subscriber Support in forum
    If you have any feedback on our support, please contact [email protected]  
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not
    actually answer your question. This can be beneficial to other community members reading the thread.  

  • 7.5 -Admin Console - Active X control error

    Hi,
    When i try to open BPC admin Console,  its opening a blank page with Title "BPC Active X document framer Control"
    How to fix this issue? this in BPC 7.5 MS
    Thanks in advance

    Hi,
    sometimes the admin console doesn't open right and it's remain only the shell but normally if you close and reopen than it's open correctly.
    Kind regards
    Roberto

  • Problems using JavaMail and activation with Java 1.6

    Hi,
    I have developed an application with a SOAP architecture using Axis. Everything worked fine until I upgrade the JRE version from 1.5 to 1.6. Since then a "javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/related; type="text/xml" " exception is thrown every time I try to connect to the webservices.
    Debugging the code I've found that the problem is a null value in the "dch" attribute of the ObjectDataContentHandler object returned by the getInputStream method in the DataHandler class.
    When I launch the application using JRE 1.5 this attribute value is "text_plain" and everthing woks ok but when I launch it with JRE 1.6 the attribute has a wonderful "null" value...
    Anybody knows what could be the reason for that "null" value?
    I've looking for this problem in diferent forums and I believe that could be some kind of incompatibility between the activation version provided with the JRE 1.6 and the JavaMail 1.4 version but I'm not sure.
    Thanks in advance!

    My application also stopped working and sadly is a production application (is in a production environment and production depends heavily on it since it contains Standard Operation Procedures documents).
    I've tried so far uninstalling jre 1.6 from server, opening the jnlp with jre 1.5.13 and nothing yet. the curious thing is that the jre 1.6 update took place some time ago and today I'm getting the error. Not sure i the server went down recently which might explain some of it.
    Here's my error:
    java.lang.reflect.InvocationTargetException
            at sun.reflect.GeneratedConstructorAccessor4.newInstance(Unknown Source)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
            at org.apache.axis.Message.setup(Message.java:352)
            at org.apache.axis.Message.<init>(Message.java:235)
            at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:779)
            at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
            at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
            at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
            at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
            at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
            at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
            at org.apache.axis.client.Call.invoke(Call.java:2767)
            at org.apache.axis.client.Call.invoke(Call.java:2443)
            at org.apache.axis.client.Call.invoke(Call.java:2366)
            at org.apache.axis.client.Call.invoke(Call.java:1812)
            at com.bluecubs.xinco.client.XincoExplorer.doDataWizard(XincoExplorer.java:2788)
            at com.bluecubs.xinco.client.XincoExplorer$8.mousePressed(XincoExplorer.java:1437)
            at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:263)
            at java.awt.Component.processMouseEvent(Component.java:6035)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
            at java.awt.Component.processEvent(Component.java:5803)
            at java.awt.Container.processEvent(Container.java:2058)
            at java.awt.Component.dispatchEventImpl(Component.java:4410)
            at java.awt.Container.dispatchEventImpl(Container.java:2116)
            at java.awt.Component.dispatchEvent(Component.java:4240)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3983)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
            at java.awt.Container.dispatchEventImpl(Container.java:2102)
            at java.awt.Window.dispatchEventImpl(Window.java:2429)
            at java.awt.Component.dispatchEvent(Component.java:4240)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    Caused by: Error reading data stream:  Error in MIME data stream, start boundary not found, expected:  ------=_Part_5_13931643.1192823865125
            at org.apache.axis.attachments.MultiPartRelatedInputStream.<init>(MultiPartRelatedInputStream.java:339)
            at org.apache.axis.attachments.AttachmentsImpl.<init>(AttachmentsImpl.java:119)
            ... 39 more
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: java.lang.RuntimeException
    faultActor:
    faultNode:
    faultDetail:
            {http://xml.apache.org/axis/}stackTrace:java.lang.RuntimeException
            at org.apache.axis.Message.setup(Message.java:361)
            at org.apache.axis.Message.<init>(Message.java:235)
            at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:779)
            at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
            at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
            at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
            at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
            at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
            at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
            at org.apache.axis.client.Call.invoke(Call.java:2767)
            at org.apache.axis.client.Call.invoke(Call.java:2443)
            at org.apache.axis.client.Call.invoke(Call.java:2366)
            at org.apache.axis.client.Call.invoke(Call.java:1812)
            at com.bluecubs.xinco.client.XincoExplorer.doDataWizard(XincoExplorer.java:2788)
            at com.bluecubs.xinco.client.XincoExplorer$8.mousePressed(XincoExplorer.java:1437)
            at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:263)
            at java.awt.Component.processMouseEvent(Component.java:6035)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
            at java.awt.Component.processEvent(Component.java:5803)
            at java.awt.Container.processEvent(Container.java:2058)
            at java.awt.Component.dispatchEventImpl(Component.java:4410)
            at java.awt.Container.dispatchEventImpl(Container.java:2116)
            at java.awt.Component.dispatchEvent(Component.java:4240)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3983)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
            at java.awt.Container.dispatchEventImpl(Container.java:2102)
            at java.awt.Window.dispatchEventImpl(Window.java:2429)
            at java.awt.Component.dispatchEvent(Component.java:4240)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
            {http://xml.apache.org/axis/}hostname:PRAII1371900
    java.lang.RuntimeException
            at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
            at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
            at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
            at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
            at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
            at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
            at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
            at org.apache.axis.client.Call.invoke(Call.java:2767)
            at org.apache.axis.client.Call.invoke(Call.java:2443)
            at org.apache.axis.client.Call.invoke(Call.java:2366)
            at org.apache.axis.client.Call.invoke(Call.java:1812)
            at com.bluecubs.xinco.client.XincoExplorer.doDataWizard(XincoExplorer.java:2788)
            at com.bluecubs.xinco.client.XincoExplorer$8.mousePressed(XincoExplorer.java:1437)
            at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:263)
            at java.awt.Component.processMouseEvent(Component.java:6035)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
            at java.awt.Component.processEvent(Component.java:5803)
            at java.awt.Container.processEvent(Container.java:2058)
            at java.awt.Component.dispatchEventImpl(Component.java:4410)
            at java.awt.Container.dispatchEventImpl(Container.java:2116)
            at java.awt.Component.dispatchEvent(Component.java:4240)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3983)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
            at java.awt.Container.dispatchEventImpl(Container.java:2102)
            at java.awt.Window.dispatchEventImpl(Window.java:2429)
            at java.awt.Component.dispatchEvent(Component.java:4240)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    Caused by: java.lang.RuntimeException
            at org.apache.axis.Message.setup(Message.java:361)
            at org.apache.axis.Message.<init>(Message.java:235)
            at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:779)
            at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
            ... 32 moreAnd the related code:
    Message m = null;
                                MessageContext mc = null;
                                AttachmentPart ap = null;
                                Call call = (Call)xincoClientSession.xinco_service.createCall();
                                call.setTargetEndpointAddress(new URL(xincoClientSession.service_endpoint));
                                call.setOperationName(new QName("urn:Xinco", "downloadXincoCoreData"));
                                Object[] objp = new Object[2];
                                objp[0] = (XincoCoreData)newnode.getUserObject();
                                objp[1] = xincoClientSession.user;
                                //tell server to send file as attachment
                                //(keep backward compatibility to earlier versions)
                                ap = new AttachmentPart();
                                ap.setContent(new String("SAAJ"), "text/string");
                                call.addAttachmentPart(ap);
                                //invoke actual call
                                byte_array = (byte[])call.invoke(objp);
                                //get file from SOAP message or byte array
                                mc = call.getMessageContext();
                                m = mc.getResponseMessage();
                                if (m.getAttachments().hasNext()) {
                                    ap = (AttachmentPart)m.getAttachments().next();
                                    in = (InputStream)ap.getContent();
                                } else {
                                    in = new ByteArrayInputStream(byte_array);
                                }The stack trace point the error to the line:
    *byte_array = (byte[])call.invoke(objp);*
    Edited by: javydreamercsw on Oct 19, 2007 1:08 PM

  • Simulating an ALU in java?

    Hi-
    I am trying to simulate an ALU in java, i have written methods to do +,-,!,&&,||,^. I have different opcodes for each of the operations, I was wondering how i could use a simulated mux to pick between the different operations. I have written an 8 to 1 mux to do it, but am not sure how i would go along picking each of the operations. Also i was wondering how to do multiplication. I have each operand represented in a boolean array.
    /***  ADDITION:       000
         *  SUBTRACTION:    001
         *  MULTIPLICATION: 010
         *  DIVISION:       011
         *  NOT:            100
         *  AND:            101
         *  OR:             110
         *  XOR:            111
         OPCODES
    public boolean[] calc(boolean[] opcode, boolean[] left, boolean[] right) {
              boolean[] result = new boolean[WIDTH];
              boolean[] add= eightBitAdd(left,right);
              boolean[] subtract=subtract(left,right);
              boolean[] not=not(left);
              boolean[] and=and(left,right);
              boolean[] or=or(left,right);
              boolean[] xor=xor(left,right);
              System.out.println(opcode[0]+" "+opcode[1]+" "+opcode[2]+" ");
              return result; //want to set result to the array picked by the opcode, not using if statements
    //two to one mux
    public static boolean  twoToOne(boolean  a, boolean b, boolean s) {
              return((a&&!s)||(b&&s));
    // four to one mux     
    public static boolean fourToOne(boolean a, boolean b,
                            boolean c, boolean d,
                            boolean s0, boolean s1){
              return(twoToOne(twoToOne(a,b,s0),twoToOne(c,d,s0),s1));
    //eight to one mux
    public static boolean eightToOne(boolean a, boolean b, boolean c, boolean d,
                             boolean e, boolean f, boolean g, boolean h, boolean s0,
                            boolean s1, boolean s2){
              return(twoToOne(fourToOne(a,b,c,d,s0,s1),fourToOne(e,f,g,h,s0,s1),s2));
    }Edited by: ak47 on Oct 5, 2009 7:37 PM

    This is just an attempt, I could be wrong
    Okay, I am assuming that the opcode is actually you select line data.
    An 8:1 Mux has 3 select lines S0,S1,S2.
    In case of multiplexer?s, if say select line data is
    S2 S1 S0
    1 0 0 //4and input line data is
    I7 I6 I5 I4 I3 I2 I1 I0
    0 1 0 1 0 0 0 1 ,then whatever is at input line I4 will propagate to the o/p. In the above case o/p = 1.
    Now, as per your requirement, you want an o/p high for select line data from 000 to 111, So you need to tie up all the input data lines to logic high or Vcc. [Refer Fig|http://i34.tinypic.com/16a5vs4.jpg]
    The Truth Table is as follows,
    (MSB) (LSB)
    S2 S1 S0 Y
    0 0 0 1
    0 0 1 1
    0 1 0 1
    0 1 1 1
    1 0 0 1
    1 0 1 1
    1 1 0 1
    1 1 1 1
    Ask the user to enter the opcode (binary) as input.
    Convert the input from string to int, i.e obtain the decimal equivalent of the binary input. Use Integer.parseInt(strOpcode,2) or define your
    own method.
    Write a switch case ( case 0 to case 7 and a default case). In every case invoke the corresponding arithmetic operation (function call) and it
    is in the function that you must ask the user to enter the operand?s.

  • Active x/java

    where can i get detailed info about useing active x and java in
    the forms plz help throug practical example . and do explain
    which is better choice.
    thanks
    geeta

    I would recommend using Java over ActiveX as ActiveX is
    beingremoved from the product with Release 9i.
    If you go to http://otn.oracle.com/products/forms/content.html
    you will find links to Java sample code and whitepapers about
    integration with Java.
    Hope this helps,
    Candace Stover
    Forms Product Management

  • Activity Monitor - Java Virtual Memory Use is 16,333.00 TB.  How is this possible?

    Activity Monitor:   Virtual Memory column -
    Java Real Memory @ 330 MB
    Java Virtual Memory was 16,333 TB. 
    How could this be?
    Running:
    Safari
    Mail
    Pages
    Activity Monitor open
    Safari was incredibly slow today, as it has been a lot lately, but inconsistently.  The other computers in the house had normal speed.  I'm not a tech person.  I attached a copy of the activity monitor - how it looks right now.  I appreciate your thoughts and suggestions.  Thank you.
    bottom half

    As Kappy says, the virtual memory information is mostly meaningless except to developers, and most of them do not really care.
    In this case the Java VM usage is most likely a math error on the part of either the operating system, or Activity Monitor (when a 64-bit number goes negative, but is then displayed as an unsigned value, it can look like what you are seeing; ignore it).
    What you ARE interested in is "Real Memory" usage, and who is using it.  Look at those numbers in Activity Monitor.
    If you want to see if pageout activity is affecting your performance, then start Applicaitons -> Utilities -> Terminal and run the command "sar -g 60 100" which will report pageout numbers once a minute for 100 minutes (adjust the numbers to suit your tastes).   Mostly zero means no pages outs.  Occassional spikes generally occur when starting an app or switching to an app which has been idle for awhile.  Sustained pageouts starts to indicate a problem.  High sustained pageouts means you could benefit from either having more RAM or running fewer concurrent applications.

  • How to create linux console/terminal using Java

    Please help, give some ideas or something...I would like to develop my own linux console/terminal to make connection to linux server.
    Please help me.
    Thanks

    That doesn't make any sense.
    Are you just trying to write output to the terminal, as you mentioned in this thread?
    http://forum.java.sun.com/thread.jspa?threadID=5287785

  • Show console when executing java via ProcessBuilder

    Hi all,
    I have a Swing app with an updater that checks for updates off the server, and then fires up the main app using ProcessBuilder. On Windows it looks like this:
                ArrayList<String> list = new ArrayList<String>();
                list.add(javaPath); // Path to java.exe
                list.add("-cp");
                list.add(clientClasspath); // Classpath built up from a lib directory of jars
                list.add("-Xms128M");
                list.add("-Xmx256M");
                list.add("-XX:MaxPermSize=128m");
                list.add("-Djava.security.policy=.\\conf\\rmi.policy");
                list.add("-Dlog4j.configuration=file:.\\conf\\uniti_app_log4j.xml");
                list.add("uniti.client.UnitiClient_IMPL");
                processBuilder = new ProcessBuilder(list);
                processBuilder.directory(new File(clientAbsCodebasePath));
                process = processBuilder.start();The code works fine - problem is, Log4J isn't creating any log files, so I want to be able to see the Java console when the process builder runs.
    Any ideas on how to display the console?
    Thanks,
    Paul C.

    In most cases, you should not have to stop and restart OC4J_BI_FORMS to pick such changes. However, since you are having problems, I would ensure that all frmweb processes have been stopped, then stop and restart OC4J_BI_FORMS and retest. If that doesn't work, you should review how you imported the java into your app. Look closely at the Importer options you used and ensure that you have not change the file name at any point. Because you are working with Java, case sensitivity is critical.
    Also, where are you seeing the error message? Client java console or in a server side log? If server side, exactly which log file is reporting the problem? I would suggest you post the first 4 ro 5 lines of the error and not just the NoClassDefFound part.

Maybe you are looking for

  • NW7.0 BW Upgrade to EHP1

    Hi all, We are doing an upgrade from  NW 7.0 (ABAP only) BW SAP_ABA - 700 - 12 SAP_BASIS - 700 - 12 PI_BASIS - 2006-1-700 - 1 SAP_BW - 700 - 13 BI_CONT - 702 - 3 To Target version EHP1 Component     Release     Level SAP_ABA     701     6 SAP_BASIS  

  • How do I fix this audio?

    I bought software called Vodburner that records Skype conversations.  I tested it out a few times and it seemed to work fine, but this last recording had terrible audio on the recipient's side.  Here's a clip: http://www.youtube.com/watch?v=kBCNmU9FC

  • Struts portlet url posting

    Hi all, I am experimenting with a struts file upload portlet, trying to work around the fact that file upload directly to the PPE is not supported. Things work (quite) fine when I use the Struts HTML form (instead of the PDK Struts HTML) tag for the

  • Full Master Data Distribution in ALE - Vendor Master CREMAS(Full Distributi

    Hi Experts,    I have to do a Full Master Data Distribution in ALE - Vendor Master CREMAS(Full Distribution) using BD21.    I have already read the blog of Mickel and incorporated the code in Change_Pointer_Read.    It is still not working. Should I

  • Print original size preview

    hi i am using photoshop cs4, and working on one project, now i want to see the original size preview of my design layout. is there any option to get the exact size. ? best