Two-dimensional time-line?

hi, everybody:
There are two frames in the time-line: frame 1 has a static movie clip naming "mcRect" in which a rectangle was drawn, and frame 2 has something different with frame 1.
I put some scripts on frame1, as bellow:
// --- my script begin ------------------------------------------
stop();
var i: Number = 0;
this.onEnterFramw = function()
     mcRect._x = mcRect._y = ++i;
// --- my script end --------------------------------------------
When i test the movie, it stop at frame 1 as expected, mean that the time-line has been halted.
But the movie clip "mcRect" namely the rectangle keep moving down-right with the frame rate, this like there has another time-line which is perpendicular to the main time-line.
Is this guess right ?
Does anybody knows the inside detail of the time-line concept?

It is behaving as I told you.  Your definition of what happens during the enterframe is defined in the function...
this.onEnterFrame = function()
     mcRect._x = mcRect._y = ++i;
The line you added is outside of that function so it will not execute more than once.

Similar Messages

  • Please change the view in the top sites, the 6.1 upgrade has reverted back to a plane two dimensional view, which is a little plain. Can I revert back to an older version via my time capsule save?

    Please change the view in the top sites, the 6.1 upgrade has reverted back to a plain two-dimensional view, which is a little dated. Can I revert back to an older version via my time capsule save? C'mon Apple upgrades supposed to leap into the future not the past. :-(

    Please change the view in the top sites, the 6.1 upgrade has reverted back to a plain two-dimensional view, which is a little dated. Can I revert back to an older version via my time capsule save? C'mon Apple upgrades supposed to leap into the future not the past. :-(

  • How do I go directly from one frame to another particular frame which is far away in the time line? (e.g the two frames are separated by 100 frames)

    How do I go directly from one frame to another particular frame which is far away in the time line? (e.g the two frames are separated by 100 frames). I mean, is it possible to take the playhead from one frame to another frame directly which is 100 frames away in the time line? Thanks for any reply.

    In the Timeline, go to the first frame and press M to put a marker on it. Go to the other frame you want to jump to and put a marker on that one too.
    Now press Ctrl+Semicolon to go to the previous marker - or Ctrl+Comma to go to the next marker.
    Andy

  • Can two different video formats be combined on the time line?

    I am working with several clips some are older and standard, others were shot on a HD camcorder.  Can they be combined on the time line.  Do I have to change the settings...  I am using FCP 6.  Thanks.

    The short answer is yes, standard definition and high definition can be combined in the same timeline. There are a series if problems and issues that arise from the fact that the HD will typically be 3-7 times the size of the SD. These tend to be questions for the editor, not tech support.
    The best way to approach this is to read the FCP online Help files dealing with mixed SD/HD and start making the decisions on how you want to utilize the footage, then the questions you ask will get you the specific answers you desire.

  • Variable number of two dimensional arrays into one big array

    I have a variable number of two dimensional arrays.
    The first dimension is variable, the second dimension is always 7.
    i.e.:
    Object[][] array0 = {
    {"tim", "sanchez", 34, 175.5, "bla", "blub", "[email protected]"},
    {"alice", "smith", 42, 160.0, "la", "bub", "[email protected]"},
    Object[][] array1 = {
    {"john", "sdfs", 34, 15.5, "a", "bl", "[email protected]"},
    {"joe", "smith", 42, 16.0, "a", "bub", "[email protected]"},
    Object[][] arrayi = ...I'm generating these arrays with a for-loop:
         for (int i = 0; i < filter.length; i++) {
              MyClass c = new MyClass(filter);
              //data = c.getData();
    Where "filter" is another array which is filled with information that tells "MyClass" how to fill the arrays.
    "getData()" gives back one of the i number of arrays.
    Now I just need to have everything in one big two dimensional array.
    i.e.:Object[][] arrayComplete = {
    {"tim", "sanchez", 34, 175.5, "bla", "blub", "[email protected]"},
    {"alice", "smith", 42, 160.0, "la", "bub", "[email protected]"},
    {"john", "sdfs", 34, 15.5, "a", "bl", "[email protected]"},
    {"joe", "smith", 42, 16.0, "a", "bub", "[email protected]"},
    Any idea on how to accomplish this? It's blowing my mind right now.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Just brainstorming here:
    Why not put your actual data in a class and store that in a LinkedList (so you know the total number of elements for your multi-dimensional array). Then initalize your multi-dimensional array and populate it? Haven't tested the following, but thinking something along the lines of
    public class MyData {
         //data here
         public Object[] toArray() {
              //something similar to this
              return new Object[] = {"tim", "sanchez", 34, 175.5, "bla", "blub", "[email protected]"};
    LinkedList<MyData> data = new LinkedList<MyData>();
    data.add(mydata1);
    //however many times you need
    Object[][] arrayComplete = new Object[data.size()][7];
    for(int i = 0; i < data.size(); i++) {
         arrayComplete[i] = data.removeFirst().toArray();
    }Another option for knowing how many rows you would need might be using something like:
    int rows = 0;
    rows += array1.length;
    rows += array2.length;
    //etc...But is not entirely useful if you don't know how many variable arrays you have (although reflections might help if the name of the array variable is incremented systematically, someone told me earlier to avoid reflections since it could make debugging a LOT more difficult).
    Edited by: bogdana on Apr 1, 2010 10:38 AM

  • Retrieving  two dimensional arrays from a text file.

    Good evening
    I am having a problem with reading a text file, and putting this info into a 2D array to be put into a table.
    I have the table already(but no code to add rows to the table incase the array increases)
    The array is called Product[a][ b ]
    where a is the product number(the row), and b are details about this product.
    The file i want to be read looks like this:
    data.txt
    CPU|AMD|X2, 64bit, 2GHz|$150|9
    Video card|NVidia|7800 GTX 256MB|$400|4
    e.g. product[2][4] would equal 4
    Basically: Type, manufacturer, specifications, price, amount in stock.
    the "splitter" or "field terminator" is "|"
    This is what i want it to do:
    Store fileline into single string,
    split string and put it in product[ j ][ i ]
    repeat with next lines until nothing is read anymore.
    This is the code I have so far:
    try{
            FileReader textFileReader = new FileReader("C://BACKUP2//data.txt");
            BufferedReader textReader = new BufferedReader(textFileReader);
            for(int j=0; j<0; j++){
                 for(int i=0; i<6; i++){ //i starts at 0, condition: i is under 6, 1 is added to i at each loop/update.             
                       ProductT = textReader.readLine();
                       textReader.close();
                       for(String Product[j] : ProductT.split("|")){ //this line is completly wrong, but i don't know how else to do it.
         // for counting for the number of columns
    catch (IOException e) {System.out.println(e);}
    I don't even think this code makes any bloody sense, I don't know if I'm approaching it correctly.
    Would anyone be gracious enough to give me a helping hand and tell me what/how to change my code?
    from what I see, the problem lies less in the loops, but more in the splitting of the string. no function seems to like 2D arrays :(

    So this is where I stand:
         //Reading
        try{
            FileReader textFileReader = new FileReader("C://BACKUP2//data.txt");
            BufferedReader textReader = new BufferedReader(textFileReader);
            for(int j=0; j>0; j++){ // this will go on forever now or what?
    // yes, this will loop forever, which is fine as long as you break out of the loop when you reach the end of the file (which is indicated by textReader.readLine() returning null)
                 // replace the for(String currentField : ProductT.split("|")) loop with this one
                 //for(int i=0; i<6; i++){ //i starts at 0, condition: i is under 6, 1 is added to i at update.       
                      String inputline = textReader.readLine();    // read a single line from the file each time through the loop
                      //while (inputline != null) {
                            if (inputline != null) {    // check if the end of the file has been reached
                           //ProductT = textReader.readLine(); //put to single string
                       //textReader.close(); //shut it off    // move this line to the end of processing, you don't want to close the file until you've read everything from it.
                       //for(String currentField : ProductT.split("|")){   //Split string...      according to JBuilder "The local variable currentField is never read"
                             // switch this loop to use the regular for(  ;  ;  ) type, that way you will have another counter to use as the second index in the product assignment
                                         //currentField = Product[j];
                        product[i][] = currentField; // use the index of the second loop as the second index here
    else {
    break; // break out of the loop when end of file is reached
         //} // the for i etc. end here
    } // End for j et cetera...
         } //end Try
    catch (IOException e) {System.out.println(e);}
    //cut the crap
    // close the reader here
    ok - so I am not quite sure about what you mean here
    "Assign each of the 5 fields to the five [][j]
    positions of the array. "
    should i put 5 "fors" in there? - currently the
    program is compiling - although they do not appear in
    the table.I put comments in the code that should answer those questions.
    The code for the table is
    Object[][] data = {
              {Product[0][0], Product[0][1],
                   Product[0][2], Product[0][3], Product[0][4]},
                   {Product[1][0], Product[1][1],
    Product[1][2], Product[1][3],
    uct[1][3], Product[1][4]},
                          {Product[2][0], Product[2][1],
    Product[2][2], Product[2][3],
    ct[2][3], Product[2][4]},
                              {Product[3][0], Product[3][1],
    Product[3][2],
    Product[3][2], Product[3][3], Product[3][4]},
                    {Product[4][0], Product[4][1],
    Product[4][2],
    Product[4][2], Product[4][3], Product[4][4]},
    ;If I do not declare any of these strings (e.g. I have
    only declared Product[0-2][] oldschol style) an error
    occurs, telling me that
    Caused by:
    java.lang.ArrayIndexOutOfBoundsException: 3
         at data.<init>(data.java:112)
         ... 5 more
    When you declare product, you'll need to give it a size for both dimensions. The first dimension will be the number of lines to be read from the file. You'll need to know this before allocating the array, so either count them in the file, (if that's good enough for this assignment) or loop through the file once before reading it to count the lines. The second dimension of the array will be 5, since that's how many fields each line has.
    btw; do I give those duke stars when all problems of
    my life(currently: reading the two dimensional
    string) have been resolved?I don't know about [i]all the problems of your life, but when the topic of the thread has been solved, then give them to whoever helped. :)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How can I use two dimensional array ?

    Could some one show me how to use two dimentional array ?
    I am know how to right a single ...but not two dimentional....please help,
    Thanks,
    Flower
    public class Exam5
    public static void main(String[] args)
    int[][] numbers =
         {     {1,2,3,4,5,6,7,8,9,10},
    {1,2,3,4,5,6,7,8,9,10} };
    for(int i = 1; i < 11; ++i)
    System.out.println(i + "\t" + i * 2 + "\t" + i * 3 + "\t" + i * 4 + "\t" + i * 5 +
    "\t" + i * 6 + "\t" + i * 7 + "\t" + i * 8 + "\t" + i * 9 + "\t" + i * 10);
    Display #
    1     2     3     4     5     6     7     8     9     10
    2     4     6     8     10     12     14     16     18     20
    3     6     9     12     15     18     21     24     27     30
    4     8     12     16     20     24     28     32     36     40
    5     10     15     20     25     30     35     40     45     50
    6     12     18     24     30     36     42     48     54     60
    7     14     21     28     35     42     49     56     63     70
    8     16     24     32     40     48     56     64     72     80
    9     18     27     36     45     54     63     72     81     90
    10     20     30     40     50     60     70     80     90     100

    First, try not to ask someone to do your homework for you and then tell them they are wrong. The code posted may not have been exactly what you were looking for, but it was not wrong because it did exactly what the poster said it would do - print out the multiplication table.
    Second, in the future if you ask specific questions rather than posting code and hoping someone will fix it for you, you may one day be able to complete the assignments on your own.
    Here is code that prints what you want and uses a two dimensional array. Please ask questions if you do not understand the code. You will never learn if you just use someone else's code without taking the time to examine or understand it.
    public class MultiTable{  
        public static void main(String[] args)   { 
            int rows = 10;
            int columns = 10;
            int [][] numbers = new int [rows] [columns];
            for(int j = 0; j < rows; j++)   // for each of 10 rows
                for(int k = 0; k < columns; k++)    // for each of 10 columns
                    numbers[j][k] = (j+1) * (k+1);  // calculate row+1 * col+1
            for (int j = 0; j < rows; j++)  // for each of 10 rows
                for (int k = 0; k < columns; k++)   // for each of 10 columns
                    System.out.print(numbers[j][k]+" ");    // print out result
                    if (numbers[j][k] < 10)     // for single digit numbers
                        System.out.print(" ");  // print extra space for better formatting
                System.out.println();       // skip to next line
    }

  • Can only export 18 minutes of 1 hour time line

    Hello
    I have a completely rendered, for Neat noise reduction, time line that is just over 1 hour long by about a minute.  This was an award ceremony for a client shot on Sony PMW320 camcorder with SxS card at 1080i 29.97 and set up the same in Premiere on the time line.  Lights illuminating the stage at request of the CEO had been taken down much lower than they should have been because they were bothering him at the lecturn where he was speaking in pre-show checks.  Consequently I had to use 12db gain which left me with a lot of noise.  My plan was to use Neat noise reduction and take care of all the render times and mixing of two mono audio tracks in Premiere before giving him a Quicktime file to use in his FCP system and then he would be able to insert the reaction and floor shots from a 2nd handheld B camera which was mobile on the floor.  I did not know if he had a good noise reduction software program himself and just wanted to save him all the labor.
    As I am new to Premiere my first project for this for the time line did not have the audio set up correctly, but the clips were imported into the Media Browser and were able to be worked with OK for a short while before I realized I would nead to redo it for the audio.  From my camera it was a continuous 1 hour take but the SxS files copied straight from my camcorder first to my 2 3TB internal drives set up for RAID 0 on my new Mac Pro from OWC built with their MPG program, were broken into 3.56GB clips of 12 min 32 second lengths.     6 core 3.46ghz CPU and Quadro 4000 GPU  48gb memory for the system.
    On the second and new project with the correct audio settings, I experimented with copying those same files from the camcorder to a different 1TB internal drive.  I must have done that differently, maybe by hi lighting the separate clips together and dragging them into the drive, because when I imported them into the Media Browser this time they came in as 1 continuous file.  And that is what is on the noise processed and audio mixed time line.....one continuous sequence with no cuts or breaks in it.
    Twice now I have tried to export the completely rendered "continuous" sequence to a 64gb flash drive with the USB 2.0 connector on the Mac.  Each time the process has taken about 7 and 1/2 hours and each time it has stopped at 18 minutes and 11 seconds in.  4.29GB copied for both tries.  Does anyone see something here that explains why the export would stop short each time in the same place?  No error messages, and no problem with RAM as I have the 48gb.   When setting it up and the export begins it shows in the window the full 1 hour length with the start and end points it will take it from.
    Thanks much
    Ron

    Sorry for the delay in getting back.  I had woken around 3:30AM and got up to check the status of the 2nd export attempt, and when I found the same situation as the first attempt, stayed up to post here and see what reponses hopefully might be here when I got up in the morning.
    Ann, there are no gaps on the time line as it is one continuous file, due I guess in how I saved it to the other disc.  Just uploaded the one really good Neat profile I got on the individual file segments in the browser from the RAID drive that I had placed on the time line with the first sequence.  The first three of those left a bit more noise in some spots, but a lot of noise still crawling on the right cheek of the CEO in the low light he saddled us with.  Luckily the 4 try Neat really nailed it. 
    BUT....after typing the above I just re-inserted the Lexar flash drive and brought up its info and yep it does say, "MS-DOS (FAT 32)"    Uggghhhh!  Bought it a week and a half ago from Office Depot in town.  Wasn't cheap.... $178 plus tax.  Still have my receipt, hopefully they will refund.  This type of scenario is exactly why I bought that large a size ....64gb.  To be able to have enough space to leave shooting job with a client if necessary and they could mail it back to me when the job was offloaded.
    Is there any kind of flash drive that size then, that doesn't have the file size restriction I can pick up from on line or like a Frys please?  I think the incredibly slow export was due to the 2.0 USB and all the Neat noise reducing information, plus HD codec I guess.  7 1/2 hour export and only 18 minutes out of the hour covered..  Are there any other convenient options to leave with a client, with maybe SATA connection, which would be safe to ship back to me in these situations that could take the jostling from shipping?
    Thanks very much
    Ron

  • How to copy data in text file into two-dimensional arrays?

    Greeting. Can somebody teach me how to copy the input file into two-dimensional arrays? I'm stuck in making a matrix with number ROWS and COLUMNS according to the data in "input.txt"
    import java.io.*;
    import java.util.*;
    public class array
        public static void main (String[] args) throws FileNotFoundException
        { Scanner sc = new Scanner (new FileReader("input.txt"));
            PrintWriter outfile = new PrintWriter("output.txt");
        int[][]matrix = new int[ROWS][COLUMNS];
    }my input.txt :
    a,b,c
    2,2,1
    1,1,1
    2,2,1
    3,3,1
    4,4,1
    5,5,1
    1,6,2
    2,7,2
    3,8,2
    4,9,2
    5,10,2

    import java.io.*;
    import java.util.*;
    public class array {
        public static void main(String[] args) throws IOException {
            FileInputStream in = null;
            FileOutputStream out = null;
    try {
        in = new FileInputStream("input.txt");
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        String line = null;
        while ((line = reader.readLine()) != null) {
            String split[]=line.split(",");
    catch (IOException x) {
        System.err.println(x);
    } finally {
        if (in != null) in.close();
    }}}What after this?

  • How to make the Time Line in Vertical ?

    Hi All
    I have created a Schedule Board using the Schedule Viewer but
    including the Flexlib in my project .
    Now the thing is that the Timeline which us to come on the
    top of the
    ScheduleViewer I need to get that Time line Vertically in
    left side
    of the ScheduleViewer to display the time in left side,and
    all the
    date's in the top .
    How can I do that to get the Timeline Vertically and the Date
    at the
    position of TimeLine .
    Thanks
    Vivek Manchanda
    Theikos IT Solution

    One improvement.. To get a line that is neat, use a bit of Graphics2D
        public void paintComponent(java.awt.Graphics g)
            int w = getSize().width;
            int h = getSize().height;
            // draw a line between (0,0) and (w,h)  
            g.setColor(getForeground());
            if (strTop == null)
                strTop = "  ";
            if (strBottom == null)
                strBottom = "  ";
                java.awt.Graphics2D g2 = (java.awt.Graphics2D)g;
              g2.setRenderingHint(java.awt.RenderingHints.KEY_ANTIALIASING,java.awt.RenderingHints.VALUE_ANTIALIAS_ON);
              //g2.setStroke(new java.awt.BasicStroke(14.0f));
            g.drawLine(0, 0, w, h);
            //the following lines will draw the two strings,
            //one above the top of the line and the above below it.     
            g2.drawString(strTop, (w/2)+2, (h/2)-2);
            g2.drawString(strBottom, 2, (h / 2) + 2);
            //the x,y for drawString are only based on assumption.   //do necessary changes to suit ur needs.
        }Then create a TableCellRenderer and set it to the Table Header for ur table's 1st row.....
    Cheers

  • Mapping question - one dimensional to two dimensional

    Hi
       We are on XI 3.0 SP13 - and I have this mapping scenario
    Source structure - Linear & simple with say 10-20 fields -
    Target structure - Name -value field pair with an unbounded node on top -
                                <b>MsgAttrib 0-Unbounded
                                    Name
                                    Value</b>     
    I have to map each distinct field value from the source structure - to the Value field on target structure. The Name field in the target structure should contain the name of the source field ( it can contain a constant - field name if we cannot get the source element name during mapping runtime, thats ok )
    So basically each elementname and its value on the source structure form a record on the target xml. The next source element and its value will be mapped to the next record on the target xml - this filling up the two dimensional target structure - with as many rows as the number of source fields to be mapped. The number of such source fields to be mapped can grow . ( there should not be any limitation on that )
    Can this be accomplished using standard functions in message mapping - or should we resort to writing udfs ?
    Any right thoughts, solutions to solve this mapping scenario will be awarded points rightaway .....

    Hi karthik,
    The mapping that ur scenario requires can be accomplished using the standard functions...
    now ur source structure is unbounded...tht means it can have multiple occurences...
    and for each occurence you have a pair of values in target message under a node....
    now the important thing here is ..tht ur target node which has those two fields under it will repeat as many times as occurences of the source message...
    so u  need to map the main message type node of the source to this node in target...
    and according map the fields under tht node...
    UDF's are not required for this....
    Regards ,
    Sushil Hadge

  • Trouble drawing a real time line across X axis.

    Hi,
    I am trying to draw a line across the X axis in real time, but for some reason, the simply cases are way off. For example, If I try to draw the line for two minutes. my line will only make it to about 1 min 45-50 seconds within that time. I tried to make up for the difference by checking the system clock, but that has not helped. Can anyone see something obviously wrong in my code:
    protected class GraphTimerTask extends TimerTask {
         protected static final int DELAY = 31;
         protected long currentTime = 0;
         protected long previousTime = -1;
         private boolean isOn = false;
         protected Timer timer = null;
         public GraphTimerTask(Timer t) {
              this.timer = t;
              isOn = true;
         public void run() {
              if(previousTime > 0) {
                   currentTime += System.currentTimeMillis() - previousTime;
              else {
                   currentTime += DELAY;
                    Graph.this.repaint();
                 previousTime = System.currentTimeMillis();
         protected boolean isOn() { return isOn; }
         protected long getTime() { return currentTime; }
         protected void stop() { isOn = false; timer.cancel(); }
    }currentTime is the actual time that is repainted on my graph when the repaint() is called.

    Timer does not take into account the time taken to process the Timer event. The following is one of my simple examples of how to do something similar to what you want to do and to take into account (parially) the processing time..
    import java.awt.*;
    import javax.swing.*;
    import java.util.*;
    public class SimpleAnimation extends JFrame
        public SimpleAnimation()
            super("Simple Annimation Demo");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            // The model instance
            AnnimationModel annimationModel = new AnnimationModel();
            // The view of the model
            AnimationView animationView = new AnimationView(annimationModel);       
            animationView.setPreferredSize(new Dimension(640, 480));
            // The view becomes the content pane
            setContentPane(animationView);
            pack();
        private static class AnimationView extends JPanel
            AnimationView(AnnimationModel annimationModel)
                // Save a reference to the model for use
                // when the view is updated
                annimationModel_ = annimationModel;
                // Listen for the events indicating that the model has changed
                annimationModel_.addObserver(new Observer()
                    public void update(Observable o, Object arg)
                        // All we need to do is to get the view to repaint
                        AnimationView.this.repaint();
            public void paintComponent(Graphics g)
                super.paintComponent(g);
                // Update the view based on the information in the model.
                g.setColor(Color.red);
                // Convert the model positions to view positions
                // in this case by scaling to the actual width and height.
                int xScreenPosition = scaleValue(annimationModel_.getX(), getWidth() - 20 ) + 5;
                int yScreenPosition = scaleValue(annimationModel_.getY(), getHeight() - 20 ) + 5;
                // Display the position of the point
                g.fillOval(xScreenPosition, yScreenPosition, 10, 10);
            private int scaleValue(double v, double size)
                return (int)((v+1.0)*0.5 * size + 0.5);
            // The saved reference to the model
            private AnnimationModel annimationModel_;
        private static class AnnimationModel extends Observable
            AnnimationModel()
                new Thread()
                    public void run()
                        long updatePoint = System.currentTimeMillis();
                        final long delta = 100;
                        final double deltaTheta =  2.0 * Math.PI * delta / (10.0 /* seconds  */ * 1000.0);
                        // Loop forever updating the model
                        // and notifying the observers.
                        while(true)
                            // Wait until the next frame update point
                            // The approach is to calcualte how long we have to wait. In
                            // this way we partially compensate for the processing time
                            updatePoint += delta;
                            synchronized (this)
                                while (updatePoint > System.currentTimeMillis())
                                    try
                                        this.wait(updatePoint - System.currentTimeMillis());
                                    catch (Exception e)
                                        // Nothing to do
                            // Update the model - in this case it is very simple
                            theta_ += deltaTheta;
                            // Notify the observers
                            setChanged();
                            notifyObservers();
                }.start();
            // Model access methods
            public double getX()
                return Math.cos(theta_);
            public double getY()
                return Math.sin(theta_);
            // The angular position of the point
            private double theta_;
        // Simple test main
        static public void main(String[] args)
            new SimpleAnimation().setVisible(true);
    }

  • Sorting a two dimensional array in descending order..

    Guy's I'm a beginning Java programmer. I've been struggling with finding documentation on sorting a two dimensional primitive array in descending order.. The following is my code which goes works, in ascending order. How do I modify it to make the list write out in descending order?
    class EmployeeTable
         public static void main(String[] args)
         int[][] hours = {
              {2, 4, 3, 4, 5, 8, 8},
              {7, 3, 4, 3, 3, 4, 4},
              {3, 3, 4, 3, 3, 2, 2},
              {9, 3, 4, 7, 3, 4, 1},
              {3, 5, 4, 3, 6, 3, 8},
              {3, 4, 4, 6, 3, 4, 4},
              {3, 7, 4, 8, 3, 8, 4},
              {6, 3, 5, 9, 2, 7, 9}};
         int [] total = new int [hours.length];
         for (int i = 0; i < hours.length ; i++){
              for (int j = 0; j < hours.length ; j++){
                   total[i] += hours[i][j];
         int[] index = new int[hours.length];
         sortIndex(total, index);
    for (int i = 0; i < hours.length; i++)
    System.out.println("Employee " + index[i] + " hours are: " +
    total[i]);
    static void sortIndex(int[] list, int[] indexList) {
    int currentMax;
    int currentMaxIndex;
    for (int i = 0; i < indexList.length; i++)
    indexList[i] = i;
    for (int i = list.length - 1; i >= 1; i--) {
    currentMax = list[i];
    currentMaxIndex = i;
    for (int j = i - 1; j >= 0; j--) {
    if (currentMax < list[j]) {
    currentMax = list[j];
    currentMaxIndex = j;
    // How do I make it go in descending order????
    if (currentMaxIndex != i) {
    list[currentMaxIndex] = list[i];
    list[i] = currentMax;
    int temp = indexList[i];
    indexList[i] = indexList[currentMaxIndex];
    indexList[currentMaxIndex] = temp;

    Bodie21 wrote:
    nclow all you wrote was
    "This looks to me like a homework assignment that you're asking us to solve for you. Your description of what it does isn't even correct. It doesn't sort a 2d array.
    You would probably elicit better help if you could demonstrate that you've done some work and have something specific that you don't understand."
    To me that sounds completely sarcastic. You didn't mention anything constructive besides that.. Hence I called you a male phalic organ, not a rear exit...Bodie21, OK, now you've got 90% of us who regularly contribute to this forum thinking your the pr&#105;ck. Is that what you wanted to do? If so, mission accomplished. Many will be looking for your name next time you ask for help. Rude enough for you?

  • Creating a Two Dimensional Array in Xcode and populating it with a values f

    Whats the easiest way to declare a two dimensional array in Xcode. I am reading an matrix of numbers from a text file from a website and want to take the data and place it into a 3x3 matrix.
    Once I read the URL into a string, I create an NSArray and use the componentsSeparatedByString method to strip of the carriage return line feed and create each individual row. I then get the count of the number of lines in the new array to get the individual values at each row. This will give mw an array with a string of characters, not a row of three individual values. I just need to be able to take these values and create a two dimensional array.

    I'm afraid you are in the wrong place. Look here for the last two forums on programming. However, XCode support is mostly found at developer.apple.com. You can access their forums by registering. Registration is free.

  • Fine Control of Time-line expansion

    When I expand the time-line I don't get the fine control I want at large expansion settings.
    If you push the slider all the way to the left you get only ~10 frames or less on the time-line.
    Moving the slider as little to the right as possible I get more expansion than I want
    Is there a way to do fine-control and get expansion in between those two settings?

    Not sure anyone will have an exact answer for you but, in addition to the suggestions already provided, you might want to try:
    So long as your active window is not the Browser, pressing Option & - or + will zoom out/in.
    (As mentioned, the Command key works, but only if the Timeline is the active window.)
    If you're looking to zoom into a groups of clips, select them and press Option-Shift-Z to Fit To Selection

Maybe you are looking for

  • IPads no longer appear/sync in iTunes 11.0.4

    Since iTunes 11.0.4 update (OS X 10.8.4), all the iPads no longer appear as devices in iTunes and thus won't synchronise. iPod classic & nano still show up when connected and sync. fine. The iPads no longer show up either via WiFi or USB connection:

  • Multiclip 9 up not playing

    I'm editing a sequence with 6 cameras, and the footage was shot on DVCPROHD 720p60. I intend to make offline RT files to edit the sequence with the multicam. The first issue is that there doesn't seem to be an offlineRT option for 59.94 fps (the offl

  • Setting DHCP on Solaris 8

    I am trying to set up a DHCP on Sunblade 100. I have D-link router that connects me to the internet with my other computers. I can't seem to let my DHCP server to give out IP addresses instead of my router. I have been working on this for the last th

  • Sections in Form Construction

    Hi All, While creating a form, we will divide the document into sections and create them individually. Instead of that is there any way to create all sections at a time by taking the text from word document? Thanks, Kiran

  • Hi does anyone know if you upload / store / print out text messages.

    Hi does anyone know if you can upload / store / print out your text messages as they appear on your phone?