Simple problem with  code

whenever i try running my code i get a error message and it has to do with this part of the code
public int cmd()
    footballer.footComp()=0;
    Collections.sort(xList);
    return  footballer.getFootComp();
the method being called is in another class called Footballer, which has the the method footComp()
public static int getFootComp()
    return footComp;
where footComp has also been declared static in the Footballer class
private static int footComp = 0;
this is the error message i get :
required: variable
found : value
thanks for ur help in advance

pls how do i do that?You don't know how to pass a method to a parameter? You don't know how to use that parameter to set footComp?
Sun's basic Java tutorial
Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
http://javaalmanac.com. A couple dozen code examples that supplement The Java Developers Almanac.
jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
Bruce Eckel's Thinking in Java (Available online.)
Joshua Bloch's Effective Java
Bert Bates and Kathy Sierra's Head First Java.
James Gosling's The Java Programming Language. Gosling is
the creator of Java. It doesn't get much more authoratative than this.

Similar Messages

  • CND problem with code-completion

    Hi,
    First of all I don't really know where to put this post about C++ Pack in NetBeans. I've read one post in which someone suggests that this section will be pretty close...
    Maybe someone here would be so kind and try to help me...
    I'm using Ubuntu 7.04 and I have a problem with code completion in NetBeans 5.5.1 CND and I'm a little bit frustrated right now....
    I installed Netbeans, then CND, Created new C++ Project. Added new source file, with #include <GL/glut.h> directive.
    Whole code was compiled without errors, and that's fine.
    There were some problems with linking but I've added "glut", "GL", "GLU" string to linker parameters in Project Properties.
    The main problem is the code assistant. When I'm hitting "glut" and press ctrl+space it shows functions from glut library but when I type "gl" (to type "glColor3ub...") and try to show the code completion pop-up it shows "No suggestions". The same thing is with GLU library.
    I've installed GL, GLU, glut libraries (they all sit calmly in /usr/include/GL).
    I've added the /usr/include and /usr/include/GL to C++ section.
    I think that the Netbeans is able to find those *.h files because, as I said before, the glut (and the glX) functions are shown properly but there is no sign of "gl" and "glu" FUNCTIONS in code completion (the #define values specified in gl.h and glu.h are on the list, but the functions aren't)...
    I don't have idea why glut and glX are working fine, and gl and glu aren't... If anyone have similar problem, know where to look for an answer or have some suggestions I would be much obliged...
    I've seen Eclipse CDT, Anjuta, kDevelop, Code::Blocks, VIM + icomplete... after checking them all there is only one decision - I want to use NetBeans CND. It's user-friendly, fast and I just like it. That's why I would really like to know why the code-completion isn't working in 100%...

    Vladimir,
    The glColor3ub function declaration is in gl.h file (which along with glu.h is included in glut.h).
    Thanks Maxim,
    In the matter of fact since yesterday I've been looking for the reason why the GL and GLU aren't indexed properly by the Netbeans CC and I've found something.
    The GLU library was indexed after deleting
    #include <GL/gl.h>directive. So it means that the gl.h library is messing up.
    I've checked whole file (gl.h) and noticed that the only part which is in conflict with NetBeans is this one:
    #elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
    #  define GLAPI __attribute__((visibility("default")))
    #  define GLAPIENTRYI'm using GCC 4.1 so the expression value is 401, so the GLAPI define looks like the line above.
    gl.h is indexed properly by NetBeans when it is representing "extern", so it should look like
    #  define GLAPI externIt is working fine if you delete this part of gl.h or for example (which I've done) add predefined macro (or change the existing one)
    __GNUC_MINOR__=-200I know that it isn't very clean solution... I'm not happy with cheating NetBeans about the version of installed GCC but unfortunately I am not a specialist in GNU C so maybe someone would find more elegant solution.
    As far as I know the __attribute__ feature makes the GCC more verbose (warnings, errors) but I don't know how much functionality am I loosing in fact...
    Edit: Why the code tags aren't working? :/
    Message was edited by:
    Makula

  • Strange Problem with Code Groups / Codes

    Hey all, have a strange problem with Code Groups and Codes.
    Our data migration team accidentally loaded an early version of our catalog (code groups and codes) in to our 'Gold' configuration client. They then proceed to delete them all via transaction qs41. However, the code groups have been deleted, but not the codes.
    So, basically, no codes groups exist in table QPGR or QPGT but all the entries remain in QPCD with the assigment to code groups. The usage indicator is not set on the codes so why they did not get deleted with the codes groups is unknown.
    The issue that this is now causing us is that we can't recreate the codes groups with these codes assigned as the system thinks they already exist (via a check on table QPCD i would expect).
    Also, i have been unable to recreate what happened did in other clients... seems very strange.
    Any help appreciated.
    Cheers

    Ben,
    You could try SE11, and see if you can delete the records from there.. but I'm not hopeful...
    Otherwise you may need to write a quick ABAP program to delete the data base entries.
    PeteA

  • A simple problem with sateful Session beans

    Hi,
    I have a really novice problem with stateful session bean in Java EE 5.
    I have written a simple session bean which has a counter inside it and every time a client call this bean it must increment the count value and return it back.
    I have also created a simple servlet to call this session bean.
    Everything seemed fine I opened a firefox window and tried to load the page, the counter incremented from 1 to 3 for the 3 times that I reloaded the page then I opened an IE window (which I think is actually a new client) but the page counter started from 4 not 1 for the new client and it means that the new client has access to the old client session bean.
    Am I missing anything here???
    Isn�t it the way that a stateful session bean must react?
    This is my stateful session bean source.
    package test;
    import javax.ejb.Stateful;
    @Stateful
    public class SecondSessionBean implements SecondSessionRemote
    private int cnt;
    /** Creates a new instance of SecondSessionBean */
    public SecondSessionBean ()
    cnt=1;
    public int getCnt()
    return cnt++;
    And this is my simple client site servlet
    package rezaServlets;
    import java.io.*;
    import java.net.*;
    import javax.ejb.EJB;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import test.SecondSessionRemote;
    public class main extends HttpServlet
    @EJB
    private SecondSessionRemote secondSessionBean;
    protected void processRequest (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    response.setContentType ("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter ();
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Servlet main</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h1>Our count is " + Integer.toString (secondSessionBean.getCnt ()) + "</h1>");
    out.println("</body>");
    out.println("</html>");
    out.close ();
    protected void doGet (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    processRequest (request, response);
    protected void doPost (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    processRequest (request, response);
    }

    You are injecting a reference to a stateful session bean to an instance variable in the servlet. This bean instance is shared by all servlet request, and that's why you are seeing this odd behavior.
    You can use type-leve injection for the stateful bean, and then lookup the bean inside your request-processing method. You may also save this bean ref in HttpSession.
    @EJB(name="ejb/foo", beanName="SecondBean", beanInterface="com.foo.foo.SecondBeanRemote")
    public MyServlet extends HttpServlet {
    ic.lookup("java:comp/env/ejb/foo");
    }

  • Simple problem with input

    hi!
    i've a problem with user input in my application:
    Code:
    BufferedReader F_reader = new BufferedReader (new InputStreamReader(System.in));
    Fs_line = F_reader.readLine();
    My problem is that i've to press the return key for two times, before the JDK returns the line! Does anybody know a better solution with JDK 1.4.2?
    thanks for help
    mike

    it was a mistake of our own implementation! code ist correct! any circumstances are our eval!
    thanks mike

  • Simple problem with a list initialization.

    hello ! i have a class Contact and i would like to make a list of lists of Contact variables .. but when i try to run my code , it says "IndexOutOfBoundsException: Index: 0, Size: 0" . I know that every list of the list must be initialized .. but i don't know how .
    here is the declaration of the List
    static  List<List<Contact>> lolContact=new ArrayList<List<Contact>>();and i know that i should do something like :
    lolContact.get(0)=new ArrayList<Contact>();to initialize every list of the list but i don't know how . please help

    badescuga wrote:
    and i know that i should do something like :
    lolContact.get(0)=new ArrayList<Contact>();
    Couple of problems with that.
    1. You can never do methodCall() = something in Java. The result of a method call is not an L-value.
    2. You're trying to assign a ContactList to a Contact variable. Basically, you're trying to do
    Contact c = new ArrayList<Contact>();3. Even if you changed it to
    Contact c = lolContact.get(0);
    c = new Contact();it would not put anything into the list. That would just copy the first reference in the list and stick it into variable c, so that both c and the first list item point to the same object (remember, the list contains references, not objects--no object or data structure ever contains an object in Java), and then assigns a completely different reference to c, forgetting about the one to the object pointed to by the list. It would not affect the list in any way.
    4. You can't do get(0) until you've first put something into the list.

  • Problem with code

    hi all ! I hadd some problems with my code. I have some dates that should be ordered by the hour (hora) but its not. Now I know its not the SQL because I execute it with my sql control center and its just fine. SO it must be when I pass the data from one object to another.
    Here what I do:
    OK I think I got it. ITS NOT A SQL ERROR !!! or a table error !!! I executed the code using my sql control center and the result is ordered and correct. So it has to be something related to the code that saves the data. I save the data in a bean like this:
    public HashMap getCitasxfecha2(java.sql.Date fecha,String tipo) throws java.sql.SQLException
            BeanDatosCitas t = new BeanDatosCitas();
            HashMap m = new HashMap();
            ResultSet cdr = bd3.busquedaCitas2(fecha,tipo);
            java.sql.Time vector[]= new java.sql.Time[9999];
            System.out.println("salgo del busquedaCitas2");
            int id = 0;
            while (cdr.next())
            //String hora=convertir(cdr.getTime("Hora"));
             id = cdr.getInt("idCita");
                t = new BeanDatosCitas(
                id,                             // Nos servir� como identificador en la tabla HashMa
                cdr.getDate("Fecha"),
                cdr.getTime("Hora"),
                cdr.getString("Protocolo"),
                cdr.getString("DNI"),
                cdr.getString("Opcion"),
                cdr.getString("Observacion"),
                cdr.getString("Horaentrada"),
                cdr.getString("Nombres"),
                cdr.getString("Apellidos"),
                cdr.getString("Prescriptor"),
                cdr.getString("Mutua"),
                cdr.getInt("Sesigast"),
                cdr.getInt("Sesifaltantes"),
                cdr.getString("Tipo"),
                0
                m.put(new Integer(id), t);
            numFilas = m.size();
            return m;
        }Then I do a:
    respuesta = bBDCit.getCitasxfecha2(datNac,tipo);
            int nFilas2 = bBDCit.getNumFilas();
            Collection tabla2 = respuesta.values();
            request.setAttribute("citas_diarias",tabla2); And in my JSP I do:
    <c:forEach var="fila" items="${requestScope.citas_diarias}">it seems like in any part of this code the error happens. What could it be?
    Thanks again!

        public java.util.List getCitasxfecha2(java.sql.Date fecha,String tipo) throws java.sql.SQLException
            BeanDatosCitas t = new BeanDatosCitas();
            java.util.List list = new java.util.ArrayList();
            ResultSet cdr = bd3.busquedaCitas2(fecha,tipo);
            java.sql.Time vector[]= new java.sql.Time[9999];
            System.out.println("salgo del busquedaCitas2");
            int id = 0;
            while (cdr.next())
                //String hora=convertir(cdr.getTime("Hora"));
                id = cdr.getInt("idCita");
                t = new BeanDatosCitas( id,
                            // Nos servir� como identificador en la tabla HashMa
                    cdr.getDate("Fecha"),
                    cdr.getTime("Hora"),
                    cdr.getString("Protocolo"),
                    cdr.getString("DNI"),
                    cdr.getString("Opcion"),
                    cdr.getString("Observacion"),
                    cdr.getString("Horaentrada"),
                    cdr.getString("Nombres"),
                    cdr.getString("Apellidos"),
                    cdr.getString("Prescriptor"),
                    cdr.getString("Mutua"),
                    cdr.getInt("Sesigast"),
                    cdr.getInt("Sesifaltantes"),
                    cdr.getString("Tipo"),
                    0
                list.add(t);
            numFilas = list.size();
            return list;
            int nFilas2 = bBDCit.getNumFilas();
            Collection tabla2 = bBDCit.getCitasxfecha2(datNac,tipo);
            request.setAttribute("citas_diarias",tabla2);That should just about cover it. The JSP can stay the same.

  • AP 2602 Problem with Code 7.4.100.60

    Hi at all,
    I have problems with the code 7.4.100.60 and 2602 AP´s.
    The AP´s stops delivering services and no client can connected to them. After a reboot
    all problems are solved, but this problem comes back every ten days.
    In the logs are only shown a disconnect from these AP´s on the controller.
    On the AP´s is nothing to find.
    Is this a known problem? Is there a workaround available?
    Thanks in advance,
    Mario

    Hello Mario,
    As per your query i can suggest you the following solution-
    Please check the powering options-
    • 802.3af Ethernet Switch
    • Cisco AP2600 Power Injectors (AIR-PWRINJ4=)
    • Cisco AP2600 Local Power Supply (AIR-PWR-B=)
    and Power Draw
    AP2600: 12.95W
    Note: When deployed using Power over Ethernet (PoE), the power drawn from the power sourcing equipment will be higher by some amount depending on the length of the interconnecting cable. This additional power may be as high as 2.45W, bringing the total system power draw (access point + cabling) to 15.4W.
    Hope this will help you.

  • Problem with code-Please Help!!!

    Hey guys i have some problems with the following code:
    1. I have to do a stutter and reverse of an array [ 2 4 ] and it should return [ 4 4 2 2 ]. I wrote the code and i get [ 2 2 4 4]. How can this be fixed?
    public class Part1
         public static void main(String[] args)
              int[] values = {2, 4};     
              stutterAndReverse(values);
         public static int[] stutterAndReverse(int[] values)
              //Stutter
              System.out.print("[ ");
              for (int i = 0; i < values.length; i++)
                   for(int j = values.length-1; j >=0; j--)
                        System.out.print(values[i] + " ");
              System.out.print("] ");
              return values;
    2. This one takes the array and returns the even numbers to the left and odds to the right. It works with the code i have so far but the odds on the right should be in order. For example an array of 6 gives the output [2, 4, 6, 5, 3, 1]. Mine gives [2, 4, 6, 1, 5, 3]. How can i fix this???
    public class Part2
         public static void main(String[] args)
              int[] arr = new int[6];
              for(int i = 0; i < arr.length; i++)
              arr[i] = i + 1 ;
              printArray(arr);
              arr = evensToLeft(arr);
              //arr = oddsToRight(arr);
              System.out.println("Evens to the Left");
              printArray(arr);               
         public static void printArray(int[] arr)
              System.out.print("[");
              for(int i = 0; i < arr.length; i++)
                   System.out.print(arr);
                   if(i < arr.length-1)
                   System.out.print(", ");
                   System.out.println("]");
         public static int[] makeArray(int n)
              int[] arr = new int[6];
              return arr;          
         public static int[] evensToLeft(int[] arr)
              int split = 0;
              for(int i = 0; i < arr.length; i++)
                   if(arr[i]%2==0) //even
                        swap(arr,i,split);
                        split++;
                   return arr;
         public static void swap(int[] arr, int n1, int n2)
              int temp = arr[n1];
              arr[n1] = arr[n2];
              arr[n2] = temp;
    Thank you for your time i really appreciate it.

    now i'm more confused than ever...:(This'll probably make it worse :)
    class Testing
      public Testing()
        String[] values1 = {"2","4"};
        System.out.println(java.util.Arrays.asList(values1));
        System.out.println(java.util.Arrays.asList(stutterAndReverse(values1)));
        String[] values2 = {"1","2","3","4","5","6","7","9","11"};
        System.out.println(java.util.Arrays.asList(values2));
        System.out.println(java.util.Arrays.asList(evensOdds(values2)));
      public String[] stutterAndReverse(String[] arr)
        String[] temp = new String[arr.length * 2];
        for(int x = 0; x < temp.length; x++)
          temp[temp.length - 1 -x] = arr[x/2];
        return temp;
      public String[] evensOdds(String[] arr)
        StringBuffer evens = new StringBuffer();
        StringBuffer odds = new StringBuffer();
        for(int x = 0; x < arr.length; x++)
          if(Integer.parseInt(arr[x]) % 2 == 0) evens.append(","+arr[x]);
          else odds.insert(0,","+arr[x]);
        return (evens.toString().substring(1)+odds.toString()).split(",");
      public static void main(String[] args){new Testing();}
    }

  • Problem With Code/Design View Buttons

    (My bad...perhaps a more clear title will help...)
    OK, I am working with DW CS4 v.10.0 Build 4117 on a Win XP Pro SP3 platform.
    When working with my site files, they open in Code view.  The Split and Design buttons are grayed out.  When I click on the Layout button, the checkmark is sometimes next to the Code option, but sometimes next to the Design option (even though the page is clearly displayed only in Code view!).
    In order to view the file in Design view or Split view, I have to click the Layout button, Click on Code, click on the Layout button again, click on Design or Split View and then it will show the page file in that manner.
    This is SO frustrating!  Is this a bug in CS4?  (I scanned through the other topics and can't seem to find anything about this.)  I don't remember having this problem with CS3 and have spoken with other DW CS3 users who also say they have never had this happen.
    What can I do?
    Thanks in advance for any assistance you can provide.
    Susan

    OK, all of my site page files are .php extensions.
    Here is the code from one of my pages.
    <?php require_once('Includes/RandomizerInside.inc'); ?>
    <html>
    <head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <title>Gerald R. Ford International Airport</title>
    <link href="Includes/style.css" rel="stylesheet" type="text/css">
    <?php require_once('Includes/MetaInformation.inc'); ?>
    <?php require_once('Includes/JavaScriptInside.inc'); ?>
    <?php require_once('Includes/CommonJs.inc'); ?>
    </head>
    <body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <script language="JavaScript1.2">mmLoadMenus();</script>
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr bgcolor="#00306c">
            <td colspan="2"><img src="NavImages/i-header1.jpg" width="760" height="96"></td>
        </tr>
        <tr>
            <td width="185" valign="top" bgcolor="<?php echo"$bg_color"; ?>">
       <?php require_once('Includes/InsidePageNav.inc'); ?>
      </td>
            <td rowspan="2" valign="top" bgcolor="#FFFFFF">
       <table width="100%"  border="0" cellspacing="0" cellpadding="10">
        <tr>
         <td>
          <!-- PAGE CONTENT GOES HERE -->
          <!-- This is the only section you can make changes to -->
          <p align="right" class="PageTitle">NEWSROOM<br><img src="NavImages/spacer.gif" width="555" height="1"></p>
          <p class="BodyCopy"><a href="Pubs.php">Airport Publications</a> | <a href="PR.php">Press Releases</a></p>
          <p class="BodyCopy">To stay current on the latest GFIA news, bookmark this page and revisit it often.</p>
          <p class="BodyCopy">The GFIA Newsroom contains electronic copies
                 of <a href="Pubs.php#1"><i>Airport Connections</i></a>, the airport's quarterly newsletter, financial reports, and more.</p>
          <p class="BodyCopy">Members of the press should
                  be sure to visit the <a href="Media.php">media information</a> page for contact phone numbers and other valuable resources.</p></td>
        </tr>
       </table>
      </td>
        </tr>
        <tr>
            <td bgcolor="<?php echo"$bg_color"; ?>" style="vertical-align:bottom"><img src="NavImages/i-navimage<?php echo"$random_number"; ?>.jpg" width="185" height="300"></td>
        </tr>
        <tr>
            <td colspan="2">
       <?php require_once('Includes/Footer.inc'); ?>
      </td>
        </tr>
    </table>
    </body>
    </html>
    Any and all assistance will be GREATLY appreciated!
    Susan

  • Simple problem with transitions

    Hi everyone
    I am having a small bit of a problem with transitions....
    When I drag a clip from the viewer over the canvas to get the menu bar pop up, and select insert with transition ( cross dissolve ) it puts in a transition but its very short and too fast and when i select it and try to make adjustments it doesn't seem to let me make any changes to the cross dissolve.
    I wander what i am doing wrong?
    Many thanks Tim

    Hi
    Just as David Harbsmeier indicates. Handles
    Transitions are handled differently in iMovie resp FinalCut.
    • iMovie - material that builds the transition is taken from the videoclips = the total length remains same
    • FinalCut (as pro- works) . You have to set of a piece of material in each end of the video clips.
    This is called In- resp. Out-points. The remaining parts are called Handles
    Transitions here are using material from these = Total lenght of movie increase
    per transition.
    I find books/DVDs by Tom Wolsky - Very valubale - Enjoyed them very much.
    • Final Cut Express 4
    • Final Cut Pro 6 - DVD course (now probably version 7)
    Yours Bengt W

  • Probably simple problem with while loops

    I was programming something for a CS class and came across a problem I can't explain with while loops. The condition for the loop is true, but the loop doesn't continue; it terminates after executing once. The actual program was bigger than this, but I isolated my problem to a short loop:
    import java.util.Scanner;
    public class ok {
    public static void main(String[] args){
         Scanner scan = new Scanner(System.in);
         String antlol = "p";
         while(antlol == "p" || antlol == "P"){
              System.out.println("write a P so we can get this over with");
              antlol = scan.nextLine(); 
    //it terminates after this, even if I type "P", which should make the while condition true.
    }

    Thanks, that worked.
    I think my real problem with this program was my CS
    teacher, who never covered how to compare strings,Here's something important.
    This isn't just about comparing Strings. This applies to comparing ANY objects. When you use == that compares to see if two references refer to the same instance. equals compares objects for equality in the sense that equality means they have equal "content" as it were.

  • Problem with code: reading a string

    Hi,
    I am very new to java so excuse my naivety. i need to write some code which will decode an encrypted message. the message is stored as a string which is a series of integers which. Eg. Nick in this code is 1409030110 where a = 1, b = 2,... and there is a 0 (zero) after every word. at the moment the code only goes as far as seperating the individual characters in the message up and printing them out onscreen.
    Heres the code:
    int index = 0;
    while(index < line.length() - 1) {
    char first = line.charAt(index);
    char second = line.charAt(index + 1);
    if(second == 0) {
    char third = line.charAt(index + 2);
    if(third == 0) {
    System.out.print(first + "" + second);
    index = index + 3;
    else {
    System.out.print(first);
    index = index + 2;
    else {
    System.out.print(first + "" + second);
    index = index + 3;
    Basically its meant to undo the code by reading the first two characters in the string then determining whether the second is equal to 0 (zero). if the second is 0 then it needs to decide whether the third character is 0 (zero) because the code could be displaying 10 or 20. if so the first two characters are recorded to another string and if not only the first is recorded. obviously if the second character is not a zero then the code will automatically record the first 2 characters.
    my problem is that the code doesnt seem to recognise the 0 (zero) values. when i run it thru with the string being the coded version of Nick above (1409030110) the outputted answer is 1490010 when it should be 149311. as far as i can see the code is right but its not working! basically the zeros are begin removed but i need each group of non-zero digits to be removed seperately so i can decode them.
    if anyone has understood any of this could you give me some advice, im at my wits end!
    Thanks, Nick

    Try something like this:
    import java.io.FileInputStream;
    import java.io.InputStream;
    import java.io.IOException;
    import java.util.Properties;
    public class SimpleDecoder
        /** Default mapping file */
        public static final String DEFAULT_MAPPING_FILE = "SimpleDecoder.properties";
        /** Regular expression pattern to match one or more zeroes */
        public static final String SEPARATOR = "0+";
        private Properties decodeMapping = new Properties();
        public static void main(String [] args)
            try
                SimpleDecoder decoder = new SimpleDecoder();
                decoder.setDecodeMapping(new FileInputStream(DEFAULT_MAPPING_FILE));
                for (int i = 0; i < args.length; ++i)
                    System.out.println("Original encoded string: " + args);
    System.out.println("Decoded string : " + decoder.decode(args[i]));
    catch (Exception e)
    e.printStackTrace();
    public void setDecodeMapping(InputStream stream) throws IOException
    this.decodeMapping.load(stream);
    public String decode(final String encodedString)
    StringBuffer value = new StringBuffer();
    String [] tokens = encodedString.split(SEPARATOR);
    for (int i = 0; i < tokens.length; ++i)
    value.append(this.decodeMapping.getProperty(tokens[i]));
    return value.toString();
    I gave your "1409030110" string on the command line and got back "nick". The SimpleDecoder.properties file had 26 lines in it:
    1 = a
    2 = b
    3 = c
    // etc;Not a very tricky encryption scheme, but it's what you asked for. - MOD

  • Simple problem with triggers

    Hi all,
    Initially I have written a trigger for testing .But im not able to write it as per the requirement.Actually I have written the trigger for a table "test" when a row is inserted into it then my trigger will insert a row in another table.In the same way if an row is UPDATED then that same field of the same row is to be updated in another table.how can I do this by modifying this trigger code.Im in a confusion of doing this.
    Table: test.
    Name Null? Type
    ID NOT NULL NUMBER(38)
    UNAME VARCHAR2(15)
    PWD VARCHAR2(10)
    Table : test123.
    Name Null? Type
    ID NUMBER
    UNAME VARCHAR2(30)
    PWD VARCHAR2(30)
    the trigger is as follows:
    CREATE OR REPLACE TRIGGER inst_trigger
    AFTER INSERT OR UPDATE
    ON test
    FOR EACH ROW
    DECLARE
         id number;
         uname varchar2(20);
         pwd varchar2(20);
    BEGIN
         id := 1245;
         uname :='abc';
         pwd := 'xyz';
         IF INSERTING THEN
    INSERT INTO test123 VALUES (id,uname,pwd);
         END IF;
    END test_trigger;
    how can i modify this for the above mentioned use.
    Thanks in advance,
    Trinath Somanchi,
    Hyderabad.

    Hallo,
    naturally , you have not assign values directly in trigger. They come automatically
    in trigger with :new - variables.
    CREATE OR REPLACE TRIGGER scott.inst_trigger
    AFTER INSERT OR UPDATE
    ON scott.test
    FOR EACH ROW
    BEGIN
    IF INSERTING THEN
    INSERT INTO scott.test123 VALUES (:new.id,:new.uname,:new.pwd);
    ELSE
    UPDATE scott.test123
    set uname = :new.uname, pwd = :new.pwd
    where id = :new.id;
    END IF;
    END inst_trigger;Nicolas, yes, merge here is very effective, but i think, that OP can starts with simpler version von "upsert".
    Regards
    Dmytro

  • Simple problem with popup message before adding document on system form

    Hi all,
    We have an AddOn that validates price lines on system Sales Order form matrix, so that if prices fall below a certain value, a popup is show to ask to continue or not, when user presses ADD button.
    The problem is that if he chooses yes (to continue), the Sales Order is not added since the button ADD keeps being selected ....
    Here is my code:
            [B1Listener(BoEventTypes.et_CLICK, true)]
            public virtual bool OnBeforeClick(ItemEvent pVal)
                int iResult = B1Connections.theAppl.MessageBox("Price lines fall bellow minimum! Continue?", 1, "NO", "YES", "");
                if (iResult == 1) // NO
                    // Show error
                    B1Connections.theAppl.StatusBar.SetText("OK", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                    return false;
                // YES: Continue to add Sales Order
                return true;
    The problem is somehow related with the popup message being shown: if user says YES to continue, the system form does not continue with the standard process of adding the Sales Order (when I move the cursor above the ADD button is shows it already pressed...).
    Do I have to do anything more to force the process to continue, when the user says YES?
    Regards,
    Manuel Dias

    Thtas known problem. The solution for this is declare global variable as boolean, when user selects Yes, then set this variable to true and emulate click to add button again where before the message box check if its varaible sets to true - in this case dont show message box, only set variable to false.
    The concept of code will be
    dim continue as boolean = false
    in item event
    if continue = false then
        x = messagebox...
      if x = 1 then
        continue = true
         items.item("1").click
    end if
    else
    continue = false
    end if

Maybe you are looking for

  • Can not download adobe reader

    I am having problems installing Adobe reader on my new imac OSX Yosemite.  When installing it hangs at 44%.  I've tried using different browsers.  Can anybody help with this?

  • App updates not going away

    So I have IOS 7 currently installed on my iPhone 4S and when I go to update my apps it still shows the previous app updates, is there a way to get rid of them or is it just a defect in iOS 7?

  • Can I recover deleted bookmarks?

    Hello all, On my laptop, I accidently deleted Bookmarks off of my Safari's Bookmark Bar, which IMHO seems far too easy to do.  With an accidental click/drag, I pulled them off the bar and POOF they are gone, then trusty iCloud happily deleted them of

  • Put new battery in ipod. works fine but windows cant access

    a few days ago I successfully put a new battery in my ipod. I followed all the instructions and it has worked fine: charges plays all the music nothing weird. Then I tried to hook it up to my computer and my itunes doesnt recognize it, windows sees i

  • Approve button missing.

    I have the following users with their permissions on a particular forder: author: read/write approver: no permissions, is mentioned as a approver in a single step approval process. Issues: 1. approver does not see the folder nor the document that is