Move row up

hi,
I have a small doubt in moving a row. I want the selected row in jTable to be moved one row up., but it is not working out for me,,,
the code i have written is:
((DefaultTableModel)jTable1.getModel()).moveRow(jTable1.getSelectedRow(),jTable1.getSelectedRow()-1,1);please help me out of this...

hey sorry guys, I got the answer

Similar Messages

  • Numbers hangs when trying to move rows.

    Numbers hangs with the comment 'Preparing to paste....' when I try to move rows. When I click on the screen it goes blank and nothing else happens.
    I don't appear to have any  formulas or references in the spreadsheet that might 'upset' the program. Can anyone help?
    Thanks,
    Tim

    Hi T19,
    Numbers does not handle large tables well.
    up to GL in the columns is 194 columns (numbering the columns by adding 1 to the preceding column number, and hiding most columns to make the table fit into a smaller screen shot):
    194 columns times 35 rows = 6790 cells.
    Is there some way to reorganise your data into several small tables?
    Regards,
    Ian.

  • How to move rows up and down on a SharePoint List Item

    Hello,
    I have created a simple Project Plan Template for my team using a SharePoint list.
    I have listed a sample below:
         Date  
                                Tasks        
                                               Owner
    03/09/14                             Gather requirement                        
        X
    05/09/14                             Develop                          
                          Y
    07/09/14                             Deploy                          
                            Y
    Currently there is no functionality in the template to add another task to update the Plan. eg: I want to add another task with a due date 04/09/14 to confirm requirements.
    So basically I want to be able to add an item (task) towards the end and then move it to desired position depending on the due date.
    Please suggest how this can be implemented without complex code changes as I am new to working with SharePoint.
    Many Thanks in advance,
    BH

    Hi ,
    Thanks for the response.
    But I am looking to move the rows in a particular list A and not between 2 separate list items A and B according to the date.
    List Project A has separate tasks defined which needs to accomplished in a timely manner for the project to complete on schedule.
    I want to be able to move these tasks which are in a table on the SharePoint List.
    Hope this is clear.
    Please let me know if you have suggestions for this.
    -BH

  • JTable move row

    Hi,
    JTable offers the possibility to move columns via dnd.
    Is there a possibility to do the same with rows?

    Rectangle r = table.getCellRect(....);
    table.scrollRectToVisible( r );

  • How to move rows from one partition to another?

    We have a data retention requirement for 6 months and after 6 months the data can be removed except for few records with certain statuses (which cannot be removed even if they are over 6 months). We have Oracle 11g.
    I wanted to see if the following strategy works:
    I will have monthly partitions and 8 sub partitions (hash) in each of the main partitions. The hash sub-partitions are to spread the load of application data and balance the data insertion to avoid any contention.
    At the end of 6 months, is it possible for me to move the row that needs to be kept to a different partition and drop the last partition. I wanted to avoid data deletion because we only have very little database downtime and data deletion require us to coelize the database to avoid fragmentation.
    If I can move the data to another partition, how will I do it?
    Thanks

    I think you didn't get intentions correctly.
    My intention is to move the required data to a partition and then drop the original partition. that because the amount of data required to keep for future use is less than 1%.
    I understood what you meant to convey. Thanks a lot.
    I laid out eh plan something like the following.
    1. Add a new date column to facilitate the partitioning (say its called PARTITION_DT. PARTITION_DT will have the same data as ROW_CREAT_DTTM without the timestamp portion of the date.)
    2. We will start with monthly partition using PARTITION_DT, Create a 'Default' partition as well.
    3. Add hash sub-partitions on MSG_ID to spread the application data load and avoid contention (so the application load is balanced just like how its balanced through the hash partitions today)
    4. At the end of the data retention period, identify the records that needs to be retained (because of some trade statuses, etc ) and update the PARTITION_DT with a distant past date so the row will automatically move to the Default partition. The identification of the records to be retained and updating the PARTITION_DT can be done through a batch job. since this step involve very few records, it can be done in minutes or seconds.
    5. Now, we can drop the oldest partition and rebuild the index if required.
    6 The process should add sufficient number of monthly and its sub-partitions ahead of time to make sure we always have partitions available for new data.
    The entire process can be automated and executed through a scheduled job.

  • Move rows within a table using buttons

    Hello Guys,
    I am trying to create a dynamic table and I have been trying to figure out how best to do it. Here are my requirements
    1) The table will have 12 rows, the number of rows will not change.
    2) The table will have 2 columns.
    3) The point of the table is for the user to reorder based on priority.
    4) The data must persist when saved (this one i know how to do).
    I have been creating a subform around a row and adding a up and down arrow buttons to each one. I was going to use a moveinstance command but I don't quite understand how the indexing will work.
    If you guys have a better suggestion or an example, i would really appreciate it.
    Thanks,
    roger.

    Hi,
    Repeatable objects have a zero-based numbering system. So Row1 with 12 instances, would look like Row1[0], Row1[1], ... Row1[11].
    So the following Javascript would move the row up:
    if (Row1.index != 0)
         var nIndexFrom = Row1.index;
         var nIndexTo = Row1.index - 1;     
         _Row1.moveInstance(nIndexFrom, nIndexTo);     
    else
         xfa.host.beep("3");
    A similar script would move the row downwards. Note I have used Row1.index, you could also use this.parent.index if the button is in the row. If it is buried in subforms, you may need this.parent.parent.index, to get to the instance of the repeating object.
    Hope that helps,
    Niall

  • Move row based on one duplicated value

    is it possbile to move entire rows base on just the value in the first column?
    1    a
    1    b
    2    c
    2   d
    the result should be
    1   a
    2   c

    Yes - double the header row, then use a formula like the one that I posted but start in row 1, with the formula
    =COUNTIF($A$1:$A1,$A1)
    Then copy down, copy that column, paste as values, and finally, sort the entire table
    based on that value. Then List1 will all have 1s in that column, List2 will have 2s, etc.

  • "Move row up" option in dreamweaver cc 14.00 missing

    ANY BODY KNOW HOW TO GET IT BACK...?

    Hi Raymi,
    Like Ben suggested, you can vote for the feature using the link provided.  From what I understand, the product team is collecting feedback on the limitations of Live View for FG layouts and improving experience on that front. It would help if you could provide a list of limitations with the current workflow.
    Thanks,
    Preran

  • Move row values to columns

    Hi all,
    i have a a table that looks like this:
    ID NAME ADDR
    01 SAM USA
    02 JIM USA
    03 BEN USA
    03 BEN ENG
    04 TIM ENG
    05 MEG USA
    05 MEG JAP
    05 MEG ENG
    i need it so that names BEN and MEG do not have separate records for every ADDR they have. every ADDR should be in a column within the same record. the maximum ADDR is 3.
    ID NAME ADDR1 ADDR2 ADDR3
    01 SAM USA
    02 JIM USA
    03 BEN USA ENG
    04 TIM ENG
    05 MEG USA JAP ENG
    can somebody help?
    Thanks!

    SQL> with t
      2  as
      3  (select '01' ID ,'SAM' NAME,'USA' ADDR from dual
      4  union all
      5  select'02','JIM','USA' from dual
      6  union all
      7  select'03','BEN','USA' from dual
      8  union all
      9  select'03','BEN','ENG' from dual
    10  union all
    11  select'04','TIM','ENG' from dual
    12  union all
    13  select'05','MEG','USA' from dual
    14  union all
    15  select'05','MEG','JAP' from dual
    16  union all
    17  select'05','MEG','ENG' from dual
    18  )
    19  select id,
    20         name,
    21         max(decode(rn,1,addr,null)) ADDR1,
    22         max(decode(rn,2,addr,null)) ADDR2,
    23         max(decode(rn,3,addr,null)) ADDR3
    24  from
    25      (select id,name,addr,row_number() over(partition by ID order by 1) rn
    26       from t)
    27  group by id,name
    28  order by 1
    29  /
    ID NAM ADD ADD ADD
    01 SAM USA
    02 JIM USA
    03 BEN USA ENG
    04 TIM ENG
    05 MEG USA JAP ENG
    SQL>

  • CS4 Mac Can I move a row in a table?

    I've made a table, but I now would like to move row 7 to occupy the position of row 2, thus pushing the others down so that the previous row two would now be row 3.  In Excel, I would select the row and then click and hold the selected row with the mouse and move it up or down as needed and it would relocate to the location where it is when I release the mouse button.  I can't seem to figure out how to do it in ID.  Any suggestions would be very welcome.  Thanks.

    I don't believe you can move rows. You can cut row 7, insert a row to the right of row 1 and paste row 7 over the blank, inserted row.

  • How do I move a row in a table.

    The instructions from teh Pages manual (below) doesn't work. i.e. I can't get the rows to "appear to lift off the table" to move them.
    Move rows and columns within a table
    Select one or more rows or columns, then do either of the following:Move rows: Click and hold the blue bar for the rows so they appear to lift off the table, then drag above or below another row.
    Thanks

    Apple has left a bit out of their instructions
    Hold down the command key and drag up from the left most or top most blue tab label eg "F" or "4".
    or
    click once on the blue tab and wait a bit then click again and then drag.
    Experiment when you hit a problem and try anything that vaguely might work. That's how I just discovered this.
    You will notice the selection appearance changes with each click.
    Peter

  • Archive rows from one table to another, in batches of N at a time

    I am trying to set up an archiving process to move rows out of a large table into an archive table. I am using Oracle 10gR2, and I do not have the partitioning option. The current process is a simple (apologies for the layout, I can't see a way of formatting code neatly for posting...)
    for r in (select ... from table where ...) loop
    insert into arch_table (...) values (r.a, r.b, ...);
    -- error handling
    delete from table where rowid = r.rowid;
    -- error handling
    commit_count := commit_count + 1;
    if commit_count >= N then
    commit;
    commit_count := 0;
    end if;
    end loop;
    I know this is not a good approach - we're looking at fixing it because it's getting the inevitable "snapshot too old" errors, apart from anything else - and I'd like to build something more robust.
    I do need to only take N rows at a time - firstly, because we don't have the space to create a big enough undo tablespace to do everything at once, and secondly, because there is no business reason to insist that the archiving is done in a single transaction - it's perfectly acceptable to do "some at a time" and having multiple commits makes the process restartable while at the same time making some progress on each run.
    My first thought was to use rownum in the where clause to just do a bulk insert then a bulk delete:
    insert into archive_table (...) select ... from table where ... and rownum < N;
    delete from table where ... and rownum < N;
    commit;
    (I'd need some error logging clauses in there to be able to report errors properly, but that's OK).
    However, I can't find anything that convinces me that this type of use of rownum is deterministic - that is, the delete will always delete the same rows that the insert inserted (I could imagine different plans for the insert and the delete, which meant that the rows were selected in a different order). I can't think of a way to prove that this couldn't happen.
    Alternatively, I could do a bulk collect to select the rows in batches, then do a bulk insert followed by a rowid-based delete. That way there's a single select, so there's no issue of mismatches, but this would potentially use a lot of client memory to hold the row set.
    Does anybody have any comments or suggestions on the best way to handle this? I'd prefer a solution along the lines of the first suggestion (use rownum in the where clause) if I could find something I could be sure was reliable. I just have a gut reaction that it "should" be possible to do something like this in a single statement. I've looked briefly at esoteric uses of the merge statement to do the insert/delete in a single statement, but couldn't find anything.
    It's a problem that seems to come up a lot in discussions, but I have never yet seen a decent discussion of the various tradeoffs. (Most solutions I've seen tend to either suggest "bite the bullet and do it in one transaction and give it enough undo" or "use features of the data (for example, a record ID column) to roughly partition the data into manageable sizes", neither of which would be particularly easy in this case).
    Thanks in advance for any help or suggestions.
    Paul

    Actually, you also have a problem in that you get a PLS-00436 error because you can't reference individual attributes of a record in a FORALL. (I think this restriction might have been eased on 11g, but as I'm on 10g I have to live with it :-().
    However, your code did give me an idea - I can just bulk-select ROWID and then do an insert ... select * where rowid = (the selected rowid). I need to consider how efficient this will be, in a bit more detail, and do some tests, but as I'm doing rowid-based selects it should be reasonably good. Here's some sample code:
    -- create table pfm_test as select * from dba_objects;
    -- insert into pfm_test select * from pfm_test;
    -- insert into pfm_test select * from pfm_test;
    -- insert into pfm_test select * from pfm_test;
    -- update pfm_test set created = sysdate - (rownum/24);
    -- commit;
    -- create table pfm_test_archive as select * from pfm_test where 1=0;
    create or replace procedure archive_data (days number, batch number) as
        cursor c is select rowid from pfm_test where created < sysdate-days;
        type t_rowid_arr is table of rowid;
        l_rowid_arr t_rowid_arr;
        i number := 0;
    begin
        loop
         open c;
         fetch c bulk collect into l_rowid_arr limit batch;
         i := i + 1;
         dbms_output.put_line('Batch ' || i || ': ' || l_rowid_arr.count || ' records');
         exit when l_rowid_arr.count = 0;
         forall i in l_rowid_arr.first .. l_rowid_arr.last
           insert into pfm_test_archive
           select * from pfm_test where rowid = l_rowid_arr(i);
         forall i in l_rowid_arr.first .. l_rowid_arr.last
           delete from pfm_test where rowid = l_rowid_arr(i);
         commit;
         close c;
        end loop;
    end;
    -- exec archive_data(17000,1000);Now to look at error handling for FORALL statements...
    Thanks for the help.
    Paul.

  • Can't undo last move

    I am trying to add an undo function to this program. Here is what I have so far. I can't get the undo function to work for some reason. Any help is appreciated.
    // Five.java - main program for Five-In-A-Row Program
    import javax.swing.JFrame;
    ////////////////////////////////////////////////////// class Five
    /** Five.java - Winner is able to put 5 pieces in a row.
       The Five program consists of three files:
       Five.java      - this file with main to create window.
       FiveGUI.java   - implements the GUI interface.
       FiveLogic.java - the logical functioning.
       @author Fred Swartz
       @version 2004-05-02
    class Five {
        //================================================ method main
        public static void main(String[] args) {
            JFrame window = new JFrame("Five In A Row");
            window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            window.setContentPane(new FiveGUI());
            window.pack();  // finalize layout
            window.setResizable(false);
            window.show();  // make window visible
        }//end main
    }//endclass Five
    //===========================================
    // FiveGUI.java
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    /////////////////////////////////////////////////// class FiveGUI
    /** A Graphical User Interface for a Five-In-A-Row game.
        This implements the user interface (view and controller),
        but the logic (model) is implemented in a separate class that
        knows nothing about the user interface.
        <p>This subclasses JPanel and puts the some buttons in the north,
        a graphical display of the board in the center, and
        a status field in the south.
        </p>
        <p>Exercise: This game probably originated on a Go board where
           the pieces are placed on the intersections, not in the
           empty spaces.  Change the program to put all pieces on the
           intersections.
        </p>
        <p>Exercise: The Undo button doesn't do anything.  Fix it here
           in the GUI and in the logic.
        </p>
        <p>Exercise: Create a machine player.</p>
        @author Fred Swartz
        @version 2004-05-02 Rodenbach
    class FiveGUI extends JPanel {
        //=============================================== instance variables
        private GraphicsPanel boardDisplay_;
        private JTextField    statusField_ = new JTextField();
        private FiveLogic     gameLogic_ = new FiveLogic(9, 9);
        private boolean       gameOver_ = false;
        private static final Color[]  PLAYER_COLOR = {null, Color.black, Color.white};
        private static final String[] PLAYER_NAME  = {null, "BLACK", "WHITE"};
        //====================================================== constructor
        public FiveGUI() {
            //--- Create some buttons
            JButton newGameButton = new JButton("New Game");
            JButton undoButton = new JButton("Undo");
            //--- Create control panel
            JPanel controlPanel = new JPanel();
            controlPanel.setLayout(new FlowLayout());
            controlPanel.add(newGameButton);
            controlPanel.add(undoButton);
            //--- Create graphics panel
            boardDisplay_ = new GraphicsPanel();
            //--- Set the layout and add the components
            this.setLayout(new BorderLayout());
            this.add(controlPanel , BorderLayout.NORTH);
            this.add(boardDisplay_, BorderLayout.CENTER);
            this.add(statusField_ , BorderLayout.SOUTH);
            //-- Add action listeners
            newGameButton.addActionListener(new NewGameAction());
                undoButton.addActionListener(new UndoAction());
        }//end constructor
        //////////////////////////////////////////////// class GraphicsPanel
        // This is defined inside the outer class so that
        // it can use the game logic variable.
        class GraphicsPanel extends JPanel implements MouseListener {
            private static final int ROWS = 9;
            private static final int COLS = 9;
            private static final int CELL_SIZE = 30; // Pixels
            private static final int WIDTH  = COLS * CELL_SIZE;
            private static final int HEIGHT = ROWS * CELL_SIZE;
            //================================================== constructor
            public GraphicsPanel() {
                this.setPreferredSize(new Dimension(WIDTH, HEIGHT));
                this.setBackground(Color.gray);
                this.addMouseListener(this);  // Listen own mouse events.
            }//end constructor
            //============================================== paintComponent
            public void paintComponent(Graphics g) {
                super.paintComponent(g);
                //-- Paint grid (could be done once and saved).
                for (int r=1; r<ROWS; r++) {  // Horizontal lines
                    g.drawLine(0, r*CELL_SIZE, WIDTH, r*CELL_SIZE);
                for (int c=1; c<COLS; c++) {
                    g.drawLine(c*CELL_SIZE, 0, c*CELL_SIZE, HEIGHT);
                //-- Draw players pieces.
                for (int r=0; r<ROWS; r++) {
                    for (int c=0; c<COLS; c++) {
                        int x = c * CELL_SIZE;
                        int y = r * CELL_SIZE;
                        int who = gameLogic_.getPlayerAt(r, c);
                        if (who != gameLogic_.EMPTY) {
                            g.setColor(PLAYER_COLOR[who]);
                            g.fillOval(x+2, y+2, CELL_SIZE-4, CELL_SIZE-4);
            }//end paintComponent
            //======================================== listener mousePressed
            public void mousePressed(MouseEvent e) {
                //--- map x,y coordinates into a row and col.
                int col = e.getX()/CELL_SIZE;
                int row = e.getY()/CELL_SIZE;
                int currentOccupant = gameLogic_.getPlayerAt(row, col);
                if (!gameOver_ && currentOccupant == gameLogic_.EMPTY) {
                    gameLogic_.move(row, col);
                    switch (gameLogic_.getGameStatus()) {
                        case 1: // Player one wins.  Game over.
                                gameOver_ = true;
                                statusField_.setText("BLACK WINS");
                                break;
                        case 2: // Player two wins.  Game over.
                                gameOver_ = true;
                                statusField_.setText("WHITE WINS");
                                break;
                        case FiveLogic.TIE:  // Tie game.  Game over.
                                gameOver_ = true;
                                statusField_.setText("TIE GAME");
                                break;
                        default: showNextPlayer();
                } else {  // Not legal
                    Toolkit.getDefaultToolkit().beep();
                this.repaint();  // Show any updates to game.
            }//end mousePressed
            //========================================== ignore these events
            public void mouseClicked (MouseEvent e) {}
            public void mouseReleased(MouseEvent e) {}
            public void mouseEntered (MouseEvent e) {}
            public void mouseExited  (MouseEvent e) {}
        }//end inner class GraphicsPanel
        //======================================= untility method showNextPlayer
        private void showNextPlayer() {
           statusField_.setText(PLAYER_NAME[gameLogic_.getNextPlayer()] + " to play");
        }//end showNextPlayer
        ///////////////////////////////////////// inner class NewGameAction
        private class NewGameAction implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                gameLogic_.reset();
                gameOver_ = false;
                showNextPlayer();
                boardDisplay_.repaint();
        }//end inner class NewGameAction
         ///////////////////////////////////////// inner class NewGameAction
        private class UndoAction implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                gameLogic_.undo();
                gameOver_ = false;
                showNextPlayer();
                boardDisplay_.repaint();
        }//end inner class NewGameAction
    }//end class FiveGUI
    //================================================
    // FiveLogic.java - Game to get 5 pieces in a row.
    ///////////////////////////////////////////////// class FiveLogic
    /** This class implements the logic (model) for the game of
        Five-In-A-Row.
        <br/>Exercise: The undo function doesn't do anything.  Fix it.
        @author Fred Swartz
        @version 2004-05-02
    class FiveLogic {
        /** Number of board rows. */
        private int maxRows_;
        /** Number of board columns. */
        private int maxCols_;
        /** The board. */
        private int[][] board_;
          /**The undo array. */
          private int[][] undoArray_;
        /** The player who moves next. */
        private int     nextPlayer_;
        /** Number of moves in the game. */
        private int     moves_ = 0;
        //-- Constants
        public  static final int EMPTY   = 0;  // The cell is empty.
        private static final int PLAYER1 = 1;
        public  static final int TIE     = -1; // Game is a tie (draw).
        //================================================== constructor
        public FiveLogic(int rows, int cols) {
            maxRows_ = rows;
            maxCols_ = cols;
            board_ = new int[maxRows_][maxCols_];
                undoArray_ = new int[maxRows_][maxCols_];
            reset();
        }//end constructor
        //================================================= getNextPlayer
        /** Returns the next player. */
        public int getNextPlayer() {
            return nextPlayer_;
        }//end getFace
        //=================================================== getPlayerAt
        /** Returns player who has played at particular row and column. */
        public int getPlayerAt(int r, int c) {
            return board_[r][c];
        }//end getPlayerAt
        //========================================================== reset
        /** Clears board to initial state. Makes first move in center. */
        public void reset() {
            for (int r=0; r<maxRows_; r++) {
                for (int c=0; c<maxCols_; c++) {
                    board_[r][c] = EMPTY;
            moves_ = 0;  // No moves so far.
            nextPlayer_ = PLAYER1; 
            //-- Make first move in center.
            move(maxCols_/2, maxRows_/2);  // First player moves to center
        }//end reset
        //=========================================================== move
        /** Play a marker on the board, record it, flip players. */
        public void move(int r, int c) {
            //assert board_[r][c] == EMPTY;
                undoArray_[r][c] = board_[r][c];
            board_[r][c] = nextPlayer_;  // Record this move.
            nextPlayer_ = 3-nextPlayer_; // Flip players
            moves_++;                    // Increment number of moves.
        }//end move
        //=========================================================== undo
        /** Undo the last move made.  Don't go beyond beginning. */
        public void undo() {
                    board_ = undoArray_;
                   moves_--;      
        }//end undo
        //========================================== utility method count5_
        /** The count5_ utility function returns true if there are five in
            a row starting at the specified r,c position and
            continuing in the dr direcection (+1, -1) and
            similarly for the column c.
        private boolean count5_(int r, int dr, int c, int dc) {
            int player = board_[r][c];  // remember the player.
            for (int i=1; i<5; i++) {
                if (board_[r+dr*i][c+dc*i] != player) return false;
            return true;  // There were 5 in a row!
        } // count5_
        //=================================================== getGameStatus
        /** -1 = game is tie, 0 = more to play,
             1 = player1 wins, 2 = player2 wins */
        public int getGameStatus() {
            int row;
            int col;
            int n_up, n_right, n_up_right, n_up_left;
            boolean at_least_one_move;   // true if game isn't a tie
            for (row = 0; row < maxRows_; row++) {
                for (col = 0; col < maxCols_; col++) {
                    int p = board_[row][col];
                    if (p != EMPTY) {
                        // look at 4 kinds of rows of 5
                        //  1. a column going up
                        //  2. a row going to the right
                        //  3. a diagonal up and to the right
                        //  4. a diagonal up and to the left
                        if (row < maxRows_-4) // Look up
                            if (count5_(row, 1, col, 0)) return p;
                        if (col < maxCols_-4) { // row to right
                            if (count5_(row, 0, col, 1))  return p;
                            if (row < maxRows_-4) { // diagonal up to right
                                if (count5_(row, 1, col, 1)) return p;
                        if (col > 3 && row < maxRows_-4) { // diagonal up left
                            if (count5_(row, 1, col, -1)) return p;
                    }//endif position wasn't empty
                }//endfor row
            }//endfor col
            // Neither player has won, it's tie if there are empty positions.
            // Game is finished if total moves equals number of positions.
            if (moves_ == maxRows_*maxCols_) {
                return TIE; // Game tied.  No more possible moves.
            } else {
                return 0;  // More to play.
        }//end getGameStatus
    }//end class FiveLogic

    Oh, oh, oh. I know why it clears the whole board. You are only saving the previous state of each square as a player moves to it. A player can only move to a square if it's empty. So you are only storing empty squares.
    Change the move method to do this:
    public void move(int r, int c) {
        //assert board_[r][c] == EMPTY;
        undoArray_ = (int[][]) board_.clone();
        board_[r][c] = nextPlayer_; // Record this move.
        nextPlayer_ = 3-nextPlayer_; // Flip players
        moves_++;  // Increment number of moves.
    }

  • ICal move events from one calendar to another with AppleScript

    I made an AppleScript to clean up my calendars and thought I would share. My iMac had a calendar called "Home" and my iPhone had a default calendar "Calendar" so I ended up with all of my events spread across two calendars. Decide to clean up and move everything to one calendar.
    This script is admittedly not very efficient. The nested repeat loops means it takes a while to run. Feel free to take this as a start point. I have it checking each property for missing value before adding it to avoid errors. I could have added a line to delete the old event after creating the copy, but I was just deleting the whole old calendar after the script ran.
    I hope this is helpful to someone. Oh, this was created under Snow Leopard so if you are in Lion you might need to tweak things. I don't know how much the scripting library has changed.
    tell application "iCal"
              set thisCalOld to calendar "OldCalendarName"
              set thisCalNew to calendar "NewCalendarToMoveEventsTo"
              set cntrMatch to 0
              set cntrCopied to 0
              repeat with thisEventOld in events of thisCalOld
                        repeat with thisEventNew in events of thisCalNew
                                  set isOKtoProceedWithCopy to true
                                  if (start date of thisEventNew = start date of thisEventOld) and (summary of thisEventNew = summary of thisEventOld) then
                  --Don't copy
                                            set cntrMatch to cntrMatch + 1
                                            set isOKtoProceedWithCopy to false
                                            exit repeat
                                  end if
                        end repeat
                        if isOKtoProceedWithCopy then
                                  set theStamp to stamp date of thisEventOld
                                  set theAllDay to allday event of thisEventOld
                                  set theURL to url of thisEventOld
                                  set theRecur to recurrence of thisEventOld
                                  set theEndDt to end date of thisEventOld
                                  set theClass to class of thisEventOld
                                  set theStartDt to start date of thisEventOld
                                  set theDesc to description of thisEventOld
                                  set theSummary to summary of thisEventOld
                                  set theLoc to location of thisEventOld
                                  set theExcludeDt to excluded dates of thisEventOld
                                  set theSeq to sequence of thisEventOld
                                  set theStatus to status of thisEventOld
                                  tell thisCalNew
                                            set thePropList to {}
                                            if theStamp is not equal to missing value then
                                                      set thePropList to thePropList & {stamp date:theStamp}
                                            end if
                                            if theAllDay is not equal to missing value then
                                                      set thePropList to thePropList & {allday event:theAllDay}
                                            end if
                                            if theURL is not equal to missing value then
                                                      set thePropList to thePropList & {url:theURL}
                                            end if
                                            if theRecur is not equal to missing value then
                                                      set thePropList to thePropList & {recurrence:theRecur}
                                            end if
                                            if theEndDt is not equal to missing value then
                                                      set thePropList to thePropList & {end date:theEndDt}
                                            end if
                                            if theClass is not equal to missing value then
                                                      set thePropList to thePropList & {class:theClass}
                                            end if
                                            if theStartDt is not equal to missing value then
                                                      set thePropList to thePropList & {start date:theStartDt}
                                            end if
                                            if theDesc is not equal to missing value then
                                                      set thePropList to thePropList & {description:theDesc}
                                            end if
                                            if theSummary is not equal to missing value then
                                                      set thePropList to thePropList & {summary:theSummary}
                                            end if
                                            if theLoc is not equal to missing value then
                                                      set thePropList to thePropList & {location:theLoc}
                                            end if
                                            if theExcludeDt is not equal to missing value then
                                                      set thePropList to thePropList & {excluded dates:theExcludeDt}
                                            end if
                                            if theSeq is not equal to missing value then
                                                      set thePropList to thePropList & {sequence:theSeq}
                                            end if
                                            if theStatus is not equal to missing value then
                                                      set thePropList to thePropList & {status:theStatus}
                                            end if
                                            set theNewCopy to make new event at end with properties thePropList
                                  end tell
                                  set cntrCopied to cntrCopied + 1
                        end if
              end repeat
    end tell
    display dialog ("Exists(not copied):" & cntrMatch & "  New Copied:" & cntrCopied)

    That should not be necessary because I get the value of ID out of another table, where I generate ID with a sequence..
    So normally it should just tranfer that row from one table to another. But it doesn't !
    Knowing that I cannot create a row in the table wouter_published_posts(I can just move rows from the add_post table to the wouter_published_posts table), It should be inpossible that twice the ID appears. But yet he keeps trowing errors...
    help me, please

  • Can the row ID number be locked when moving task around in the schedule?

    I have a schedule in which I want to move row ID 9 to row ID 5; but do NOT want the row ID of 9 to change to 5.  I want to keep original row ID's upon moving them around in my schedule.  Is this possible? If yes, how? 
    Thank you

    Are you trying to do this with a BizTalk app?  2000/2002?

Maybe you are looking for

  • [gpg2] Pass passphrase to the agent via stdin

    Hello there, Is there a way to pass the gpg passphrase to the agent without making use of the pinentry program? E.g. by the means of stdin? Background - what I want to achieve: I'd like to use the neat script passmenu to copy passwords from my passwo

  • Published website and the scroll bar is missing in Firefox

    I have published a website through iWeb and mobile.me. Everything looks pretty good in Safari, Internet Explorer, and Firefox. The problem I am having and cannot resolve is that the side scroll bar that allows you to scroll to the bottom of the page

  • No Unit displayed as Axis lable in WAD 7

    Hi, There are a few dropdown lists and one chart in my web template. Key figures are display using Y axis in the chart. one of KF has KG as unit and another one has CD3. The issue is that the unit is not shown as the label of the Y axis for KF. tried

  • Formula Variable to find Standard Price on Different Plant

    Hello Experts, I'm attempting to write a query against our Inventory cube.  I need to show: Inventory        Value of     Standard     Value of       Stock  Qty               Stock @      Price @      Stock @     Value @ Plant X      Plant X        P

  • Can't do ANYTHING...HELP ASAP!!

    My son just got this eMac from a program through his school. I can't do much on there to even set it up for him because I need the Administrator login name and password! Does anyone know any way I can override this or get around it so I can set up in