Tnslsnr binary in CRS_HOME and ORACLE_HOME

DB version:11.2.0.2 (2 node RAC)
I can see that listener binary tnslsnr is present in GRID_HOME and ORACLE_HOME. Which one should I be using?

Hi,
per default the listener is configured out of the GI Home - and it is also recommended to use this one (since GI will always have the latest patch in the stack).
However someone can configure additional listeners from DB Home - though not recommended.
Regards
Sebastian

Similar Messages

  • Using srvctl from CRS_HOME or ORACLE_HOME

    Hi
    if both CRS_HOME and ORACLE_HOME are at the same patch release,
    is there any issues with using srvctl to perform maintenance tasks from the CRS_HOME
    rather than say the ORACLE_HOME ?
    Many thanks

    Hi
    Here are the steps I have done. In first case I am using ORACLE_HOME and in second case I am using CRS_HOME.
    So, we can use any of the home. But I normally use ORACLE_HOME.
    Hope this Helps
    Regards
    oracle@rac01<75>:/u01/app/oracle> source ~/.cshrc
    Oracle Homes:
    1. crs
    2. db_1
    Which ORACLE_HOME:
    1
    oracle@rac01<76>:/u01/app/oracle> echo $ORACLE_HOME
    /u01/app/oracle/product/10.2/crs
    oracle@rac01<77>:/u01/app/oracle> $ORACLE_HOME/bin/crs_stat -t
    Name Type Target State Host
    ora....DB1.srv application ONLINE ONLINE rac01
    ora....DB2.srv application ONLINE ONLINE rac02
    ora....ACDB.cs application ONLINE ONLINE rac01
    ora....B1.inst application ONLINE ONLINE rac01
    ora....B2.inst application ONLINE ONLINE rac02
    ora.RACDB.db application ONLINE ONLINE rac01
    ora....SM1.asm application ONLINE ONLINE rac01
    ora....01.lsnr application ONLINE ONLINE rac01
    ora.rac01.gsd application ONLINE ONLINE rac01
    ora.rac01.ons application ONLINE ONLINE rac01
    ora.rac01.vip application ONLINE ONLINE rac01
    ora....SM2.asm application ONLINE ONLINE rac02
    ora....02.lsnr application ONLINE ONLINE rac02
    ora.rac02.gsd application ONLINE ONLINE rac02
    ora.rac02.ons application ONLINE ONLINE rac02
    ora.rac02.vip application ONLINE ONLINE rac02
    oracle@rac01<78>:/u01/app/oracle> echo $PATH
    /u01/app/oracle/product/10.2/crs/bin:/u01/app/oracle/product/10.2/crs/opmn/bin:/usr/bin:/etc:/usr/kerberos/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/X11R6/bin:/usr/ucb:/bin:/usr/local/bin:/u01/app/scripts
    oracle@rac01<79>:/u01/app/oracle> source ~/.cshrc
    Oracle Homes:
    1. crs
    2. db_1
    Which ORACLE_HOME:
    2
    Databases in oratab
    1. +ASM1
    2. RACDB1
    Which database:
    2
    oracle@rac01<80>:/u01/app/oracle> echo $ORACLE_HOME
    /u01/app/oracle/product/10.2/db_1
    oracle@rac01<82>:/u01/app/oracle> echo $PATH
    /u01/app/oracle/product/10.2/db_1/bin:/u01/app/oracle/product/10.2/db_1/opmn/bin:/usr/bin:/etc:/usr/kerberos/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/X11R6/bin:/usr/ucb:/bin:/usr/local/bin:/u01/app/scripts
    oracle@rac01<83>:/u01/app/oracle> srvctl stop instance -d RACDB -i RACDB1
    oracle@rac01<84>:/u01/app/oracle> source ~/.cshrc
    Oracle Homes:
    1. crs
    2. db_1
    Which ORACLE_HOME:
    1
    oracle@rac01<85>:/u01/app/oracle> $ORACLE_HOME/bin/crs_stat -t
    Name Type Target State Host
    ora....DB1.srv application ONLINE OFFLINE
    ora....DB2.srv application ONLINE ONLINE rac02
    ora....ACDB.cs application ONLINE ONLINE rac01
    ora....B1.inst application OFFLINE OFFLINE
    ora....B2.inst application ONLINE ONLINE rac02
    ora.RACDB.db application ONLINE ONLINE rac01
    ora....SM1.asm application ONLINE ONLINE rac01
    ora....01.lsnr application ONLINE ONLINE rac01
    ora.rac01.gsd application ONLINE ONLINE rac01
    ora.rac01.ons application ONLINE ONLINE rac01
    ora.rac01.vip application ONLINE ONLINE rac01
    ora....SM2.asm application ONLINE ONLINE rac02
    ora....02.lsnr application ONLINE ONLINE rac02
    ora.rac02.gsd application ONLINE ONLINE rac02
    ora.rac02.ons application ONLINE ONLINE rac02
    ora.rac02.vip application ONLINE ONLINE rac02
    oracle@rac01<86>:/u01/app/oracle> echo $ORACLE_HOME
    /u01/app/oracle/product/10.2/crs
    oracle@rac01<87>:/u01/app/oracle> echo $PATH
    /u01/app/oracle/product/10.2/crs/bin:/u01/app/oracle/product/10.2/crs/opmn/bin:/usr/bin:/etc:/usr/kerberos/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/X11R6/bin:/usr/ucb:/bin:/usr/local/bin:/u01/app/scripts
    oracle@rac01<88>:/u01/app/oracle> srvctl stop instance -d RACDB -i RACDB2
    oracle@rac01<89>:/u01/app/oracle> $ORACLE_HOME/bin/crs_stat -t
    Name Type Target State Host
    ora....DB1.srv application OFFLINE OFFLINE
    ora....DB2.srv application OFFLINE OFFLINE
    ora....ACDB.cs application OFFLINE OFFLINE
    ora....B1.inst application OFFLINE OFFLINE
    ora....B2.inst application OFFLINE OFFLINE
    ora.RACDB.db application OFFLINE OFFLINE
    ora....SM1.asm application ONLINE ONLINE rac01
    ora....01.lsnr application ONLINE ONLINE rac01
    ora.rac01.gsd application ONLINE ONLINE rac01
    ora.rac01.ons application ONLINE ONLINE rac01
    ora.rac01.vip application ONLINE ONLINE rac01
    ora....SM2.asm application ONLINE ONLINE rac02
    ora....02.lsnr application ONLINE ONLINE rac02
    ora.rac02.gsd application ONLINE ONLINE rac02
    ora.rac02.ons application ONLINE ONLINE rac02
    ora.rac02.vip application ONLINE ONLINE rac02
    oracle@rac01<90>:/u01/app/oracle> srvctl start instance -d RACDB -i RACDB2
    oracle@rac01<91>:/u01/app/oracle> $ORACLE_HOME/bin/crs_stat -t
    Name Type Target State Host
    ora....DB1.srv application OFFLINE OFFLINE
    ora....DB2.srv application OFFLINE OFFLINE
    ora....ACDB.cs application OFFLINE OFFLINE
    ora....B1.inst application OFFLINE OFFLINE
    ora....B2.inst application ONLINE ONLINE rac02
    ora.RACDB.db application ONLINE ONLINE rac01
    ora....SM1.asm application ONLINE ONLINE rac01
    ora....01.lsnr application ONLINE ONLINE rac01
    ora.rac01.gsd application ONLINE ONLINE rac01
    ora.rac01.ons application ONLINE ONLINE rac01
    ora.rac01.vip application ONLINE ONLINE rac01
    ora....SM2.asm application ONLINE ONLINE rac02
    ora....02.lsnr application ONLINE ONLINE rac02
    ora.rac02.gsd application ONLINE ONLINE rac02
    ora.rac02.ons application ONLINE ONLINE rac02
    ora.rac02.vip application ONLINE ONLINE rac02
    oracle@rac01<103>:/u01/app/oracle> $ORACLE_HOME/bin/crs_start ora.RACDB.RACDB.cs
    Attempting to start `ora.RACDB.RACDB.cs` on member `rac01`
    Start of `ora.RACDB.RACDB.cs` on member `rac01` succeeded.
    oracle@rac01<105>:/u01/app/oracle> $ORACLE_HOME/bin/crs_stat -t
    Name Type Target State Host
    ora....DB1.srv application ONLINE ONLINE rac01
    ora....DB2.srv application ONLINE ONLINE rac02
    ora....ACDB.cs application ONLINE ONLINE rac01
    ora....B1.inst application ONLINE ONLINE rac01
    ora....B2.inst application ONLINE ONLINE rac02
    ora.RACDB.db application ONLINE ONLINE rac01
    ora....SM1.asm application ONLINE ONLINE rac01
    ora....01.lsnr application ONLINE ONLINE rac01
    ora.rac01.gsd application ONLINE ONLINE rac01
    ora.rac01.ons application ONLINE ONLINE rac01
    ora.rac01.vip application ONLINE ONLINE rac01
    ora....SM2.asm application ONLINE ONLINE rac02
    ora....02.lsnr application ONLINE ONLINE rac02
    ora.rac02.gsd application ONLINE ONLINE rac02
    ora.rac02.ons application ONLINE ONLINE rac02
    ora.rac02.vip application ONLINE ONLINE rac02

  • TNSLSNR encountered a problem and needs to close error

    I  have taken Reliance Netconnect Datacard connection 4 days back. Since 4 days i have been trying to install Oracle 9.2 on windows, I keep on getting the error "TNSLSNR has encountered error and needs to close " during database creation from Database configuration Assistant . This is disturbing my SAP installation on Windows XP.
    The installation goes fine if i don't install the Netconnect software and use the internet.
    The thing is that Reliance Netconnect provides Dynamic Ipaddress.
    Has any got any idea why listener is getting stopped automatically when i install Netconnect software and use the internet?
    Do i need to change anything in listener.ora or anyway i can register this ipaddress using Net configuration Assistant so that the error gets stopped?
    Thanks in Advance

    not ssure but do one thing go to start run cmd and give the commnad ipconfig then u will know the ip add of ur machine then apply that ip in host file, hopefully ur problem will be solve
    shahid

  • Downloading a binary via IE and getting the "corrupt or invalid" message

    Hi,
    I'm trying to resolve the issue when downloading a binary via IE and getting the "corrupt or invalid" message.
    I've tried using the /tr switch instead of /t, however I still get the same problem.
    I'm using the signtool.exe from SDK 8.1 and IE version 10.0.9200.17028
    I've tried using the following time stamp server but it did not responded:
    http://timestamp.verisign.com/scripts/timstamp.dll
    so I've used this one instead:
    http://timestamp.globalsign.com/scripts/timstamp.dll
    but even though I still get the "corrupt or invalid"  message.
    Thanks

    Hi,
    see
    http://blogs.msdn.com/b/ieinternals/archive/2014/09/04/personalizing-installers-using-unauthenticated-data-inside-authenticode-signed-binaries.aspx
    Questions regarding Internet Explorer 8, 9 and 10 and Internet Explorer 11 for the IT Pro Audience. Topics covered are: Installation, Deployment, Configuration, Security, Group Policy, Management questions. If you are a consumer looking for answers or to
    raise a question, it's highly recommended you head on over to http://answers.microsoft.com
    does the problem persist If you upgrade to IE11/win8.1?
    Rob^_^

  • Java program to perform binary addition,subtraction and modulus.

    i am a newbie to java and require ur urgent help plzzzz.
    i wanna perform binary addition,subtraction and modulus operation between two numbers of 512 bit without using java functions i.e by simple logics of control statements.i need to convert two 512 bit numbers passed as string into binary form, and then perform addition,subtraction and modulus operations on these two binary numbers and finally dipaly the result in decimal format.
    i think we may use full adder binary logic in this!!!
    please send me the java coding for these three operations as urgent as possible on my email.
    i would be highly obliged.
    thanks.
    sheetal.

    i have managed to make this code myself but i wanna learn the basics...so plz help me guyz...
    this is the code:
    package bytearrayopeations;
    import java.math.BigInteger;
    * @author sheetalb
    public class binaryadding {
    public static void main(String[] args) {
    BigInteger a = new BigInteger("123456");
    BigInteger b = new BigInteger("5121");
    String bb1 = a.toString(2);
    String bb2 = b.toString(2);
    String ss1 = null;
    String ss2 = null;
    String result = "";
    String carry="0";
    System.out.println("first value=" +bb1);
    System.out.println("second value=" +bb2);
    int k=bb1.length();
    int h=bb2.length();
    System.out.println("length 1="+ k);
    System.out.println("length 2=" +h);
    int p=h-k;
    //System.out.println("difference=" +p);
    int q=k-h;
    //System.out.println("difference 2=" +q);
    if(h==k)
    else if(h>k)
    for(int i=0;i<p;i++)
    bb1="0"+bb1;
    System.out.println("new value of first=" +bb1);   
    else if(h<k)
    for(int i=0;i<q;i++)
    bb2="0"+bb2;
    System.out.println("new value of second=" +bb2);
    StringBuffer sb1=new StringBuffer(bb1);
         StringBuffer sb2=new StringBuffer(bb2);
    bb1=sb1.reverse().toString();
         bb2=sb2.reverse().toString();
    //System.out.println("rev. buffer1=" +bb1);
    //System.out.println("rev. buffer2=" +bb2);
    for(int i=0;i<bb1.length();i++)
    ss1=bb1.substring(i,i+1);
    ss2=bb2.substring(i,i+1);
    System.out.println("value1=" + ss1 + " " + "value2=" + ss2);
    if (ss1.equals("0") && ss2.equals("0"))
    if (carry.equals("0"))
    result+="0";
    else
    result+="1";
    else if (ss1.equals("1") && ss2.equals("1"))
    if (carry.equals("0"))
    result+="0";
              carry="1";
              else
                   result+="1";
                   carry="1";
    else if (ss1.equals("0") && ss2.equals("1"))
    if (carry.equals("0"))
         result+="1";
                   carry="0";
                        else
                        result+="0";
    carry="1";
    else if (ss1.equals("1") && ss2.equals("0"))
    if (carry.equals("0"))
    result+="1";
    carry="0";
                   else
    result+="0";
    carry="1";
    System.out.println("sum=" result " " + "carry" + carry);
    result+=carry;
    StringBuffer sb3=new StringBuffer(result);
    result=sb3.reverse().toString();
    System.out.println("result is " +result); 
    System.out.println("Binary = "+ result + ", Decimal = "+Integer.parseInt(result,2));
    plz reply nw...

  • Which group should GI_HOME and ORACLE_HOME belong to after installation?

    Hi, I finished installation and creation of database.
    However now I think all the group for GI_HOME belong to grid:oinstall and ORACLE_HOME belong to oracle:oinstall.
    Do I have to change them to dba as group?
    Thanks

    Hi,
    Formerly the database admins set up the oraInventory to dba group. That works but fell outside the standards of Oracle.
    In newer versions the Oracle OUI check if oinstall group is primary group (if not a warning is returned) so during install OUI don't allow you set up manually the oraInventory group, so Installer take the primary group of your OS user.
    When you install Oracle software on the system for the first time, OUI creates the oraInst.loc file. This file identifies the name of the Oracle Inventory group (by default, oinstall), and the path of the Oracle Central Inventory directory.
    By default, if an oraInventory group does not exist, then the installer lists the primary group of the installation owner for the Oracle Grid Infrastructure for a Cluster software as the oraInventory group.
    http://download.oracle.com/docs/cd/E11882_01/install.112/e22489/prelinux.htm#BABDEAIJ
    Before installation, you can set the group as you wish, is only a issue of standards and organization of the environment.
    However after the installation exists an procedure to change it. We can not simply modify using only "chown" utility.
    Regards,
    Levi Pereira

  • Help with binary to decimal, binary to hex, and hex to ascii or ascii to hex program

    I decided to do a program that will do binary to decimal, binary to hex, and hex to ascii for a project related to a java programming course, which only needs to perform features from chapters 1-6 and 8 of Tony Gaddis's book. The functions work fine as their own main programs out side of this combined effort, so can anyone help me determine why I get the following 41 errrors saying: class, interface, or enum expected as well as any other errors that may show up afterwards because I'm stumped. My flowcharts, which have to be revised after discovering that my previous function were logically incorrect after running them in their own main are attached below as the spec sheet.
    My code is as follows and I hope you don't mind the commented lines of unused code because I'm not sure where I want things and what I want at the moment:
    import java.util.Scanner;
    import java.io.*;
    import java.lang.*;
    public class BintoDectoHextoAscii
       public static void main(String[] args)throws IOException
          Scanner input = new Scanner(System.in);
          System.out.println("Enter a binary number: ");
          String binary = input.nextLine(); // store input from user
         if (binary == input.nextLine())
          //int i= Integer.parseInt(hex,2);
          //String hexString = Integer.toHexString(i);
          //System.out.println("Hexa decimal: " + hexString);
          //int finaldecimalvalue = binaryToDecimal(hexString);
          int finaldecimalvalue = binaryToDecimal(hexString);
         if (binary != input.nextLine())
          String hexInput; // The variable Bin Input declared as the datatype int to store the Binary value  
          // Create a Scanner object for keyboard input.
          //Scanner keyboard = new Scanner(System.in);
          // Get the number of binary files.
          System.out.print("Enter the Hex value: ");
          hexInput = keyboard.nextLine();
          System.out.println("Original String: "+ hexInput);
          //String hexEquivalent = asciiToHex(demoString);
          String hexEquivalent = asciiToHex(hexInput);
          //Hex value of original String
          System.out.println("Hex String: "+ hexEquivalent);
          String asciiEquivalent = hexToASCII(hexEquivalent);
          //ASCII value obtained from Hex value
          System.out.println("Ascii String: "+ asciiEquivalent);String finalhexOutput = HextoAsciiConverter(hexEquivalent);
         if (binary != input.nextLine() && hexInput != keyboard.nextLine())
             BufferedReader binInput = new BufferedReader(new InputStreamReader(System.in));
             System.out.println("Enter the Binary number:");
             String hex = binInput.readLine();
             //String finaldecimalvalue = binaryToDecimal(decimal);
             //long finalhexvalue = BinaryToHexadecimal(num);
             long finalhexvalue = BinaryToHexadecimal();
       public static String BinaryToHexadecimal(String hex)
          //public static void main(String[] args)throws IOException
             //BufferedReader bf= new BufferedReader(new InputStreamReader(System.in));
             //System.out.println("Enter the Binary number:");
             //String hex = binInput.readLine();
             long num = Long.parseLong(hex);
             long rem;
             while(num > 0)
             rem = num % 10;
             num = num / 10;
             if(rem != 0 && rem != 1)
             System.out.println("This is not a binary number.");
             System.out.println("Please try once again.");
             System.exit(0);
             int i= Integer.parseInt(hex,2);
             String hexString = Integer.toHexString(i);
             System.out.println("Hexa decimal: " + hexString);
          return num.tolong();
      //int i= Integer.parseInt(hex,2);
      //String hexString = Integer.toHexString(i);
      //System.out.println("Hexa decimal: " + hexString);
    //} // end BintoDectoHextoAsciil
       //public static String HexAsciiConverter(String hextInput)
          // Get the number of binary files.
          //System.out.print("Enter the Hex value: ");
          //hexInput = keyboard.nextLine();
          //System.out.println("Original String: "+ hexInput);
          //String hexEquivalent = asciiToHex(demoString);
          //String hexEquivalent = asciiToHex(hexInput);
          //Hex value of original String
          //System.out.println("Hex String: "+ hexEquivalent);
          //String asciiEquivalent = hexToASCII(hexEquivalent);
          //ASCII value obtained from Hex value
          //System.out.println("Ascii String: "+ asciiEquivalent);
       //} // End function  
       private static String asciiToHex(String asciiValue)
          char[] chars = asciiValue.toCharArray();
          StringBuffer hex = new StringBuffer();
          for (int i = 0; i < chars.length; i++)
             hex.append(Integer.toHexString((int) chars[i]));
          return hex.toString();
       private static String hexToASCII(String hexValue)
          StringBuilder output = new StringBuilder("");
          for (int i = 0; i < hexValue.length(); i += 2)
             String str = hexValue.substring(i, i + 2);
             output.append((char) Integer.parseInt(str, 16));
          return output.toString();
       public static String binaryToDecimal(String binary)
            //Scanner input = new Scanner(System.in);
            //System.out.println("Enter a binary number: ");
            //String binary = input.nextLine(); // store input from user
            int[] powers = new int[16]; // contains powers of 2
            int powersIndex = 0; // keep track of the index
            int decimal = 0; // will contain decimals
            boolean isCorrect = true; // flag if incorrect input
           // populate the powers array with powers of 2
            for(int i = 0; i < powers.length; i++)
                powers[i] = (int) Math.pow(2, i);
            for(int i = binary.length() - 1; i >= 0; i--)
                // if 1 add to decimal to calculate
                if(binary.charAt(i) == '1')
                    decimal = decimal + powers[powersIndex]; // calc the decimal
                else if(binary.charAt(i) != '0' & binary.charAt(i) != '1')
                    isCorrect = false; // flag the wrong input
                    break; // break from loop due to wrong input
                } // end else if
                // keeps track of which power we are on
                powersIndex++; // counts from zero up to combat the loop counting down to zero
            } // end for
            if(isCorrect) // print decimal output
                System.out.println(binary + " converted to base 10 is: " + decimal);
            else // print incorrect input message
                System.out.println("Wrong input! It is binary... 0 and 1's like.....!");
            return decimal.toint();
       } // end function
    The errors are as follows:
    ----jGRASP exec: javac BintoDectoHextoAscii.java
    BintoDectoHextoAscii.java:65: error: class, interface, or enum expected
       public static String BinaryToHexadecimal(String hex)
                     ^
    BintoDectoHextoAscii.java:73: error: class, interface, or enum expected
             long rem;
             ^
    BintoDectoHextoAscii.java:74: error: class, interface, or enum expected
             while(num > 0)
             ^
    BintoDectoHextoAscii.java:77: error: class, interface, or enum expected
             num = num / 10;
             ^
    BintoDectoHextoAscii.java:78: error: class, interface, or enum expected
             if(rem != 0 && rem != 1)
             ^
    BintoDectoHextoAscii.java:81: error: class, interface, or enum expected
             System.out.println("Please try once again.");
             ^
    BintoDectoHextoAscii.java:83: error: class, interface, or enum expected
             System.exit(0);
             ^
    BintoDectoHextoAscii.java:84: error: class, interface, or enum expected
             ^
    BintoDectoHextoAscii.java:87: error: class, interface, or enum expected
             String hexString = Integer.toHexString(i);
             ^
    BintoDectoHextoAscii.java:88: error: class, interface, or enum expected
             System.out.println("Hexa decimal: " + hexString);
             ^
    BintoDectoHextoAscii.java:90: error: class, interface, or enum expected
          return num.tolong();
          ^
    BintoDectoHextoAscii.java:91: error: class, interface, or enum expected
       ^
    BintoDectoHextoAscii.java:124: error: class, interface, or enum expected
          StringBuffer hex = new StringBuffer();
          ^
    BintoDectoHextoAscii.java:125: error: class, interface, or enum expected
          for (int i = 0; i < chars.length; i++)
          ^
    BintoDectoHextoAscii.java:125: error: class, interface, or enum expected
          for (int i = 0; i < chars.length; i++)
                          ^
    BintoDectoHextoAscii.java:125: error: class, interface, or enum expected
          for (int i = 0; i < chars.length; i++)
                                            ^
    BintoDectoHextoAscii.java:128: error: class, interface, or enum expected
          ^
    BintoDectoHextoAscii.java:130: error: class, interface, or enum expected
       ^
    BintoDectoHextoAscii.java:135: error: class, interface, or enum expected
          for (int i = 0; i < hexValue.length(); i += 2)
          ^
    BintoDectoHextoAscii.java:135: error: class, interface, or enum expected
          for (int i = 0; i < hexValue.length(); i += 2)
                          ^
    BintoDectoHextoAscii.java:135: error: class, interface, or enum expected
          for (int i = 0; i < hexValue.length(); i += 2)
                                                 ^
    BintoDectoHextoAscii.java:138: error: class, interface, or enum expected
             output.append((char) Integer.parseInt(str, 16));
             ^
    BintoDectoHextoAscii.java:139: error: class, interface, or enum expected
          ^
    BintoDectoHextoAscii.java:141: error: class, interface, or enum expected
       ^
    BintoDectoHextoAscii.java:144: error: class, interface, or enum expected
       public static String binaryToDecimal(String binary)
                     ^
    BintoDectoHextoAscii.java:150: error: class, interface, or enum expected
            int powersIndex = 0; // keep track of the index
            ^
    BintoDectoHextoAscii.java:151: error: class, interface, or enum expected
            int decimal = 0; // will contain decimals
            ^
    BintoDectoHextoAscii.java:152: error: class, interface, or enum expected
            boolean isCorrect = true; // flag if incorrect input
            ^
    BintoDectoHextoAscii.java:155: error: class, interface, or enum expected
            for(int i = 0; i < powers.length; i++)
            ^
    BintoDectoHextoAscii.java:155: error: class, interface, or enum expected
            for(int i = 0; i < powers.length; i++)
                           ^
    BintoDectoHextoAscii.java:155: error: class, interface, or enum expected
            for(int i = 0; i < powers.length; i++)
                                              ^
    BintoDectoHextoAscii.java:159: error: class, interface, or enum expected
            for(int i = binary.length() - 1; i >= 0; i--)
            ^
    BintoDectoHextoAscii.java:159: error: class, interface, or enum expected
            for(int i = binary.length() - 1; i >= 0; i--)
                                             ^
    BintoDectoHextoAscii.java:159: error: class, interface, or enum expected
            for(int i = binary.length() - 1; i >= 0; i--)
                                                     ^
    BintoDectoHextoAscii.java:166: error: class, interface, or enum expected
                else if(binary.charAt(i) != '0' & binary.charAt(i) != '1')
                ^
    BintoDectoHextoAscii.java:169: error: class, interface, or enum expected
                    break; // break from loop due to wrong input
                    ^
    BintoDectoHextoAscii.java:170: error: class, interface, or enum expected
                } // end else if
                ^
    BintoDectoHextoAscii.java:174: error: class, interface, or enum expected
            } // end for
            ^
    BintoDectoHextoAscii.java:180: error: class, interface, or enum expected
            else // print incorrect input message
            ^
    BintoDectoHextoAscii.java:185: error: class, interface, or enum expected
            return decimal.toint();
            ^
    BintoDectoHextoAscii.java:186: error: class, interface, or enum expected
       } // end function
       ^
    41 errors
    ----jGRASP wedge2: exit code for process is 1.
    ----jGRASP: operation complete.

    so can anyone help me determine why I get the following 41 errrors saying: class, interface, or enum expected as well as any other errors that may show up afterwards because I'm stumped.
    Yes - YOU CAN!
    My code is as follows and I hope you don't mind the commented lines of unused code because I'm not sure where I want things and what I want at the moment:
    Excellent! Commenting out code is EXACTLY how you troubleshoot problems like yours.
    Comment out sections of code until the problem goes away. Then start adding back ONE SECTION of code at a time until the problem occurs. When it does you have just FOUND the problem.
    If you do that you wind up with code that looks like this:
    import java.util.Scanner;
    import java.io.*;
    import java.lang.*;
    public class BintoDectoHextoAscii  {
          public static void main(String[] args)throws IOException      {
             Scanner input = new Scanner(System.in);
             System.out.println("Enter a binary number: ");
             String binary = input.nextLine(); // store input from user
                  public static String BinaryToHexadecimal(String hex)     {     } // end function        
    Notice ANYTHING UNUSUAL?
    You have a complete CLASS definition followed by a method definition.
    Methods have to be INSIDE the class - you can NOT define methods on their own.
    Write modular code.
    Write EMPTY methods - just the method signature and maybe a RETURN NULL if you need to return something.
    Then add calls to those empty methods.
    When everything compiles and runs find you can start adding code to the methods ONE METHOD AT A TIME.
    Test compile and run after you add the code for each method.

  • Binary seg.faults and gives strange errors

    Hi!
    I've got a binary which I can't execute...
    All it does is segfaulting. When I try gdb it gives me
    BFD: /tmp/binary: invalid string offset 48 >= 0 for section `.shstrtab'
    BFD: /tmp/binary: invalid string offset 2 >= 0 for section `'
    BFD: /tmp/binary: invalid string offset 48 >= 0 for section `.shstrtab'
    BFD: /tmp/binary: invalid string offset 2 >= 0 for section `'
    BFD: /tmp/binary: invalid string offset 48 >= 0 for section `.shstrtab'
    BFD: /tmp/binary: invalid string offset 2 >= 0 for section `'
    BFD: /tmp/binary: no group info for section
    <stripped....>
    BFD: /tmp/binary: sh_link [1] in section `' is incorrect
    "/tmp/binary": not in executable format: File format not recognized
    Alright, so I gave it a try with "file"
    /tmp/binary: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped
    (ldd says it's statically linked, which would make more sense..)
    readelf recognizes the binary as an ELF32 too... objdump says "File format not recognized"...
    I can't understand what's going on, anyone got a hint?
    Edit:
    Might be interesting to know: The binary was compiled on another computer, and I don't have the source
    Last edited by diddi (2009-01-18 18:21:16)

    well, i kinda know the author of it so
    It's actually a company (run by a guy I know),who have made this binary as a wargame... the deal is to find a bug and then exploit it.
    So i'm not really afraid of running it.
    I have no hope to actually solve it, just checking out how far I would make it : )
    Disassemble it doesn't work, as every program I try all says that the file format is not recognized...
    Another friend of mine actually got this binary to execute, and has spotted the bugs... but for some reason it doesn't work for me : O
    (and I can't reach him atm)

  • Invalid operands to binary ^ (have 'double' and 'double')

    Hi all,
    I've been trying to make some calculus like
    double a, b, c;
    b = 0.3;
    c =0.35;
    a = b^c;
    but I get this error message: *"Invalid operands to binary ^ (have 'double' and 'double')"*. Does anybody know how to solve this?
    Thanks in advance!

    Yes I think Ray hit the nail on the head. It looks as if you wanted to perform and exponentiation operation, not a bitwise operation. So, just to expand on Ray's answer a bit, the carrot symbol (^) that you used in your statement is, in C, the bitwise XOR operator, and has nothing to do with exponentiation. There are numerous bitwise operators in C (bitwise AND (&), bitwise OR (|), bitwise XOR (^)), and they all deal with manipulating bits of data. If you were, in fact, trying to raising b to the power of c and assign that value back to a, then Ray's post was the perfect answer as to how to do that.
    Many programmers that are new to C, especially ones coming from a language such as Visual Basic, where the carrot symbol is used for exponentiation operations, naturally try to use the same symbol for the same purpose in C, and are surprised to find that it doesn't do what they expected (understandably). As mentioned, this is because, in C, there is no exponentiation operator, and the carrot symbol does something completely different and unrelated to exponentiation. However, C does provide a predefined function in its standard library for exponentiation, and it is called the pow() function, which takes two double-typed arguments (the first is the number being risen and the second is the power that it is being raised to), and returns the result as a double. To use this function, all you have to do is write an include directive at the top of the file that you will be using the function in that tells the preprocessor to include the file math.h. See RayNewb's post for a solid example of how all this stuff would look in your source code, and, as he mentioned, open your Terminal and type in +man math+ or, for this particular function, +man pow+ to find out more about how this function works (you can page through the information with the spacebar or scroll down with the down arrow).
    Hope this was of some help for you, and best of luck with everything!

  • What to set in ORACLE_BASE and ORACLE_HOME values ?

    Hello,
    I installed the Oracle 10g Express Edition on my Linux box with the archive file oracle-xe_10.2.0.1-1.1_i386.deb
    The install went fine.
    Then I installed the instantclient in /home/stephane/programs/oracle/instantclient_10_2 and can load it fine in my Apache PHP server.
    I set the following values in the .bashrc file:
    export ORACLE_BASE=/home/stephane/programs/oracle
    export ORACLE_HOME=/home/stephane/programs/oracle
    PATH=$PATH:$ORACLE_HOME/bin
    But my Apache PHP server shows these values:
    ORACLE_BASE /home/stephane/oracle
    ORACLE_HOME /home/stephane/install/oracle
    I wonder what to set in these values in my .bashrc file.

    And so I tried to start a listener.
    root@stephane-ThinkPad-X61s:/home/stephane# lsnrctl start
    LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 25-OCT-2012 02:40:33
    Copyright (c) 1991, 2005, Oracle. All rights reserved.
    Starting /usr/lib/oracle/xe/app/oracle//product/10.2.0/server/bin/tnslsnr: please wait...
    TNSLSNR for Linux: Version 10.2.0.1.0 - Production
    NL-00280: error creating log stream /usr/lib/oracle/xe/app/oracle//product/10.2.0/server/network/log/listener.log
    NL-00278: cannot open log file
    SNL-00016: snlfohd: error opening file
    Linux Error: 13: Permission denied
    Listener failed to start. See the error message(s) above...
    But it didn't really want to start,

  • Universal Binary..Once and For All

    I know this topic has been discussed, but I'm still a little confused. I want to put this issue to rest, at least from my perspective.
    If you install a Universal Application via download or CD/DVD does it install an application that would be able to run of BOTH an Intel or PPC Mac. I know that the file size isn't exactly doubled, but does it still add extra unneeded code.
    I'm on a PPC Mac and I want to know if I download a Universal App am I getting the Intel version too. I really don't want this because I want my drive to be a slim as possible.
    If the Universal App does install both version (which I think was clearly evident in the huge increase in size of iLife '06 and iWork) is the only way to get the Intel version off to use "Trim the Fat".
    I don't really want to get into the nitty gritty...I just want to know if unneeded code is being installed and taking up space on my iBook because of this new Universal App thing.
    Thank you so much.

    I don't really want to get into the nitty gritty...I just want
    to know if unneeded code is being installed and taking up
    space on my iBook because of this new Universal App thing.
    The answer is yes.
    Universal binaries typically include both PowerPC and x86 versions of a compiled application.
    Universal binaries are usually substantially larger than single-platform binaries, because two copies of the compiled code must be stored. The size of the resulting universal binary is usually not double (roughly a 30% increase in size) as a significant portion will be resources which are shared between the two architectures.

  • When trying to download it says binary file download and it starts but doesnt finish

    as i try to download the little box pops up and says binary file save or cancel . So i save and it starts downloading the little line starts across and it gets to the end and disappears and leaves a empty box and nothing else happens

    Which player? Do you mean Flash, or maybe the Windows Media Player plugin?
    * http://www.adobe.com/products/flashplayer/distribution3.html
    * https://support.mozilla.org/en-US/kb/play-windows-media-files-in-firefox
    You have to run the installers with Firefox closed.

  • Binary addition,subtraction and modulus...plz help urgent

    plz help me on this query...
    i need to pass two 512 bit number as string,then convert them to binary and
    then perform binary addition,subtraction,modulus operations on those two numbers.finally convert result to integer.
    i designed a code which doesnt work correct.it is:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package bytearrayopeations;
    import java.math.BigInteger;   
    * @author sheetalb
    public class binaryadding {
        public static void main(String[] args) {
            BigInteger a = new BigInteger("123456");
            BigInteger b = new BigInteger("5121");
            String bb1 = a.toString(2);
            String bb2 = b.toString(2);
            String ss1 = null;
            String ss2 = null;
            String result = "";
            String carry="0";
            System.out.println("first value=" +bb1);
            System.out.println("second value=" +bb2);
            int k=bb1.length();
            int h=bb2.length();
            System.out.println("length 1="+ k);
            System.out.println("length 2=" +h);
            int p=h-k;
            //System.out.println("difference=" +p);
            int q=k-h;
            //System.out.println("difference 2=" +q);
            if(h==k)
           else if(h>k)
                for(int i=0;i<p;i++)
                    bb1="0"+bb1;
                System.out.println("new value of first=" +bb1);   
        else if(h<k)
            for(int i=0;i<q;i++)
                bb2="0"+bb2;
            System.out.println("new value of second=" +bb2);
            StringBuffer sb1=new StringBuffer(bb1);
         StringBuffer sb2=new StringBuffer(bb2);
            bb1=sb1.reverse().toString();
         bb2=sb2.reverse().toString();
            //System.out.println("rev. buffer1=" +bb1);
            //System.out.println("rev. buffer2=" +bb2);
            for(int i=0;i<bb1.length();i++)
                ss1=bb1.substring(i,i+1);
                ss2=bb2.substring(i,i+1);
              System.out.println("value1=" + ss1 + "    " + "value2=" + ss2);
              if (ss1.equals("0") && ss2.equals("0")) 
                 if (carry.equals("0")) 
                     result+="0";
                        else
                            result+="1";
               else if (ss1.equals("1") && ss2.equals("1"))
                if (carry.equals("0")) 
                    result+="0";
              carry="1";
              else
                   result+="1";
                   carry="1";
        else if (ss1.equals("0") && ss2.equals("1"))
                     if (carry.equals("0")) 
                         result+="1";
                   carry="0";
                        else
                          result+="0";
                                    carry="1";
               else if (ss1.equals("1") && ss2.equals("0"))
                     if (carry.equals("0")) 
                        result+="1";
                        carry="0";
                   else
                                result+="0";
                                carry="1";
           System.out.println("sum=" +result + "         " + "carry" + carry);
                        result+=carry;
                        StringBuffer sb3=new StringBuffer(result);
                        result=sb3.reverse().toString();
                    System.out.println("result is " +result); 
                  System.out.println("Binary = "+ result + ", Decimal = "+Integer.parseInt(result,2));
    }plz provide me or email me if possible java coding for all three operations as soon.
    [email protected]

    One thread is enough. Continue here:[http://forums.sun.com/thread.jspa?threadID=5373720&messageID=10643157#10643157]

  • Oci8 and $Oracle_Home

    Hey all,
    I've been trying to get Oracle-XE 10G working with PHP on Ubuntu 10.04 (Not server) which is prooving to be quite an experience; I'll try to summerise everything I've done and what I'm having problems with below. Any pointers at all would be great - I feel like I've read everything there is to read about oci8 but I'm obviously missing something.
    Nb: I already have Apache2 and PHP installed both of which work well.
    Installed Oracle-XE 10G and instant client. Sqlplus works fine.
    Installed Pear and PHP5-dev.
    Installed Oci8 via Pecl with no errors; phpinfo shows the extension and php --ri oci8 shows that its enabled.
    This is where I'm having a problem. I'm running oci_connect('user', 'pass', 'localhost/xe'); and its complaining that I haven't set oracle_home or ld_library_path.
    I've made a script in /etc/profile.d which contains:
    export oracle_home=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client
    export ld_library_path=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib
    I rebooted and the script works, but I still get the same error when I run oci_connect.
    I've been trying to get this working for quite a while now, so I'd really appreciate it if someone could tell me what I'm doing wrong / not doing. I'm assuming I need to set the variables somewhere else, but I haven't a clue where since this is the most advanced thing I've ever done with linux.
    Cheers,
    MIM.

    I'm using the same httpd.conf as before, however, I did add the following:
    LoadModule php5_module modules/libphp5.so
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
    So it should be loading the php5 module. Is there something else I'm missing in httpd.conf?

  • Binary file import and export in lab windows cvi

    Hello,
    I have some standard binary file format (.sie) that has been written in origin IDE. The sie type extension file format is a public format, but not defined by Origin. In origin IDE, i can be able to import these files and also be able to export it to excel as csv type. Now, i want to do the same thing in lab windows cvi. i need to import .sie type file and be able to read and export it to excel in lab windows cvi. Is this possible? Please help me to work on this project. Thanks in advance.
    Regards,
    Jayakumar.V

    Reading and writing binary file is indeed possible in CVI, the problem normally lien in the definition of the file format you want to access.
    I never found .SIE extension during my activity; a fast search on google returned this page with a link to the document explaining one file structure: it's a format dedicated to accounting so it's possibly not  your case, but could they be your files?
    Before finding the complete description of the file format you cannot think of any operation on the file itself, unless it is so self evident that you need little effort to access file content (this normally happens only on text files).
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

Maybe you are looking for