Working out the Concrete classes of an Interface

Hi all I have an interface e.g. Animal with 3 concrete classes:
Dog, Cat and Bird.
Is there a way of working out that the Animial interace contains these 3 concrete classes in anyway?
Thanks,

notforgoogle wrote:
Is there a way of working out that the Animial interace contains these 3 concrete classes in anyway?Not really, no.
First of all, it doesn't "contain" them. The relationship between class and interface is one-way.
You could whip up something that examines every class on your classpath, or a portion of it, and cheks whether it implements that interface. However, this will not work in general, since classes can be loaded from anywhere, and you may not always have the right or ability to list the classes present there, only to request specfic classes by name.

Similar Messages

  • How do you work out the number of days difference between two dates?

    I'm running Crystal v12.
    We use a date field in our SQL database that we use to store the client's year end date.
    As the year end date (date and month) doesn't change for a client, the year end date field in all of our reports is set to just show the DD/MM part. Over the years as new clients are set up we just enter the date and month - the year part is irrelevant although as in all date fields the year is automatically entered.
    Doing it this way means that we don't have to adjust the year end year part each year. We just use the DD/MM part.
    I need to create a formula that works out the number of days there have been (i.e. the difference) from the current date to the year end date. It MUST EXCLUDE the year however.
    For example:
    Year End Date = 30/04/03
    Current Date = 25/05/10
    Days Difference (EXCLUDING year) = 25
    Days Difference (including year) = 2582
    Year End Date = 31/03/09
    Current Date = 25/05/09
    Days Difference (EXCLUDING year) = 55
    Days Difference (including year) = 420
    If you include the year part then working out day difference is simply a case of creating a formula that subtracts the year end date from the current date (CurrentDate - {tblClient.YearEnd}.
    HOWEVER I need to exclude the year part.
    Can anyone tell me the formula or best way to do this?
    Thanks in advance.
    Edited by: BadBoy House on May 25, 2010 3:15 PM
    Edited by: BadBoy House on May 25, 2010 3:15 PM

    Hi
    You can try this
    datevar e := date(year(currentdate),month({tblClient.YearEnd}),day({tblClient.YearEnd}));
    numbervar num_days := datediff("d",currentdate,e)
    Create a datevar called e that uses the original month and day numbers for {tblClient.YearEnd} but uses the year of the current date
    Then just datediff on e to get the number of days between the two dates
    I hope i understand your problem and that this helps
    Best regards
    Patrick

  • Automatically working out the domain for a cookie

    Hi all
              We have a couple of web sites that we want to share cookies between
              we have one site www.mysite.com and another, registration.mysite.com
              If, when I add a cookie and hardcode the domain to '.mysite.com' everything
              works fine. However I would like to dynamically work out the domain because
              we deploy our sites within a number of countries and i dont want to hardcode
              the domain name (eg uk would be www.mysite.co.uk, so the domain would be
              .mysite.co.uk )
              If someone enters www.mysite.com/request.jsp i want to be able to extract
              .mysite.com out of the url and specify it as the domain when adding cookies.
              Does anyone know of any servlet related methods that can get the url that
              was requested - including the server name?
              request.getServerName() wont work because it returns the machine name (ie
              the name of your machine within a network). request.getRequestUrl() also
              wont work for the same reason.
              If anyone knows how i would extract the url the user typed in then that
              would be great
              Thanks
              matt
              

    Hi
    After Some googling I could find out this for you. I think it is a bug with IE.
    http://www.webmasterworld.com/forum21/11530.htm
    The idea is to use a virutal host.
    HTH
    VJ

  • [svn:bz-trunk] 20680: Tomcat 7 Login Module work, due to the Tomcat 7 Security framework change we need to work out the security integration piece for tomcat 7 .

    Revision: 20680
    Revision: 20680
    Author:   [email protected]
    Date:     2011-03-08 08:23:30 -0800 (Tue, 08 Mar 2011)
    Log Message:
    Tomcat 7 Login Module work, due to the Tomcat 7 Security framework change we need to work out the security integration piece for tomcat 7. So far the ValveBase and tomcat Realm had API changes which will impact on the Login integration with Tomcat 7
    Modified Paths:
        blazeds/trunk/modules/opt/build.xml
    Added Paths:
        blazeds/trunk/modules/opt/lib/catalina-708.jar
        blazeds/trunk/modules/opt/src/tomcat/flex/messaging/security/TomcatValve708.java

    Revision: 20680
    Revision: 20680
    Author:   [email protected]
    Date:     2011-03-08 08:23:30 -0800 (Tue, 08 Mar 2011)
    Log Message:
    Tomcat 7 Login Module work, due to the Tomcat 7 Security framework change we need to work out the security integration piece for tomcat 7. So far the ValveBase and tomcat Realm had API changes which will impact on the Login integration with Tomcat 7
    Modified Paths:
        blazeds/trunk/modules/opt/build.xml
    Added Paths:
        blazeds/trunk/modules/opt/lib/catalina-708.jar
        blazeds/trunk/modules/opt/src/tomcat/flex/messaging/security/TomcatValve708.java

  • Designing a banner stand: Is there a easy way to work out the recommend margins / bleed?

    So its my first time creating a banner stand and something of larger scale. I was wondering if there is a certain way to work out the recommended margins for the size of the document? Or should i simply do it by eye. The banner dimensions our 800m x 1200mm.
    Also any other tips for creating larger document would be appreciated.

    It sounds like the same product that we do a lot of here. There's no technical reasons for a particular margin, as they can be full bleed (print right to the edge), so it's a subjective design decision.Take into consideration the content and the context. It could be a something with little content, intended to draw people from a distance (larger margins), or it could be something with a lot of content that will be read from a short distance (smaller margins).
    I tend to do these as 1:1 scale, but bear in mind that InDesign's Optical Kerning will be too tight when you do this.

  • Java Time Work out the difference

    Hello. This is my first forum here. I am having difficulties in solving this code below:-
    If one data has a time of "14:00" - If this data went over the today's time so we would say it is too late. If this data is started before the today's time. It is done.
    Calendar TodayDate = Calendar.getInstance();
              SimpleDateFormat formatTime = new SimpleDateFormat("HH:mm");
              String timeNow = formatTime.format(TodayDate.getTime());
    System.out.print("Time Now is " +timeNow);
    String dataTime = "13:45";
    System.out.print("\nData Time is " +dataTime);
    if (dataTime > timeNow) {
    System.out.print("Too Late");
    if (dataTime < timeNow) {
    System.out.print("It is done");
    }Basically - the IF statement is wrong as it is String. Need help on how to change the String to Integer or Long (work out the milliseconds) Help would be appreciated

    why don't you use this ...
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html#after(java.util.Date)
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html#before(java.util.Date)
    to convert you String '13:45' in millisecond, you should create a date so...

  • How can i work out the GMT time wherever i am ?

    Hi, i'm going crazy with the date/time classes, just can't seem to work it out.
    I need to know the current time as a GMT time.
    I need to know wherever the program is running, i myself am in Amsterdam GMT+02:00 , my server is located in Canada GMT-04:00 (?)
    I parse dates from websites all over the world so i get times in the form of strings of which i know the timezone. I need to store everything in a mysql database and i want the database to contain GMT times only.
    I've worked out how to get a string from its timezone into GMT but,
    how can i get the current time as GMT ?
    somehow i keep getting timeshifts i cannot explain.
    this is where i got to:
    TimeZone tz_gmt;
    tz_gmt = TimeZone.getTimeZone("GMT");
    SimpleDateFormat sdformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    sdformat.setTimeZone(tz_gmt);
    Timestamp tsGmtnow;
    tsGmtnow = Timestamp.valueOf(sdformat.format(new Date()));
    Which is fine if i run it in Amsterdam, it gives me the current date/time in GMT, but on the server in Canada it gives me GMT+4 hours. What am i missing ?

    found a workaround,
         TimeZone tz_gmt;
         tz_gmt = TimeZone.getTimeZone("GMT");
         TimeZone tz_can;
         tz_can = TimeZone.getTimeZone("GMT-04:00");
         TimeZone tz = TimeZone.getDefault();
         String Stz = tz.getID();
         SimpleDateFormat sdformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         Timestamp tsGmtnow;
    if ( "Europe/Berlin".compareTo(Stz) == 0) {
         // i'm in Europe, go from local time to GMT
         sdformat.setTimeZone(tz_gmt);
         tsGmtnow = Timestamp.valueOf(sdformat.format(new Date()));
    } else {
         // i'm in Canada, local time IS gmt
         sdformat.setTimeZone(tz_can);
         tsGmtnow = Timestamp.valueOf(sdformat.format(new Date()));
    out.println(tsGmtnow.toString());
    the default timezone returns either:
    Europe/Canada
    GMT-04:00
    somehow the GMT-04:00 get ignored by the formatter

  • Need a little help with a Jbutton not working out the way I planned

    The following code is to fulfill an assignment I am working on. The problem I am having is with the btnCalc. For some reason when the button is used, the results I get is from another button. I think the variables are set right for the program to function properly but I am really hung up on this. Do anyone have any suggestions?
    import java.awt.*;                     //Contains classes for creating GUI
    import java.awt.event.*;                //For listener events
    import javax.swing.*;                     // Imports the Main Swing Package
    import javax.swing.event.*;
    import javax.swing.text.*;           // Positions text box
    import java.text.NumberFormat;          // For number format such as currency
    import java.text.*;                     // Imports the Main Text Package
    import java.util.*;                     // Utility Package
    public class MPC extends JFrame implements ActionListener           //Creates Class for MPC
    //double dblLoanAmount, dblInterestRate, dblMonthlyPayment;
    TextField txtTotalMort;
         //JButton fixRates = new JButton("Choose Fixed Rates");
         JLabel lblTotalMort = new JLabel("How much is the loan?"); // Label for dblLoanAmount amount
         JTextField txtYears = new JTextField(10);
         JLabel lblPayment = new JLabel("Your monthly payment is "); // Label for Payment
         JTextField txtPayment = new JTextField(10);
         JLabel lblYears = new JLabel("How many years?");
                             // add(lblYears);
                   JTextField txtYearsInput = new JTextField(10);
                             //a dd(txtYears);
         JLabel lblInterestRate = new JLabel("What is the interest rate?");
                             //add(lblInterestRate);
                   JTextField txtInterestRate = new JTextField(10);
                             //add(txtInterestRate);
         //JLabel lblPayment = new JLabel("Your monthly payment is:");
                             //add(lblPayment);
                   //JTextField txtPayment = new JTextField(10);
                             //txtPayment.setEditable(false);
                                  //add(txtPayment);
         JButton btnCalc = new JButton("Calculate");
                             //add(btnCalc);
                             //btnCalc.addActionListener(this);
    JButton year7InterestRateBtn = new JButton("7 years at 5.35%");     // Mortgage Term and Interest Rate
    JButton year15InterestRateBtn = new JButton("15 years at 5.50%");
    JButton year30InterestRateBtn = new JButton("30 years at 5.75%");
    JButton reset = new JButton("Clear All");
    JTextArea boxSpace = new JTextArea(100,200);          // Morgtage table size
    JScrollPane scroll = new JScrollPane(boxSpace);     // ScrollPane
              public MPC()     // Method
         super("MPC");     // Frame Title
              JMenuBar mb = new JMenuBar();     // Menu Bar
    setJMenuBar(mb);
                        setSize(325, 500);          // Frame Size
                        JPanel pane = new JPanel();
                        pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS)); //Grid box configuration
                        Container grid = getContentPane();
                        grid.setLayout(new GridLayout(8,2,8,8));     // Grid Layout
                        pane.add(grid);                                        // Adds grid
                        pane.add(scroll);                                   // Adds scrollPane
                   grid.setBackground(Color.white);
                        Setting color of text and backgrounds
                   txtYears.setBackground(Color.white);
              txtYears.setForeground(Color.black);
                   txtYears.setFont(new Font("Arial", Font.PLAIN, 10));
                        txtPayment.setBackground(Color.white);
                   txtPayment.setForeground(Color.black);
              txtPayment.setFont(new Font("Arial", Font.PLAIN, 10));
                   boxSpace.setBackground(Color.white);
                   boxSpace.setForeground(Color.black);
                   boxSpace.setFont(new Font("Arial", Font.PLAIN, 10));
              grid.add(lblYears);
              grid.add(txtYearsInput);
              grid.add(lblInterestRate);
              grid.add (txtInterestRate);
              grid.add(lblTotalMort);          // Adds the Mortgage Amount Label
              grid.add(txtYears);               // Adds the Mortgage Amount Text Field
              grid.add(lblPayment);           // Adds the Payment Label
              grid.add(txtPayment);           // Adds the Monthly Payment Text Field
                   txtPayment.setEditable(false);          // Disables editing in this Text Field
              grid.add(btnCalc);
         grid.add(year7InterestRateBtn);               // Adds 1st Loan and Rate Button
              grid.add(year15InterestRateBtn);          // Adds 2nd Loan and Rate Button
              grid.add(year30InterestRateBtn);          // Adds the Exit Button
              grid.add(reset);                               // Adds the New Calc Button
              setContentPane(pane);                          // Enables the Content Pane
              setVisible(true);                               // Sets JPanel to be Visable
              reset.addActionListener(this);                          // Adds Action Listener to the New Calc Button
              txtYearsInput.addActionListener(this);
              txtInterestRate.addActionListener(this);
              btnCalc.addActionListener(this);
         year7InterestRateBtn.addActionListener(this);                              // Adds Action Listener to the 1st loan Button
              year15InterestRateBtn.addActionListener(this);                              // Adds Action Listener to the 2nd loan Button
              year30InterestRateBtn.addActionListener(this);                               // Adds Action Listener to the 3rd loan Button
              txtYears.addActionListener(this);                              // Adds Action Listener to the Mortgage Amount Text Field
              txtPayment.addActionListener(this);                              // Adds Action Listener to the Monthly payment Text Field
              public void actionPerformed(ActionEvent e)                               // Tests to Verify Which Button is Pressed
         Object command = e.getSource(); // Enables command to get data
         int intYears = 0;          // Declares intYears
                   double dblLoanAmount, dblInterestRate, interestRate, intRate;
         if (command == year7InterestRateBtn)                                   // Activates the 1st Loan Button
    intYears = 0;                                        // Sets 1st value of Array
         if (command == year15InterestRateBtn)                                   // Activates the 2nd Loan Button
         intYears = 1;                                        // Sets 2nd value of Array
              if (command == year30InterestRateBtn)                                   // Activates the 3rd Loan Button
                   intYears = 2;                                        // Sets 3rd value of Array
                   if (command == btnCalc)
                        //dblLoanAmount = Double.parseDouble(txtTotalMort.getText() ); // Loan amount
                        //interestRate = Double.parseDouble(txtInterestRate.getText() ); // /100 )/ 12; // Devides rate
                        intRate = (Double.parseDouble(txtInterestRate.getText() )/100 )/ 12;
                        //int intYearsMonths = Integer.parseInt(txtYearsInput.getText() );// * 12; //Multiplies loan length
                        int months = Integer.parseInt(txtYearsInput.getText() )* 12;
    dblLoanAmount = 0;                                   // Declares and Initializes dblLoanAmount
                   dblInterestRate = 0;                                        // Declares and Initializes dblInterestRate
              double [][] dblTrmLoanRate = {{7, 5.35}, {15, 5.50}, {30, 5.75},};           // Array Data for Calculation
    try
    dblLoanAmount = Double.parseDouble(txtYears.getText()); // Gets user input from txtYears Text Field
    catch (NumberFormatException nfe)                          // Checks for correct user input
                             JOptionPane.showMessageDialog(null, "You must enter a valid number.", "MPC", JOptionPane.INFORMATION_MESSAGE);
    return;
              interestRate = dblTrmLoanRate [intYears][1];
                   //dblInterestRate=interestRate;
                   intRate = (interestRate / 100) / 12;                         // Calculates Interst Rate
         double intYearsMonths = dblTrmLoanRate [intYears] [0];                    // Calculates Loan Term in Months
    int months = (int)intYearsMonths * 12;                          // Devides by months
    double interestRateMonthly = (intRate / 12); // Devides Rate
              double payment = dblLoanAmount * intRate / (1 - (Math.pow(1/(1 + intRate), months))); // Calculates monthly payment
         double dblRmnLoan = dblLoanAmount;                              //Left over balance
         double txtPaymentInterest = 0;                                   // Payment
         double txtPaymentPrincipal = 0;                                   // Payment of principal
    NumberFormat currency = NumberFormat.getCurrencyInstance(Locale.US); // Curreny format
         txtPayment.setText(currency.format(payment));
              boxSpace.setText("Month\tPrincipal\tInterest\tBalance Left\n");
              for (;months > 0 ; months -- )
              txtPaymentInterest = (dblRmnLoan * intRate);
                        txtPaymentPrincipal = (payment - txtPaymentInterest);          // Calculates monthly payment
                   dblRmnLoan = (dblRmnLoan - txtPaymentPrincipal);
                        boxSpace.setCaret (new DefaultCaret());                    // Scroll position
                        boxSpace.append(String.valueOf(months) + "\t" +               // Table data
                        currency.format(txtPaymentPrincipal) + "\t" +
                   currency.format(txtPaymentInterest) + "\t" +
                   currency.format(dblRmnLoan) + "\n");
    if(command == reset)
                             Clears fields
                        txtYearsInput.setText(null);
                        txtInterestRate.setText(null);
              txtYears.setText(null);
                        txtPayment.setText(null);
         boxSpace.setText(null);
                        public static void main(String[] args)                               //This is the signature of the entry point of all the desktop apps
              new MPC();
    }

    This portion to be exact. All the buttons work for me except this one. I need to calculate user input and also use the fixed data that can be found in the dblTrmLoanRate array. When I choos to use user input instead, the program either crashes or for some reason uses the year7InterestRateBtn instead.
                   if (command == btnCalc)
                        //dblLoanAmount = Double.parseDouble(txtTotalMort.getText() ); // Loan amount
                        //interestRate = Double.parseDouble(txtInterestRate.getText() ); // /100 )/ 12; // Devides rate
                        intRate = (Double.parseDouble(txtInterestRate.getText() )/100 )/ 12;
                        //int intYearsMonths = Integer.parseInt(txtYearsInput.getText() );// * 12; //Multiplies loan length
                        int months = Integer.parseInt(txtYearsInput.getText() )* 12;
    I was going to leave out the remed portion but thought it might help you with the navigation. I am sorry I did not use code tags, but I am going to go find out what those are and use them in the future.

  • To find the implementing classes of an interface

    Hi,
    Does anyone know a function module or class using which I can find all implementing classes of an interface?
    Regards,
    Sukru

    Hello Sukru
    If you are working already on SAP releases >= 6.20 then you will see all implementing classes if you display the interface in SE80 (tree display -> subnode of the interface).
    Alternatively, you can call method <b>GET_IMPLEMENTING_CLASSES</b> of class <b>CL_OO_INTERFACE</b> (available on >= 6.40, perhaps on 6.20, too).
    Regards
      Uwe

  • How to find out the batch class link of the batch record in the MSC3N

    Hi,
    I would like to know how to pull out the class type and the characteristic value for a batch which is found in MSC3N.
    For example, the following is MSC3N screen showing material (INM000000001724945) and batch (A000001117) tie to batch class “XXXXXXXX”.
    Hence, I would like to know:
    How to pull out the class type and the characteristic value for a batch record which is found in MSC3N? What are the table? The table show in the F1 key is not a table.
    There are two batch classes setup in the system “XXXXXXX” and “YYYYYYY”, my question is why system decides to use the batch class “XXXXXXX”? Where is the system setup to determine this?
    Thanks
    Tuff

    Hi
    The table MCH1 keeps the information about Material, Batch and Internal object no.: Batch classification (CUOBJ_BM).
    The field CUOBJ_BM in MCHA represent the 'Key of object to be classified' (AUSP-OBJEK). The first 18 characters of AUSP-OBJEK.
    In CABN (Characteristic) the field ATINN and ATNAM is important. The link between CABN and AUSP is through ATINN.

  • Card reader not working out the box scr 3500?

    cac card reader not working out of box scr3500 help

    Welcome to discussions Kevin!
    I'm sorry to hear that first of all make sure that there is nothing sick on the eye of the camera it self, after that how is the lighting on the room that the computer will be set up? did the green light came on when you're trying to use iSight? i'm asking because the same thing happen to me but it was nothing but bad lighting in my office. If this doen't help call apple asap they should replace your computer with out a problem. Hope this helps good luck!
    Miguel

  • How to find out the callers class?

    Is it possible to find out whats the callers class from within a method without having the caller to pass a reference to itslef?
    Ako

    There are many posts on the subject. Two things.
    1) Yes it's possible by getting a stacktrace.
    2) No one should ever want to implement this. It perverts the idea of the language.

  • Debug ME22N transaction to find out the message class

    Hi All,
    I want to know the best way of debugging for the following process:
    Create ME22N
    went to item level account assignment and selected the cost center.
    Got an error message in the status bar
    I wanted to find out where the message class is used in the background program
    Any help is appreciated.
    Thanks

    Hi,
    Take the message id and message number from the error message..
    Go to SE91..
    Give ID and display..
    Choose the message number..
    Press the where used list button..It will show all the programs that is using this message number..
    Thanks,
    Naren

  • Finding out the actual Class of an Object

    I have an AdvancedDataGrid (ADG) where the top level items
    are instances of my custom valueObject Class "State". The second
    level items are instances of another custom valueObject Class -
    "City". When I select an item in the ADG, I want to know which
    Class each item is - "State" or "City". Is there some way to find
    this out? I'm not looking for how to capture the event, I'm wanting
    to find out if there is some function or utility for finding out
    the Class of an Object.
    FYI, when I capture the event, and pop an Alert with the
    following code...
    Alert.show(item.constructor.toString());
    ...I see either "[class State]" or "[class City]". So, I feel
    like I'm close...
    Thanks.

    This link might be of interest:
    http://onrails.org/articles/2007/02/24/flex-introspection-api-describetype-value-xml
    http://ajaxandbeyond.blogspot.com/2008/04/object-introspection-in-flex.html
    http://livedocs.adobe.com/flex/2/docs/00000460.html#225061
    In generally, you might wish to goole for
    flex introspection

  • I just can't work out the variable here!

    Hi team,
    I have some code that I am trying to put onto 10 different moviclips m1, m2 m3 etc to 10
    I have tried to use every hint and bit of code that has been given to me by others here but I just can't get it to work..
    I am trying
    for (var i =1; i<=10; i++){
    trace("m"+i);// this gives me the right result but doesnt work in the code..
    I have tried
    m[i]
    ["m"+i]
    MovieClip("m"+i)
    this.[m+i]
    ..... and heaps more!  I just can't get it to work.
    Here is the code I am trying to use this variable on, 
    Thanks for any help,
    sub
    m1.minX = 132;
    m1.minY = 182;
    m1.maxX = 930;
    m1.maxY = 720;
    // Initialize the circle at a random coordinate within the acceptable range.
    m1.x = Math.random() *m1.maxX -m1.minX;
    m1.y = Math.random() *m1.maxY -m1.minY;
    // Set the velocity of the circle to six pixels/frame.
    m1.vel = .003;
    /* Initialize the x and y vectors for the circle clip. A "vector",
       in circle case, is a line that both direction (angle) and speed ("velocity").
       Here the direction is either horizontal (x-axis), in the
       case of "vx," or vertical (the y-axis), in the case of "vy."
       So, while it may appear that we're just assigning one number, the
       velocity, keep in mind that we've also determined the direction by
       distinguishing these values as either horizonal ("vx") or vertical ("vy").
       BUT -- while all that is true, it's also cheating a little (remember, this
       is the "simple" version.) The reality is that we're really using 2 speeds
       and 2 directions, where a vector is truly a single direction and single
       speed.  See the "complex" version for that execution.
    m1.vx = Math.random() * 3;
    m1.vy = Math.random() * 3;
    // Define an onEnterFrame() method for the circle so that it continually updates
    // its position.
    m1.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
    function enterFrameHandler(e:Event):void {
        // Calculate the new x and y coords for the circle clip on each frame
        // based on what happened in the previous frame (in the conditionals below.)
       m1.x +=m1.vx;
       m1.y +=m1.vy;
        // If the circle is touching the rectangle or is outside its boundaries,
        // change direction.
        if ((m1.x +m1.width/2) >=m1.maxX) {
           m1.x =m1.maxX -m1.width/2;
           m1.vx *= -1;
        else if ((m1.x -m1.width/2) <=m1.minX) {
           m1.x =m1.minX +m1.width/2;
           m1.vx *= -1;
        if ((m1.y  +m1.height/2) >=m1.maxY) {
           m1.y =m1.maxY -m1.height/2;
           m1.vy *= -1;
        else if ((m1.y -m1.height/2) <=m1.minY) {
           m1.y =m1.minY +m1.height/2;
           m1.vy *= -1;

    The correct way to target instances m1 thru m10 using bracket notation would be... 
    this["m"+i]
    or even more correctly...
    this["m"+String(i)]

Maybe you are looking for

  • How can I prevent Firefox from shutting down to 5% when inactive?

    My computer (running Win8, FF 22.0, just installed) is set for maximum performance, which means it enters sleep mode only when I tell it to. But recently FF 21.0 and 22.0 has started shutting down to 5% of its normal operating memory use after as lit

  • Downgrade from iTunes 7

    I have been very unhappy with iTunes 7 on my Dual 1.25 PPC G4 and would like to know what version of iTunes shipped with Panther, 10.3.9. How can I find out and how can I find the download? This site is impenetrable for me. Many, many thanks. G4   Ma

  • About GBIP and cable for GPIO

    Hi all,   I have an old device using GPIB (HP-IB 488) for data transfer, the bandwidth is not high. It is pretty slow to transfer big data. The device said it also support a high speed cable supporting GPIO port using HP 11738A cable. I try to search

  • Events in Calendar app are gone?

    I syced my iPod for the first time in quite a while, after the sync I went to check an even in the Calendar app and all events are gone. How do I fix this problem?

  • I'm new to the macbook pro

    I'm new to the macbook pro and my stupidity let me attempt to personalize it before reading the user manual....I tried dragging an icon from the dock to the desktop(the same way you create a desktop shortcut with windows), it disappeared & now I can'