Small problem - int to binary...

Hey all, I need to create a simple java applet which converts an int into it's binary representation.
Here is the output i need:
Enter an int: (user enters int)
That number in binary is:
Thats all I need. I know it has something to do with a "wrapper class", but thats all I know. :P
Could anyone point me in the right direction plz?

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html#parseInt(java.lang.String,%20int)

Similar Messages

  • Very small problem RE: Variable not initializing

    //Hey, folks! Having a small problem here. Compiler keeps telling me that "result" variable may not have been initialized for this method. This is probably an issue of variable scope? It's staring me in the face and I can't see the problem. Can you see the problem?      
    public Shape randomShape()
              Random generator = new Random();
              intShapeDecider = generator.nextInt(3);
              int intCrdntX1 = generator.nextInt(500);
              int intCrdntY1 = generator.nextInt(500);
              int intCrdntX2 = generator.nextInt(500);
              int intCrdntY2 = generator.nextInt(500);
              int intWidth = Math.abs(intCrdntX1 - intCrdntX2);
              int intHeight = Math.abs(intCrdntY1 - intCrdntY2);
              Shape result;
              if (intShapeDecider == 0)
                   result = new Line2D.Double(intCrdntX1,intCrdntY1,intCrdntX2,intCrdntY2);
              else if (intShapeDecider == 1)
                   result = new Rectangle(intCrdntX1,intCrdntY1,intWidth,intHeight);
    else if (intShapeDecider == 2)
              result = new Ellipse2D.Double(intCrdntX1,intCrdntY1,intWidth,intHeight);
              return result;
         }

    Nope...don't think that's the problem. My random ints are only 3 possible nums ...0,1, or 2. I have an if for each possible condition. Therefore, nothing "else" can really happen. No?

  • Problems with Concatenating Binary Data

    Hi
    I am experiencing a problem with the unreliable concatenation of binary data.
    I have a stored procedure that I wrote to perform cell encryption on long text fields (> 4000 characters in length). This takes the string, splits it into chunks of a set length, encrypts and concatenates the encrypted chunks into a varbinary(max) variable.
    It then stores the length of the encrypted chunk at the beginning of the data (the length of output when encrypting strings of a set length is always be the same), e.g.
    DECLARE @output VARBINARY(MAX), @length INT
    SELECT @length = LEN(@encryptedchunk1)
    SELECT @output = CONVERT(binary(8), @length) + @encryptedchunk1 + @encryptedchunk2 + @encryptedchunk3 + ...
    So far so good, and when I decrypt the data, I can read the first 8 bytes of data at beginning of the binary data to get the length of the chunk:
    -- get the length of the encrypted chunk
    SELECT @length = CONVERT(INT, CONVERT(binary(8), LEFT(@encrypteddata, 8)))
    -- then remove the first 8 bytes of data
    SELECT @encrypteddata = CONVERT(VARBINARY(MAX), RIGHT(@encrypteddata, LEN(@encrypteddata) - 8))
    <snip> code to split into chunks of length @length and decrypt
    </snip>
    This is where I am experiencing an issue. 99.4% of the time, the above code is reliable. However, 0.6% of the time this fails for one of two reasons:
    the length is stored incorrectly. The length of the encrypted chunks is usually 4052 and substituting 4052 for the returned value (4051) allows the encrypted chunks to be decrypted.
    the encrypted data sometimes starts at offset 8 instead of 9. The @length variable is correctly read at length 8 but only 7 bytes should be removed from the start, e.g.
    SELECT @length = CONVERT(INT, CONVERT(binary(8), LEFT(@encrypteddata, 8)))
    SELECT @encrypteddata = CONVERT(VARBINARY(MAX), RIGHT(@encrypteddata, LEN(@encrypteddata) - 7))
    Has anyone any ideas on why this is happening and how the process can be made more reliable?
    Julian

    Use datalength, not len. Len() is designed for character strings and will ignore trailing bytes. And count characters. Datalength does exactly what you want: it counts bytes. Look at this:
    DECLARE @b varbinary(200)
    SELECT @b = 0x4142434420202020
    SELECT @b, len(@b), datalength(@b)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Recursive mergeSort... small problem with infinate recursion.

    Basically, I have made a recursive mergeSort method, but there is a small problem...im getting stuck with an eternal recursion, which is obviously followed up swiftly by a stack flow error, problem is I cant see where im going wrong...
    The error reads, "Exception in thread "main" java.lang.StackOverflowError at part3.mergeSort(part3.java:56)"
    Heres the code... any help is highly appreciated, as I am new to java, and this is for university.
    public class part3
        public static void main(String[] args)
          // Declare array of unsorted values.
          int[] values = {1,3,5,7,9,2,4,6,8,10};
          // Display unsorted values on screen.
          System.out.println("Unsorted Values");
          for(int i= 0;i < values.length; i++)
               System.out.println(values);
    mergeSort(values, values.length);
    output(values);
    public static void mergeSort(int[] vals, int n)
    // Declare necessary values
    int lowCount, highCount;
    int[] low, high;
    int i, j, k;
    if (n > 1)
              low = new int[n];
              high = new int[n];
              for(i=0,j=0,k=0; i < n; i++)
                   if(vals[i] < low.length)
                        low[j] = vals[i];
                        j++;
                   else
                        high[k] = vals[i];
                        k++;
              lowCount = j;
              highCount= k;
              mergeSort(low, lowCount);
              mergeSort(high, highCount);
              for(i = 0; i < lowCount; i++)
                   vals[i] = low[i];
              for(i = 0; i < highCount; i++)
                   vals[i+lowCount] = high[i];
    public static void output(int[] data)
    for(int i = 0; i < data.length; i++)
         System.out.print(data[i] + " ");
              System.out.println();

    yes sorry, that was it, when i put that code in my class... i get an acception in thread main...
    heres the code i now have...
    I know i need to add a main method, but im completely unsure of what I need to put inside the main method, if you get what i mean...
    sorry for all the hassle... :(
    public class part3
         * Mergesort algorithm.
         * @param a an array of Comparable items.
        public static void mergeSort( Comparable [ ] a ) {
            Comparable [ ] tmpArray = new Comparable[ a.length ];
            mergeSort( a, tmpArray, 0, a.length - 1 );
         * Internal method that makes recursive calls.
         * @param a an array of Comparable items.
         * @param tmpArray an array to place the merged result.
         * @param left the left-most index of the subarray.
         * @param right the right-most index of the subarray.
        private static void mergeSort( Comparable [ ] a, Comparable [ ] tmpArray,
                int left, int right ) {
            if( left < right ) {
                int center = ( left + right ) / 2;
                mergeSort( a, tmpArray, left, center );
                mergeSort( a, tmpArray, center + 1, right );
                merge( a, tmpArray, left, center + 1, right );
         * Internal method that merges two sorted halves of a subarray.
         * @param a an array of Comparable items.
         * @param tmpArray an array to place the merged result.
         * @param leftPos the left-most index of the subarray.
         * @param rightPos the index of the start of the second half.
         * @param rightEnd the right-most index of the subarray.
        private static void merge( Comparable [ ] a, Comparable [ ] tmpArray,
                int leftPos, int rightPos, int rightEnd ) {
            int leftEnd = rightPos - 1;
            int tmpPos = leftPos;
            int numElements = rightEnd - leftPos + 1;
            // Main loop
            while( leftPos <= leftEnd && rightPos <= rightEnd )
                if( a[ leftPos ].compareTo( a[ rightPos ] ) <= 0 )
                    tmpArray[ tmpPos++ ] = a[ leftPos++ ];
                else
                    tmpArray[ tmpPos++ ] = a[ rightPos++ ];
            while( leftPos <= leftEnd )    // Copy rest of first half
                tmpArray[ tmpPos++ ] = a[ leftPos++ ];
            while( rightPos <= rightEnd )  // Copy rest of right half
                tmpArray[ tmpPos++ ] = a[ rightPos++ ];
            // Copy tmpArray back
            for( int i = 0; i < numElements; i++, rightEnd-- )
                a[ rightEnd ] = tmpArray[ rightEnd ];
    }

  • Hi, I have small problem, for some time in music area I had two folders to use 1. Apple loops for soundtrack pro 2. Final Cut pro sound effects now both are gray and with out content may I know what happend

    Hi, I have small problem, for some time in music area I had two folders to use 1. Apple loops for soundtrack pro 2. Final Cut pro sound effects now both are gray and with out content may I know what happend

    I just went through this and it appears that my Focusrite Saffire was the culprit. I connected all the outputs on the focusrite according to the way the jacsk on the back were labeled and then set up the multichannel speaker setup to match. Then I went into STP, created a pink noise clip and panned it around, the LFE, center and rears were not in the right place.
    I reconnected the hardware to match the 5.1 pan pot in STP then changed the multichannel speaker setup to match. Everything appears to be correct now but I would have loved to have been able to just assigned the output busses to correct outputs in the saffire.
    Next step is to pan that pink noise around with my SPL meter to calibrate the room.

  • Encoding problem while reading binary data from MQ-series

    Dear all,
    we are running on 7.0 and we have an encoding problem while reading binary data from MQ-series. Because we are getting flat strings from queue we use module "Plain2ML" (MessageTransformBean) for wrapping xml-elements around the incoming data.
    The MQ-Series-Server is using CCSID 850, which we configured in connection parameters in communication channel (both parameters for Queuemanager CCSID and also CCSID of target).If there are special characters in the message (which HEX-values differ from codepage to codepage) we get errors in our adapter while executing, please see stack-trace for further analysis below.
    It seems to us that
    1. method ByteToCharUTF8.convert() expects UTF-8 in binary data
    2. Both CCSID parameters are not used anyway in JMS-adapter
    How can we solve this problem without changing anything on MQ-site?
    Here is the stack-trace:
    Catching com.sap.aii.af.mp.module.ModuleException: Transform: failed to execute the transformation: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
        at com.sap.aii.af.modules.trans.MessageTransformBean.throwModuleException(MessageTransformBean.java:453)
        at com.sap.aii.af.modules.trans.MessageTransformBean.process(MessageTransformBean.java:387)
        at com.sap.aii.af.mp.module.ModuleLocalLocalObjectImpl0_0.process(ModuleLocalLocalObjectImpl0_0.java:103)
        at com.sap.aii.af.mp.ejb.ModuleProcessorBean.process(ModuleProcessorBean.java:292)
        at com.sap.aii.af.mp.processor.ModuleProcessorLocalLocalObjectImpl0_0.process(ModuleProcessorLocalLocalObjectImpl0_0.java:103)
        at com.sap.aii.adapter.jms.core.channel.filter.SendToModuleProcessorFilter.filter(SendToModuleProcessorFilter.java:84)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.ConvertBinaryToXiMessageFilter.filter(ConvertBinaryToXiMessageFilter.java:304)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.ConvertJmsMessageToBinaryFilter.filter(ConvertJmsMessageToBinaryFilter.java:112)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.InboundDuplicateCheckFilter.filter(InboundDuplicateCheckFilter.java:87)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.TxManagerFilter.filterSend(TxManagerFilter.java:123)
        at com.sap.aii.adapter.jms.core.channel.filter.TxManagerFilter.filter(TxManagerFilter.java:59)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.DynamicConfigurationFilter.filter(DynamicConfigurationFilter.java:72)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.PmiAgentFilter.filter(PmiAgentFilter.java:66)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.InboundCorrelationFilter.filter(InboundCorrelationFilter.java:60)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.JmsHeadersProfileFilter.filter(JmsHeadersProfileFilter.java:59)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageInvocationsFilter.filter(MessageInvocationsFilter.java:89)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.JarmMonitorFilter.filter(JarmMonitorFilter.java:57)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.ThreadNamingFilter.filter(ThreadNamingFilter.java:62)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.SenderChannelImpl.doReceive(SenderChannelImpl.java:263)
        at com.sap.aii.adapter.jms.core.channel.ChannelImpl.receive(ChannelImpl.java:437)
        at com.sap.aii.adapter.jms.core.connector.MessageListenerImpl.onMessage(MessageListenerImpl.java:36)
        at com.ibm.mq.jms.MQMessageConsumer$FacadeMessageListener.onMessage(MQMessageConsumer.java:399)
        at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl$JmsProviderMessageListener.onMessage(JmsMessageConsumerImpl.java:904)
        at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageConsumer.receiveAsync(MQMessageConsumer.java:4249)
        at com.ibm.msg.client.wmq.v6.jms.internal.SessionAsyncHelper.run(SessionAsyncHelper.java:537)
        at java.lang.Thread.run(Thread.java:770)
    Caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
        at com.sap.aii.messaging.adapter.Conversion.service(Conversion.java:714)
        at com.sap.aii.af.modules.trans.MessageTransformBean.processTransform(MessageTransformBean.java:538)
        at com.sap.aii.af.modules.trans.MessageTransformBean.processTransform(MessageTransformBean.java:528)
        at com.sap.aii.af.modules.trans.MessageTransformBean.processTransform(MessageTransformBean.java:471)
        at com.sap.aii.af.modules.trans.MessageTransformBean.process(MessageTransformBean.java:364)
        ... 36 more
    Caused by: sun.io.MalformedInputException
        at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java:270)
        at sun.nio.cs.StreamDecoder$ConverterSD.convertInto(StreamDecoder.java:287)
        at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:337)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:223)
        at java.io.InputStreamReader.read(InputStreamReader.java:208)
        at java.io.BufferedReader.fill(BufferedReader.java:153)
        at java.io.BufferedReader.readLine(BufferedReader.java:316)
        at java.io.LineNumberReader.readLine(LineNumberReader.java:176)
        at com.sap.aii.messaging.adapter.Conversion.convertPlain2XML(Conversion.java:310)
        at com.sap.aii.messaging.adapter.Conversion.service(Conversion.java:709)
        ... 40 more
    Any ideas?
    Kind regards, Stefan

    Hi Stefan,
    for the first MTB now we are using only one parameter: Transform.ContentType = text/plain;charset="ISO-8859-1"
    The second MTB, which does the XML-Wrapping, is configured like this:
    Transform.Class = com.sap.aii.messaging.adapter.Conversion
    Transform.ContentType = application/xml
    xml.conversionType = SimplePlain2XML
    xml.fieldNames = value
    xml.fieldSeparator = §%zulu§%
    xml.processFieldNames = fromConfiguration
    xml.structureTitle = payload
    Both CCSID configuration parameters from the "Source"-Tab we've set to 850.
    Now, we don't get an error anymore - sun.io.malformedInputException - , but, unfortunately, now special character conversion succeeded (we need an "ß" and we get an ISO-HEX-E1 -> á).  E1 is (different from ISO) an "ß" in 850.
    Any ideas?

  • Oracle Text - Problem with filtering binary documents (.doc, .pdf, etc...)

    Hi, I have a problem with filtering binary documents (.doc, .pdf, etc...). I use SQL*PLUS for remote access to Oracle 10.2 on Linux and I create table:
    CREATE TABLE test (id NUMBER PRIMARY KEY, text VARCHAR2(100));
    I insert to this table:
    INSERT into test values(1, 'PATH/text1.doc‘);
    INSERT into test values(2,'PATH/text2.doc‘);
    and then:
    CREATE INDEX test_index ON test(text) indextype is ctxsys.context
    parameters (’datastore ctxsys.file_datastore
    filter ctxsys.auto_filter’);
    Message "Index created" is displayed, but objects: DR$test_index$I, DR$test_index$K, DR$test_index$N, DR$test_index$R and DR$test_index$P are empty => index wasn´t created probably.
    I don´t know, where is bug, either bug is somewhere in this code or on the server (wrong installation oracle or constraint privileges). Do you know in what is bug?

    The following is an excerpt from the 10g online documentation. Note the items that I have put in bold.
    "FILE_DATASTORE
    The FILE_DATASTORE type is used for text stored in files accessed through the local file system.
    Note:
    FILE_DATASTORE may not work with certain types of remote mounted file systems.
    FILE_DATASTORE has the following attribute(s):
    Table 2-4 FILE_DATASTORE Attributes
    Attribute Attribute Value
    path path1:path2:pathn
    path
    Specify the full directory path name of the files stored externally in a file system. When you specify the full directory path as such, you need only include file names in your text column.
    You can specify multiple paths for path, with each path separated by a colon (:) on UNIX and semicolon(;) on Windows. File names are stored in the text column in the text table.
    If you do not specify a path for external files with this attribute, Oracle Text requires that the path be included in the file names stored in the text column.
    PATH Attribute Limitations
    The PATH attribute has the following limitations:
    If you specify a PATH attribute, you can only use a simple filename in the indexed column. You cannot combine the PATH attribute with a path as part of the filename. If the files exist in multiple folders or directories, you must leave the PATH attribute unset, and include the full file name, with PATH, in the indexed column.
    On Windows systems, the files must be located on a local drive. They cannot be on a remote drive, whether the remote drive is mapped to a local drive letter."
    With accessible paths and files, you get something like:
    SCOTT@orcl_11g> CREATE TABLE test (id NUMBER PRIMARY KEY, text VARCHAR2(100));
    Table created.
    SCOTT@orcl_11g>
    SCOTT@orcl_11g>
    SCOTT@orcl_11g> INSERT into test values(1,'c:\oracle11g\banana.pdf');
    1 row created.
    SCOTT@orcl_11g> INSERT into test values(2,'c:\oracle11g\cranberry.pdf');
    1 row created.
    SCOTT@orcl_11g>
    SCOTT@orcl_11g> CREATE INDEX test_index ON test(text) indextype is ctxsys.context
      2  parameters ('datastore ctxsys.file_datastore
      3  filter ctxsys.auto_filter');
    Index created.
    SCOTT@orcl_11g>
    SCOTT@orcl_11g> select count(*) from dr$test_index$i
      2  /
      COUNT(*)
           608
    SCOTT@orcl_11g> In the following, I used a non-existent path and non-existent file name, which produces the same results as when you use a remote path that does not exist locally.
    SCOTT@orcl_11g> CREATE TABLE test (id NUMBER PRIMARY KEY, text VARCHAR2(100));
    Table created.
    SCOTT@orcl_11g>
    SCOTT@orcl_11g>
    SCOTT@orcl_11g> INSERT into test values(3,'c:\nosuchpath\nosuchfile.pdf');
    1 row created.
    SCOTT@orcl_11g>
    SCOTT@orcl_11g> CREATE INDEX test_index ON test(text) indextype is ctxsys.context
      2  parameters ('datastore ctxsys.file_datastore
      3  filter ctxsys.auto_filter');
    Index created.
    SCOTT@orcl_11g>
    SCOTT@orcl_11g> select count(*) from dr$test_index$i
      2  /
      COUNT(*)
             0
    SCOTT@orcl_11g>

  • Problem with installing free App (Everything is fine, bur we had a small problem getting your license)

    Hello,
    We have free App for SharePoint Online. Some our customers have problems with the installation. After install they see an issue with obtaining a license which should be free.
    "Everything is fine, bur we had a small problem getting your license. Please go back to the SharePoint store to get this app again and you won't be charget for it."
    See the screen:
    How can we resolve the issue?
    Thank you!
    Our App: "Resource Reservation"
    https://store.office.com/resource-reservation-WA104276770.aspx

    Hi Gabe,
    First, please check the suggestion above is helpful. I also suggest you removing all version of Office and re-install Office 2013.
    We can try to run the application as an administrator and check if it works.
     1. Right click the shortcut of the application or the main application.
     2. Select properties.
     3. Select compatibility tab and select "Run this program as an administrator."
    If there is anything I can do for you about this issue, don't hesitate to tell me.
    Best regards,
    Greta Ge
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Small problem in refreshing JFrame

    Please help me in sorting out this small problem. I called a function on a button click. In that function i tried to change the text on a button initially then i have some code to execute and then again i set other text to the same button. But iam not able to see the initial text while execution. It is as follows
    jbut.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae)
    connectServer(); //The function that i called
    //conncetServer function
    public void connectServer
    jbut.setText("Please Wait");
    // jbut.validate();
    try{
    Thread.sleep(10000);
    }catch(Exception e)
    jbut.setText("Disconnect");
    // jbut.validate(); This i tried
    But i am not able to see the please wait label on the screen i tried in several ways. can anyone of you tell me how to solve it..

    Hi, Problem is Gui manages its own Thread, so once u invoke a process, until it finishes GUI won't get refreshed. 2 ways to handle it.
    1. Either use SwingUtilities.invokeLater method
    Example Code.
    jbut.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae)
    jbut.setText("Please Wait...");// set the text
    Runnable connectServerThread = new Runnable(){
    public void run()
    connectServer();
    jbut.setText("");// return back to normal.
    SwingUtilities.invokeLater(connectServerThread);
    or
    2. Implement Runnable interface in ur class and invoke the same inside run method. It will definitely work since i checked it.
    Example code.
    Thread connectServerThread = null;
    jbut.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae)
    connectServerThread = new Thread(this);
    connectServerThread.start();
    public void run()
    // set the label visible here.
    jbut.setText("Please Wait...");
    // invoke server process.
    connectServer();
    // hide the label or button here.
    jbut.setText("");
    Sreni.

  • Console CatOS MOTD small problem

    Hello,
    I have a small problem when connecting to a console port.
    We make a connection via a terminalserver to the console port of a 6500 (Tacacs+). I like to have a banner before I login on CatOs. The problem with a MOTD is that only the banner is shown after a logout.
    Any suggestions?
    Greetings.
    Jeroen

    for some reason, this doesn't work for console access. It does work for direct telnet access.
    Maybe there is some problem with remote access via a terminalserver to the console port. Do i have to change something on the line (TTY) ports of the terminalserver?
    switch> (enable) set banner telnet ?
    disable Suppress the default Cisco Systems Console banner
    enable Display the default Cisco Systems Console banner

  • Many small problems in Mavericks

    When user experience many small problem in daily work, I feel the design is failed.
    Memory management has a lot of problem, I feel my macbook is abnormal slow after I upgraded to Mavericks. Sometime, I need to wait for several sec to get what I want.
    I think this problem is extreme important for OS.
    When I want to start a probelm, click once, no response, click twice, pop-up 2 times after 5 sec.
    Then i change my way of work, clock one time, work on other task. 5 sec later, multi desktop switch the desktop to the starting program. Then, I don't know what I was doing.
    Another is sound problem, sound doesn't work sometime and need some kind of procedure to get it back.
    Please don't ask me do something to solve the problem everytime when it happen. It is OS task to work it properly.
    Whatever how many great feature you added is meaningless if user daily experience is bad.

    1. This procedure is a diagnostic test. It changes nothing, for better or worse, and therefore will not, in itself, solve your problem.
    2. If you don't already have a current backup, back up all data before doing anything else. The backup is necessary on general principle, not because of anything in the test procedure. There are ways to back up a computer that isn't fully functional. Ask if you need guidance.
    3. Below are instructions to run a UNIX shell script, a type of program. All it does is to gather information about the state of your computer. That information goes nowhere unless you choose to share it on this page. However, you should be cautious about running any kind of program (not just a shell script) at the request of a stranger on a public message board. If you have doubts, search this site for other discussions in which this procedure has been followed without any report of ill effects. If you can't satisfy yourself that the instructions are safe, don't follow them.
    Here's a summary of what you need to do, if you choose to proceed: Copy a line of text from this web page into the window of another application. Wait for the script to run. It usually takes a couple of minutes. Then paste the results, which will have been copied automatically, back into a reply on this page. The sequence is: copy, paste, wait, paste again. Details follow.
    4. You may have started the computer in "safe" mode. Preferably, these steps should be taken in “normal” mode. If the system is now in safe mode and works well enough in normal mode to run the test, restart as usual. If you can only test in safe mode, do that.
    5. If you have more than one user, and the one affected by the problem is not an administrator, then please run the test twice: once while logged in as the affected user, and once as an administrator. The results may be different. The user that is created automatically on a new computer when you start it for the first time is an administrator. If you can't log in as an administrator, test as the affected user. Most personal Macs have only one user, and in that case this section doesn’t apply.
    6. The script is a single long line, all of which must be selected. You can accomplish this easily by triple-clicking  anywhere in the line. The whole line will highlight, though you may not see all of it in your browser, and you can then copy it. If you try to select the line by dragging across the part you can see, you won't get all of it.
    Triple-click anywhere in the line of text below on this page to select it:
    PATH=/usr/bin:/bin:/usr/sbin:/sbin; clear; Fb='%s\n\t(%s)\n'; Fm='\n%s\n\n%s\n'; Fr='\nRAM details\n%s\n'; Fs='\n%s: %s\n'; Fu='user %s%%, system %s%%'; PB="/usr/libexec/PlistBuddy -c Print"; A () { [[ a -eq 0 ]]; }; M () { find -L "$d" -type f | while read f; do file -b "$f" | egrep -lq XML\|exec && echo $f; done; }; Pc () { o=`grep -v '^ *#' "$2"`; Pm "$1"; }; Pm () { [[ "$o" ]] && o=`sed '/^ *$/d; s/^ */   /' <<< "$o"` && printf "$Fm" "$1" "$o"; }; Pp () { o=`$PB "$2" | awk -F'= ' \/$3'/{print $2}'`; Pm "$1"; }; Ps () { o=`echo $o`; [[ ! "$o" =~ ^0?$ ]] && printf "$Fs" "$1" "$o"; }; R () { o=; [[ r -eq 0 ]]; }; SP () { system_profiler SP${1}DataType; }; id | grep -qw '80(admin)'; a=$?; A && sudo true; r=$?; t=`date +%s`; clear; { A || echo $'No admin access\n'; A && ! R && echo $'No root access\n'; SP Software | sed '8!d;s/^ *//'; o=`SP Hardware | awk '/Mem/{print $2}'`; o=$((o<4?o:0)); Ps "Total RAM (GB)"; o=`SP Memory | sed '1,5d; /[my].*:/d'`; [[ "$o" =~ s:\ [^O]|x([^08]||0[^2]8[^0]) ]] && printf "$Fr" "$o"; o=`SP Diagnostics | sed '5,6!d'`; [[ "$o" =~ Pass ]] || Pm "POST"; for b in Thunderbolt USB; do o=`SP $b | sed -En '1d; /:$/{s/ *:$//;x;s/\n//p;}; /^ *V.* [0N].* /{s/ 0x.... //;s/[()]//g;s/\(.*: \)\(.*\)/ \(\2\)/;H;}; /Apple|SCSM/{s/.//g;h;}'`; Pm $b; done; o=`pmset -g therm | sed 's/^.*C/C/'`; [[ "$o" =~ No\ th|pms ]] && o=; Pm "Thermal conditions"; o=`pmset -g sysload | grep -v :`; [[ "$o" =~ =\ [^GO] ]] || o=; Pm "System load advisory"; o=`nvram boot-args | awk '{$1=""; print}'`; Ps "boot-args"; d=(/ ""); D=(System User); E=; for i in 0 1; do o=`cd ${d[$i]}L*/L*/Dia* || continue; ls | while read f; do [[ "$f" =~ h$ ]] && grep -lq "^Thread c" "$f" && e=" *" || e=; awk -F_ '!/ag$/{$NF=a[split($NF,a,".")]; print $0 "'"$e"'"}' <<< "$f"; done | tail`; Pm "${D[$i]} diagnostics"; done; [[ "$o" =~ \*$ ]] && printf $'\n* Code injection\n'; o=`syslog -F bsd -k Sender kernel -k Message CReq 'GPU |hfs: Ru|I/O e|last value [1-9]|n Cause: -|NVDA\(|pagin|SATA W|ssert|timed? ?o' | tail -n25 | awk '/:/{$4=""; $5=""};1'`; Pm "Kernel messages"; o=`df -m / | awk 'NR==2 {print $4}'`; o=$((o<5120?o:0)); Ps "Free space (MiB)"; o=$(($(vm_stat | awk '/eo/{sub("\\.",""); print $2}')/256)); o=$((o>=1024?o:0)); Ps "Pageouts (MiB)"; s=( `sar -u 1 10 | sed '$!d'` ); [[ s[4] -lt 85 ]] && o=`printf "$Fu" ${s[1]} ${s[3]}` || o=; Ps "Total CPU usage" && { s=(`ps acrx -o comm,ruid,%cpu | sed '2!d'`); o=${s[2]}%; Ps "CPU usage by process \"$s\" with UID ${s[1]}"; }; s=(`top -R -l1 -n1 -o prt -stats command,uid,prt | sed '$!d'`); s[2]=${s[2]%[+-]}; o=$((s[2]>=25000?s[2]:0)); Ps "Mach ports used by process \"$s\" with UID ${s[1]}"; o=`kextstat -kl | grep -v com\\.apple | cut -c53- | cut -d\< -f1`; Pm "Loaded extrinsic kernel extensions"; R && o=`sudo launchctl list | sed 1d | awk '!/0x|com\.(apple|openssh|vix\.cron)|org\.(amav|apac|calendarse|cups|dove|isc|ntp|post[fg]|x)/{print $3}'`; Pm "Extrinsic system jobs"; o=`launchctl list | sed 1d | awk '!/0x|com\.apple|org\.(x|openbsd)|\.[0-9]+$/{print $3}'`; Pm "Extrinsic agents"; o=`for d in {/,}L*/Lau*; do M; done | grep -v com\.apple\.CSConfig | while read f; do ID=$($PB\ :Label "$f") || ID="No job label"; printf "$Fb" "$f" "$ID"; done`; Pm "launchd items"; o=`for d in /{S*/,}L*/Star*; do M; done`; Pm "Startup items"; o=`find -L /S*/L*/E* {/,}L*/{A*d,Compon,Ex,In,Keyb,Mail/B,P*P,Qu*T,Scripti,Servi,Spo}* -type d -name Contents -prune | while read d; do ID=$($PB\ :CFBundleIdentifier "$d/Info.plist") || ID="No bundle ID"; [[ "$ID" =~ ^com\.apple\.[^x]|Accusys|ArcMSR|ATTO|HDPro|HighPoint|driver\.stex|hp-fax|\.hpio|JMicron|microsoft\.MDI|print|SoftRAID ]] || printf "$Fb" "${d%/Contents}" "$ID"; done`; Pm "Extrinsic loadable bundles"; o=`find -L /u*/{,*/}lib -type f | while read f; do file -b "$f" | grep -qw shared && ! codesign -v "$f" && echo $f; done`; Pm "Unsigned shared libraries"; o=`for e in DYLD_INSERT_LIBRARIES DYLD_LIBRARY_PATH; do launchctl getenv $e; done`; Pm "Environment"; o=`find -L {,/u*/lo*}/e*/periodic -type f -mtime -10d`; Pm "Modified periodic scripts"; o=`scutil --proxy | grep Prox`; Pm "Proxies"; o=`scutil --dns | awk '/r\[0\] /{if ($NF !~ /^1(0|72\.(1[6-9]|2[0-9]|3[0-1])|92\.168)\./) print $NF; exit}'`; Ps "DNS"; R && o=`sudo profiles -P | grep : | wc -l`; Ps "Profiles"; f=auto_master; [[ `md5 -q /etc/$f` =~ ^b166 ]] || Pc $f /etc/$f; for f in fstab sysctl.conf crontab launchd.conf; do Pc $f /etc/$f; done; Pc "hosts" <(grep -v 'host *$' /etc/hosts); Pc "User launchd" ~/.launchd*; R && Pc "Root crontab" <(sudo crontab -l); Pc "User crontab" <(crontab -l); R && o=`sudo defaults read com.apple.loginwindow LoginHook`; Pm "Login hook"; Pp "Global login items" /L*/P*/loginw* Path; Pp "User login items" L*/P*/*loginit* Name; Pp "Safari extensions" L*/Saf*/*/E*.plist Bundle | sed -E 's/(\..*$|-[1-9])//g'; o=`find ~ $TMPDIR.. \( -flags +sappnd,schg,uappnd,uchg -o ! -user $UID -o ! -perm -600 \) | wc -l`; Ps "Restricted user files"; cd; o=`SP Fonts | egrep "Valid: N|Duplicate: Y" | wc -l`; Ps "Font problems"; o=`find L*/{Con,Pref}* -type f ! -size 0 -name *.plist | while read f; do plutil -s "$f" >&- || echo $f; done`; Pm "Bad plists"; d=(Desktop L*/Keyc*); n=(20 7); for i in 0 1; do o=`find "${d[$i]}" -type f -maxdepth 1 | wc -l`; o=$((o<=n[$i]?0:o)); Ps "${d[$i]##*/} file count"; done; o=$((`date +%s`-t)); Ps "Elapsed time (s)"; } 2>/dev/null | pbcopy; exit 2>&-
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    7. Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    When you launch Terminal, a text window will open with a line already in it, ending either in a dollar sign ($) or a percent sign (%). If you get the percent sign, enter
    exec bash
    in the window and press return. You should then get a new line ending in a dollar sign.
    Click anywhere in the Terminal window and paste (command-V). The text you pasted should vanish immediately. If it doesn't, press the return key.
    If you're logged in as an administrator, you'll be prompted for your login password. Nothing will be displayed when you type it. You will not see the usual dots in place of typed characters. Make sure caps lock is off. Type carefully and then press return. You may get a one-time warning to be careful. If you make three failed attempts to enter the password, the test will run anyway, but it will produce less information. In most cases, the difference is not important. If you don't know your password, or if you prefer not to enter it, just press return three times at the password prompt.
    If you're not logged in as an administrator, you won't be prompted for a password. The test will still run. It just won't do anything that requires administrator privileges.
    The test may take a few minutes to run, depending on how many files you have and the speed of the computer. A computer that's abnormally slow may take longer to run the test. While it's running, there will be nothing in the Terminal window and no indication of progress. Wait for the line "[Process completed]" to appear. If you don't see it within half an hour or so, the test probably won't complete in a reasonable time. In that case, close the Terminal window and report your results. No harm will be done.
    8. When the test is complete, quit Terminal. The results will have been copied to the Clipboard automatically. They are not shown in the Terminal window. Please don't copy anything from there. All you have to do is start a reply to this comment and then paste by pressing command-V again.
    If any private information, such as your name or email address, appears in the results, anonymize it before posting. Usually that won't be necessary.
    When you post the results, you might see the message, "You have included content in your post that is not permitted." It means that the forum software has misidentified something in the post as a violation of the rules. If it happens, please post the test results on Pastebin, then post a link here to the page you created.
    Note: This is a public forum, and others may give you advice based on the results of the test. They speak only for themselves, and I don't necessarily agree with them.
    Copyright © 2014 Linc Davis. As the sole author of this work, I reserve all rights to it except as provided in the Terms of Use of Apple Support Communities ("ASC"). Readers of ASC may copy it for their own personal use. Neither the whole nor any part may be redistributed.

  • Small problem

    I am very new to java, and having a small problem:
    When i click on a button, i want the buttons name to be displayed
    in a text field, saying "You have pressed" then the name of the button.
    but i want to do this with multiple buttons and not just one button, so i want to be able to press any button and its name to be displayed in a text field.
    your help will be appreciated

    Sorry if i did not display code, thanks to all those who replied, heres some of the code, if i have gone wrong in any where could you please help me too correct, i think you will have a general idea of what i am trying to achieve:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.Button;
    import java.lang.Object;
    public class Calculator extends Applet implements ActionListener
    Button b1 + b2 + b3 + b4 + b5 + b6 + b7 + b8 + b9 + b10 + b11 + b12 + b13 + b14 + b15 + b16 + b17 + b18;
    setLayout(new GridLayout(5,4));
    public void init( );
    Button b1 = new Button( "1" );
    b1.addActionListener ( this );
    add(b1);
    Button b2 = new Button( "2" );
    b2.addActionListener ( this );
    add( b2 );
    Button b3 = new Button( "3" );
    b3.addActionListener ( this );
    add( b3 );
    Button b4 = new Button( "4" );
    b4.addActionListener ( this );
    add( b4 );
    Button b5 = new Button( "5" );
    b5.addActionListener ( this );
    add( b5 );
    Button b6 = new Button( "6" );
    b6.addActionListener ( this );
    add( b6 );
    Button b7 = new Button( "7" );
    b7.addActionListener ( this );
    add( b7 );
    Button b8 = new Button( "8" );
    b8.addActionListener ( this );
    add( b8 );
    Button b9 = new Button( "9" );
    b9.addActionListener ( this );
    add( b9 );
    Button b10 = new Button( "10" );
    b10.addActionListener ( this );
    add( b10 );
    Button b11 = new Button( "+" );
    b11.addActionListener ( this );
    add( b11 );
    Button b12 = new Button( "-" );
    b12.addActionListener (this );
    add( b12 );
    Button b13 = new Button( "x" );
    b13.addActionListener ( this );
    add( b13 );
    Button b14 = new Button( "/" );
    b14.addActionListener (this );
    add( b14 );
    Button b15 = new Button( "MC" );
    b15.addActionListener ( this );
    add( b15 );
    Button b16 = new Button( "MR" );
    b16.addActionListener ( this );
    add( b16 );
    Button b17 = new Button( "M+" );
    b17.addActionListener ( this );
    add( b17 );
    Button b18 = new Button( "c" );
    b18.addActionListener ( this );
    add( b18 );
    after this i get stuck, i don't know how to create a small text field that syas you have pressed (then the button name) if this coding is wrong, can you please explain what i have done wrong!
    Thanks

  • Small problem led to big problem

    I had a few contacts that existed on my Centro which did not exist on my desktop.  So I contacted the Palm Chat Support.  The person who helped me had me perform several things which eventually led to my phone getting stuck in a loop.  Things were not getting better so I asked to be transferred to a supervisor.  The supervisor told me the only solution was a hard reset.  I finally agreed to this.  Now when I reinstall any applications (not third-party) such as calendar or address book, my phone won't come on.  I can see the calendar or the address book but when I go to turn on the phone, it goes back into the endless loop.  A soft reset will not take it out of the loop, only a hard reset.  When I do a hard reset, I then have the ability to use the phone again but I have no data in my calendar, address book, etc.  So essentially I have either a PDA or a Phone--but I can't have both.  This started as a very small problem (a few missing contacts which I could have probably/should have probably just manually entered into the desktop).  Now I have a very big problem, simply b/c of what I was directed to do by Support.  Is there any hope?
    Post relates to: Centro (AT&T)

    There could be to issues going on here that you are having this result. One thing could be corrupted data such as your contacts or calendar, the other could be corrupted programs that are coming back from a hotsync.
    The first I would like to troubleshoot as it is the easiest. To fix this what we need to do is hard reset your device. The instructions to do that is here http://kb.palm.com/wps/portal/kb/common/article/887_en.html this tells you how to do all types of resets. Also, what we need to do is rename your backup folder. What this folder is, it hold all your programs from the last time you synced your PC. On your computer go here
    Palm Desktop 4.2 and below
    My Computer--> C drive --> Program files --> Palm/PalmOne--> your hotsync username
    Palm Desktop 6.2.2
    My Documents/Documents --> Palm OS Desktop --> your hotsync username
    Right click on your backup folder and rename it to "backupOld". Resync your device to the same user name and you will get all your contacts, calendar, tasks, and memos.
    You can install the programs again but make sure they are compatible with the device. Also try one program again and wait 24 hours to see if the same thing happens again. This way you know what program is causing the issue.
    If you have any questions about this or if this does not work please post back.

  • Problem with loading Binary Stream as image

    Hi all,
    I'm facing problem of loading Binary Stream as image.
    from source system we are getting image in XML file as string (i.e binary stream).
    Now i want to load that string again into table as BLOB. i am able to load in to BLOB column but not able to view image properly. it's giving error like "Image has not been decoded properly from binary stream".
    How can i solve this issues?
    Any help.
    thanks in advance.
    Vinay

    michali7x4s1 wrote:
    Thats a code i found somewhere, tried to check how some things work.Have you used exceptions before? If not, please read the sun tutorial on them as they are very very important. Also, whether this is your code or someone else's doesn't matter as it's yours now, and you would be best served by never throwing out exceptions as is done in this code. It's like driving with a blindfold on and then wondering why you struck the tree. It's always best to go through the tutorials to understand code before using it. If it were my project, I'd do it in Swing, not AWT. Fortunately Sun has a great tutorial on how to code in Swing, and I suggest you head there as well. Best of luck.

  • Small problem really annoying! Reinstall does not fix issue!!

    Hi there Small problem really annoying! Reinstall does not fix issue!!
    The Next button when on Taskbar is showing back!
    Weird but really annoying!!
    Windows 8.1 64 AMD Quad Core Black

    Nothing no help?

Maybe you are looking for