Greatly reduced action performance in CS5

The bug issue text below wouldn't fit in the bug report form even though it's less than 2000 characters (another bug, perhaps?)
******BUG******
Concise problem statement:  reduced performance in Action processing in CS5 compared to CS3
Steps to reproduce bug:
1. Create an image file, 8000 by 9880 pixels 16-bit RGB color.
2. The background can be any image, though I was using a scan of a test target with colored patches for scanner calibration.
3.  Create a layer "final target" on top of the background.  Set contents to transparent.
4.  Create a selection 295 pixels on a side with rectangular marquee tool.  Position this selection in the upper left corner.
5.  Save the selection to an alpha channel "Grid Box."
6.  Run an action with the following steps.
a.  Load the selection "Grid Box."
b.  Select the layer "final target"
c.  Expand the selection 2 pixels.
d.  Fill the selection with the foreground color.
e.  Set the foreground color to white.
f.  Select the background layer.
g.  Move the selection 295 pixels to the right.
h.  Save the new selection as "Grid Box", replacing the channel.
The use of this action:
Use the eyedropper tool to select a color from the center of the selected square, then use the magic wand tool to subtract from the selection using the color in the center of the square in contiguous mode with tolerance set to 8.  Then run the action, and repeat the above process in the next selected square.  In the scan I am preparing, there is a grid of colored squares surrounded by a large black border.  The final result needs the black border eliminated so that the colored squares completely butt up against each other spaced 295 pixels apart.
So by running the action, the color in the center of each box is copied to fill the rest of the square selected area that's black, leaving the center portion intact.   The copied colors go on the "final target" layer so the background layer is not disturbed.
If you need a copy of the action and/or the image file, contact me by email.
Results:  In CS5 the action is unusable due to the long run time.
Expected results:  In CS3 it works perfectly.

My theory initially was that you had given Photoshop just enough RAM to work efficiently with your CS3 setup, but perhaps because of differences in your Photoshop RAM setting or perhaps because Photoshop CS5 has more code in memory, it's starving for RAM under the same test, and goes to its scratch file for relief.
I created a test image and tried your action with a stopwatch.
Photoshop CS5 x64 on Windows 7 x64 (i.e., with plenty of RAM) takes 1.8 seconds to run through your action.
Photoshop CS5 32 bit consistently takes 6.8 seconds to go through the same steps.   Notably it stalls on the Expand and Select layer "Background" steps for a few seconds each, where it blazed right through them in the 64 bit version.
In my case I have given Photoshop CS5 2897 MB to work with (89%).  This number is larger on a 64 bit system than what you can set because Photoshop 32 bit can use up to a 3 GB address space.
I'll do tests next with earlier versions of Photoshop.
-Noel

Similar Messages

  • Greatly reduced reception

    Problem:
    I'm experiencing greatly reduced reception/range with my PowerBook wireless connections. More than 15 feet away from my base station can cause dropped or intermittent connections or complete loss of signal. Any line of sight interference - a wall, a window, a chair, my leg - will cause signal problems.
    Notes:
    *This computer, base station and Airport card used to have fantastic range and reception on this and all other wireless networks.
    *I now have awful range on all wireless networks.
    *All other computers have great reception on my network.
    *The problem seemed to come on gradually, rather than all at once.
    I've tried:
    *Checking/re-seating the Airport card and connections to the computer.
    *Checking antenna connection to the card.
    *Inspected antenna wire and checked continuity.
    *Swapping in other Airport cards known to work well.
    *Zapped PRAM over the course of the problem.
    None of the above helps.
    Any ideas? What else in the computer affects reception besides the Airport card and the antenna?
    This is a PowerBook G4 Titanium, running 10.4.10.
    Thank you

    It is very possible that you may have some form of Wi-Fi interference in the immediate area that is preventing you from getting a good clean signal.
    I suggest you perform a simple site survey, using utilities like KisMAC, MacStumbler, iStumbler, or IPNetMonitorX to determine potential areas of interference...and then, try to either eliminate or significantly reduce them.

  • Action performed methods

    Hi,
    I was wondering if there was any way to make an action performed method not be void. My action performed methods create booleans which I need the values of to be returned so they can trigger if() statements in another part of the application. Any suggestions would be greatly appreciated

    No. ActionPerformed is an interface that has a set definition. It is unusual for code to explitily call an actionPerformed listener. Usually the listener is added to a component and the component's code makes the call. If you are making explicit calls, you could create your own interface that returns whatever type you want.

  • How does the mac mini perform with cs5

    Just curious
    How does the Intel HD Graphics 4000 in the new mac mini perform with cs5 photoshop  cs6 photoshop?
    thanks
    Ted

    Jeff, I appreciate your comment, so you haven't had any problem with using the painttools in CS 6 photoshop and the 3d type etc, in other words all the features that CS6 photoshop has.
    I was thinking about buying the mac mini but was concerned how it works with CS 5 (which I have) I will have to take another look at the MiniMac server with the 3000 card. I do a lot of Digital Painting primarily Painter 12.2 but and would like to use the Painter brushes in CS 5 ( have not upgraded to CS 6.) My Imac is 6 years old and really is not fast enough.
    Thanks for replying
    Ted

  • Unit Of Order reducing the performance after some threshold limit

    Hi,
    Our application is doing netting of trades.
    We are using UOO for posing messages to JMS queues appended to it.
    From this message, we are extracting the trade info and persisting into DB.
    When MDB is listening to that JMS queue, application is performing well when the no. of messages in the queue is <5000.
    when this number increases lets say 20000, our application is performing very badly.
    We are using 64 instances of MDB connecting to queue.
    What are the parameters reduce the performance of the MDB consuming the messages?
    Can you please help me on this?
    Thanks,
    Ravikumar

    An increasing backlog is a sign that your MDBs are not keeping up with your senders.
    See:
    Tuning WebLogic JMS
    http://docs.oracle.com/cd/E17904_01/web.1111/e13814/jmstuning.htm#PERFM294
    and
    Tuning Message-Driven Beans
    http://docs.oracle.com/cd/E17904_01/web.1111/e13814/mdbtuning.htm#PERFM271

  • MDX formulae reduces application performance

    Hi,
    I have few MDX formulae in my account dimension which is built as per our reporting requirements. But unfortunately having these formulae in greately affecting the performance. It takes 7- 8 minutes to generate a report if I have formulae.
    Can anyone tell me is there anyway I can increase the performance of the application without removing MDX formulae?
    Thanks
    Sharath

    Ok. Let me explain like this:
    Net Income is the highest level made up of below children and grand children.
    Memeber--Hlevel--Parent--
    Description  -
    EAT--H5--
    (Earnings After Tax)
    Tax -
    H4----
    EAT
    EBT--H4EAT--
    (Earnings Before Tax)
    Depreciation--H3--
    EBT
    Interest--H3--
    EBT
    EBIDT--H3EBT--
    (Earnings before Interest, Depreciation and Tax)
    GP--H2EBIDT--
    (Gross Profit)
    REVENUE--H1--
    GP
    COST--H1--
    GP
    In the above structure if EBIDT is a calculated member then I should add formula to both EBT and EAT as per MDX rule even though I can have this done through roll-ups. Other wise EBT and EAT will just return the value of EBIDT and ignores Interest, Depreciation and tax.
    Without formula it takes 25-30 sec. and with formula it takes 500-600 sec. to get the numbers from the report.
    Edited by: Raghavendra Sharath on Mar 20, 2009 6:03 PM

  • Workflwow query to know the status of the PO, Action, performed by

    can any one help me to get the workflow query to know the status of the PO, Action, performed by. or the table which can show the Action, Performed by.
    please help me with action history table
    Edited by: user11309801 on Jun 20, 2010 1:13 AM

    Not sure what workflow has to do with PO action history, but pl see if MOS Doc 394787.1 (How to Tell What had been Changed and Who had Made the Changes to a Purchase Order?) can help.
    HTH
    Srini

  • 'action performed' on array of buttons.

    Hi everyone!
    I am trying to set up an array of buttons on a panel in the main frame of my application. I can get them on to the panel, displaying them correctly but i can;t seem to attach an action performed method to them. Ive attached the following code - if you have any ideas on how to solve this problem i would be very grateful. DO you think it is because they are on this panel and not directly on the main Frame.?
    If i try to attach say Button1_action performed then it clashes with my original button 1!
    Thanks in advance.....
    static int N=10;
    String lett[]={"a","b","c","d","e","f","g","h","i","j"};
    Button button[]=new Button[N];
    for(int k=0;k<N;++k)
    {button[k]=new Button();
    button[k].setLabel(lett[k]);
    button[k].setBackground(Color.darkGray);
    button[k].addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    button[k]_actionPerformed(e);
    this.panel1.add(button[k]);

A: 'action performed' on array of buttons.

viravan is right - your code should work except that button[k]_actionPerformed won't compile. Also, you don't need a separate ActionListener for each button - use a common one and test for the source.
e.g.
import java.awt.*;
import java.awt.event.*;
...code to define Frame, Panel etc...
static int N=10;
String lett[]={"a","b","c","d","e","f","g","h","i","j"};
Button button[]=new Button[N];
ActionListener common = (new ActionListener() {
     public void actionPerformed(ActionEvent e) {
            Button source = (Button)e.getSource();
             System.out.println("Label of button pressed = " + source.getLabel() );
for(int k=0;k<N;++k) {
    button[k]=new Button();
    button[k].setLabel(lett[k]);
    button[k].setBackground(Color.darkGray);
    button[k].addActionListener(common);
    panel1.add(button[k]);
}Another alternative is to addActionListener(this) and code the actionPerformed method as part of the Frame class.

viravan is right - your code should work except that button[k]_actionPerformed won't compile. Also, you don't need a separate ActionListener for each button - use a common one and test for the source.
e.g.
import java.awt.*;
import java.awt.event.*;
...code to define Frame, Panel etc...
static int N=10;
String lett[]={"a","b","c","d","e","f","g","h","i","j"};
Button button[]=new Button[N];
ActionListener common = (new ActionListener() {
     public void actionPerformed(ActionEvent e) {
            Button source = (Button)e.getSource();
             System.out.println("Label of button pressed = " + source.getLabel() );
for(int k=0;k<N;++k) {
    button[k]=new Button();
    button[k].setLabel(lett[k]);
    button[k].setBackground(Color.darkGray);
    button[k].addActionListener(common);
    panel1.add(button[k]);
}Another alternative is to addActionListener(this) and code the actionPerformed method as part of the Frame class.

  • Help needed with Button action performed

    Hi,
    I am new to AWT prgramming .
    I have created a menu called " Menu System Test window " and it contains toplevel menu items of "File" and "Help" and File Menu contains subitems "Product Evaluation" and "Exit".
    When i click File->Product Evaluation it displays a new Frame named "ProductEvaluationMeasurementTool" with some check boxes ,radiobuttons, buttons and text fields. So when i select some checkboxes in that new frame and click the button labeled "Metricslevel" it displays some resultin textField1 , similarly when i click Button labeled "Measurementlevel" it displays some result in textField2.
    My question is i have another button in Frame Called "Reset". When i click the Reset button all the check boxes which have been checked previously should be unchecked and moreover the result in both the textfield should be cleared.
    I am sending my code. Kindly help me.
    Thanks in advance.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.Component;
    import java.awt.Checkbox;
    import javax.swing.*;
    // Make a main window with two top-level menus: File and Help.
    // Help has a submenu and demonstrates a few interesting menu items.
    public class MainWindow extends Frame {
      public MainWindow() {
        super("Menu System Test Window");
        setSize(500, 500);
        // make a top level File menu
        FileMenu fileMenu = new FileMenu(this);
        // make a top level Help menu
        HelpMenu helpMenu = new HelpMenu(this);
        // make a menu bar for this frame 
        // and add top level menus File and Menu
        MenuBar mb = new MenuBar();
        mb.add(fileMenu);
        mb.add(helpMenu);
        setMenuBar(mb);
        addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            exit();
      public void exit() {
        setVisible(false); // hide the Frame
        dispose(); // tell windowing system to free resources
        System.exit(0); // exit
      public static void main(String args[]) {
        MainWindow w = new MainWindow();
        w.setVisible(true);
    // Encapsulate the look and behavior of the File menu
    class FileMenu extends Menu implements ActionListener {
      MainWindow mw;  // who owns us?
      public FileMenu(MainWindow m) {
        super("File");
        mw = m;
        MenuItem mi;
        add(mi = new MenuItem("ProductEvaluation"));
        mi.addActionListener(this);
        add(mi = new MenuItem("Exit"));
        mi.addActionListener(this);
      // respond to the Exit menu choice
      public void actionPerformed(ActionEvent e) { String item = e.getActionCommand();
        if (item.equals("ProductEvaluation"))
         Frame f = new Frame("ProductMeasurementEvaluationTool");
         f.setSize(1290,1290);
         f.setLayout(null);
         TextField t1 = new TextField("textField1");
         t1.setBounds(230, 630, 50, 24);
         f.add(t1);
         TextField t2 = new TextField("textField2");
         t2.setBounds(430, 630, 50, 24);
         f.add(t2);
         ActionListener al = new MyActionListener(f, t1);
         ActionListener a2 = new MyActionListener(f, t2);
         Label l1 = new Label("Select the appropriate metrics for Measurement Process Evaluation");
         l1.setBounds(380, 50, 380, 20);
         f.add(l1);
         Label l2 = new Label("Architecture Metrics");
         l2.setBounds(170, 100, 110, 20);
         f.add(l2);
         Label l3 = new Label("RunTime Metrics");
         l3.setBounds(500, 100, 110, 20);
         f.add(l3);
         Label l4 = new Label("Documentation Metrics");
         l4.setBounds(840, 100, 130, 20);
         f.add(l4);
         JRadioButton rb1 = new JRadioButton("Componenent Metrics",false);
         rb1.setBounds(190, 140, 133, 20);
         f.add(rb1);
         JRadioButton rb2 = new JRadioButton("Task Metrics",false);
         rb2.setBounds(540, 140, 95, 20);
         f.add(rb2);
         JRadioButton rb3 = new JRadioButton("Manual Metrics",false);
         rb3.setBounds(870, 140, 108, 20);
         f.add(rb3);
         JRadioButton rb4 = new JRadioButton("Configuration Metrics",false);
         rb4.setBounds(190, 270, 142, 20);
         f.add(rb4);
         JRadioButton rb5 = new JRadioButton("DataBase Metrics",false);
         rb5.setBounds(190, 420, 122, 20);
         f.add(rb5);
         JRadioButton rb6 = new JRadioButton("DataHandling Metrics",false);
         rb6.setBounds(540, 270, 142, 20);
         f.add(rb6);
         JRadioButton rb7= new JRadioButton("HumanInterface Metrics",false);
         rb7.setBounds(540, 420, 156, 20);
         f.add(rb7);
         JRadioButton rb8 = new JRadioButton("Development Metrics",false);
         rb8.setBounds(870, 270, 141, 20);
         f.add(rb8);
         JRadioButton rb9= new JRadioButton("Marketing Metrics",false);
         rb9.setBounds(870, 420, 121, 20);
         f.add(rb9);
         Checkbox  c10 = new Checkbox("Size");
         c10.setBounds(220, 170, 49, 20);
         f.add(c10);
         Checkbox c11 = new Checkbox("Structure");
         c11.setBounds(220, 190, 75, 20);
         f.add(c11);
         Checkbox c12 = new Checkbox("Complexity");
         c12.setBounds(220, 210, 86, 20);
         f.add(c12);
         Checkbox c13 = new Checkbox("Size");
         c13.setBounds(220, 300, 49, 20);
         f.add(c13);
         Checkbox c14 = new Checkbox("Structure");
         c14.setBounds(220, 320, 75, 20);
         f.add(c14);
         Checkbox c15 = new Checkbox("Complexity");
         c15.setBounds(220, 340, 86, 20);
         f.add(c15);
         Checkbox c16 = new Checkbox("Size");
         c16.setBounds(220, 460, 49, 20);
         f.add(c16);
         Checkbox c17 = new Checkbox("Structure");
         c17.setBounds(220, 480, 75, 20);
         f.add(c17);
         Checkbox c18 = new Checkbox("Complexity");
         c18.setBounds(220, 500, 86, 20);
         f.add(c18);
         Checkbox c19 = new Checkbox("Size");
         c19.setBounds(580, 170, 49, 20);
         f.add(c19);
         Checkbox c20 = new Checkbox("Structure");
         c20.setBounds(580, 190, 75, 20);
         f.add(c20);
         Checkbox c21 = new Checkbox("Complexity");
         c21.setBounds(580, 210, 86, 20);
         f.add(c21);
         Checkbox c22 = new Checkbox("Size");
         c22.setBounds(580, 300, 49, 20);
         f.add(c22);
         Checkbox c23 = new Checkbox("Structure");
         c23.setBounds(580, 320, 75, 20);
         f.add(c23);
         Checkbox c24 = new Checkbox("Complexity");
         c24.setBounds(580, 340, 86, 20);
         f.add(c24);
         Checkbox c25 = new Checkbox("Size");
         c25.setBounds(590, 460, 49, 20);
         f.add(c25);
         Checkbox c26 = new Checkbox("Structure");
         c26.setBounds(590, 480, 75, 20);
         f.add(c26);
         Checkbox c27 = new Checkbox("Complexity");
         c27.setBounds(590, 500, 86, 20);
         f.add(c27);
         Checkbox c28 = new Checkbox("Size");
         c28.setBounds(920, 170, 49, 20);
         f.add(c28);
         Checkbox c29 = new Checkbox("Structure");
         c29.setBounds(920, 190, 75, 20);
         f.add(c29);
         Checkbox c30 = new Checkbox("Complexity");
         c30.setBounds(920, 210, 86, 20);
         f.add(c30);
         Checkbox c31 = new Checkbox("Size");
         c31.setBounds(920, 300, 49, 20);
         f.add(c31);
         Checkbox c32 = new Checkbox("Structure");
         c32.setBounds(920, 320, 75, 20);
         f.add(c32);
         Checkbox c33 = new Checkbox("Complexity");
         c33.setBounds(920, 340, 86, 20);
         f.add(c33);
         Checkbox c34 = new Checkbox("Size");
         c34.setBounds(930, 450, 49, 20);
         f.add(c34);
         Checkbox c35 = new Checkbox("Structure");
         c35.setBounds(930, 470, 75, 20);
         f.add(c35);
         Checkbox c36 = new Checkbox("Complexity");
         c36.setBounds(930, 490, 86, 20);
         f.add(c36);
         Button b1  = new Button("MetricsLevel");
         b1.setBounds(230, 600, 120, 24);
         f.add(b1);
         b1.addActionListener(al);
         Button b2  = new Button("MeasurementLevel");
         b2.setBounds(430, 600, 120, 24);
         f.add(b2);
         b2.addActionListener(a2);
         Button b3  = new Button("Reset");
         b3.setBounds(630, 600, 120, 24);
         f.add(b3);
         f.show();
        else
       { mw.exit();}
    class MyActionListener implements ActionListener
        Frame f;
        TextField textField1;
        TextField textField2;
        public MyActionListener(Frame f, TextField tf)
            this.f = f;
            textField1 = tf;
            textField2 = tf;
        public void actionPerformed(ActionEvent e)
           String s = e.getActionCommand();
        if (s.equals("MetricsLevel"))
            Component[] components = f.getComponents();
      int numOfCheckBoxes = 81;
      int numChecked = 0;
      for ( int i = 0; i < components.length; i++ )
       if ( components[i] instanceof Checkbox )
        Checkbox checkBox = (Checkbox) components;
    if ( checkBox.getState() )
    numChecked++;
    double ratio = (double) numChecked / (double) numOfCheckBoxes;
    textField1.setText( Double.toString( ratio ) );
    else
    if (s.equals("MeasurementLevel"))
    Component[] components = f.getComponents();
    int numOfCheckBoxes = 81;
    int numChecked = 0;
    for ( int i = 0; i < components.length; i++ )
    if ( components[i] instanceof Checkbox )
    Checkbox checkBox = (Checkbox) components[i];
    if ( checkBox.getState() )
    numChecked++;
    double ratio = (double) numChecked / (double) numOfCheckBoxes;
    textField2.setText( Double.toString( ratio ) );
    else
    if (s.equals("Reset"))
    Code for Reset Button action performed.
    // Encapsulate the look and behavior of the Help menu
    class HelpMenu extends Menu implements ActionListener {
    MainWindow mw; // who owns us?
    public HelpMenu(MainWindow m) {
    super("Help");
    mw = m;
    MenuItem mi;
    add(mi = new MenuItem("Description"));
    mi.addActionListener(this);
    // respond to a few menu items
    public void actionPerformed(ActionEvent e) {
    String item = e.getActionCommand();
    if (item.equals("Description"))
    System.out.println("You can get description at our website");

    import java.awt.*;
    import java.awt.event.*;
    // Make a main window with two top-level menus: File and Help.
    // Help has a submenu and demonstrates a few interesting menu items.
    public class MainWindow extends Frame
      public static void main(String args[])
        new MainWindow();
      public MainWindow()
        super("Menu System Test Window");
        setSize(500, 500);
        // Why not make 1 menubar class that you can add with
        // this.setMenuBar(new MyMenuBar(this)); ?
        // make a top level File menu
        FileMenu fileMenu = new FileMenu(this);
        // make a top level Help menu
        HelpMenu helpMenu = new HelpMenu(this);
        // make a menu bar for this frame
        // and add top level menus File and Menu
        MenuBar mb = new MenuBar();
        mb.add(fileMenu);
        mb.add(helpMenu);
        this.setMenuBar(mb);
        this.setVisible(true);
        this.addWindowListener(new WindowAdapter()
          public void windowClosing(WindowEvent e)
            System.exit(0);
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.JRadioButton;
    //Encapsulate the look and behavior of the File menu
    public class FileMenu extends Menu implements ActionListener
      private MainWindow mw; // who owns us?
      private MenuItem itmPE   = new MenuItem("ProductEvaluation");
      private MenuItem itmExit = new MenuItem("Exit");
      public FileMenu(MainWindow main)
        super("File");
        this.mw = main;
        this.itmPE.addActionListener(this);
        this.itmExit.addActionListener(this);
        this.add(this.itmPE);
        this.add(this.itmExit);
      // respond to the Exit menu choice
      public void actionPerformed(ActionEvent e)
        if (e.getSource() == this.itmPE)
          Frame f = new Frame("ProductMeasurementEvaluationTool");
          f.setSize(1290, 1290);
          f.setLayout(null);
          TextField t1 = new TextField("textField1");
          t1.setBounds(230, 630, 50, 24);
          f.add(t1);
          TextField t2 = new TextField("textField2");
          t2.setBounds(430, 630, 50, 24);
          f.add(t2);
          // Way to ugly..
          // ActionListener al = new MyActionListener(f, t1);
          // ActionListener a2 = new MyActionListener(f, t2);
          // see below...
          Label l1 = new Label("Select the appropriate metrics for Measurement Process Evaluation");
          l1.setBounds(380, 50, 380, 20);
          f.add(l1);
          Label l2 = new Label("Architecture Metrics");
          l2.setBounds(170, 100, 110, 20);
          f.add(l2);
          Label l3 = new Label("RunTime Metrics");
          l3.setBounds(500, 100, 110, 20);
          f.add(l3);
          Label l4 = new Label("Documentation Metrics");
          l4.setBounds(840, 100, 130, 20);
          f.add(l4);
          JRadioButton rb1 = new JRadioButton("Componenent Metrics", false);
          rb1.setBounds(190, 140, 133, 20);
          f.add(rb1);
          // Please do not use AWT and Swing components in the same frame.
          JRadioButton rb2 = new JRadioButton("Task Metrics", false);
          rb2.setBounds(540, 140, 95, 20);
          f.add(rb2);
          JRadioButton rb3 = new JRadioButton("Manual Metrics", false);
          rb3.setBounds(870, 140, 108, 20);
          f.add(rb3);
          JRadioButton rb4 = new JRadioButton("Configuration Metrics", false);
          rb4.setBounds(190, 270, 142, 20);
          f.add(rb4);
          JRadioButton rb5 = new JRadioButton("DataBase Metrics", false);
          rb5.setBounds(190, 420, 122, 20);
          f.add(rb5);
          JRadioButton rb6 = new JRadioButton("DataHandling Metrics", false);
          rb6.setBounds(540, 270, 142, 20);
          f.add(rb6);
          JRadioButton rb7 = new JRadioButton("HumanInterface Metrics", false);
          rb7.setBounds(540, 420, 156, 20);
          f.add(rb7);
          JRadioButton rb8 = new JRadioButton("Development Metrics", false);
          rb8.setBounds(870, 270, 141, 20);
          f.add(rb8);
          JRadioButton rb9 = new JRadioButton("Marketing Metrics", false);
          rb9.setBounds(870, 420, 121, 20);
          f.add(rb9);
          Checkbox c10 = new Checkbox("Size");
          c10.setBounds(220, 170, 49, 20);
          f.add(c10);
          Checkbox c11 = new Checkbox("Structure");
          c11.setBounds(220, 190, 75, 20);
          f.add(c11);
          Checkbox c12 = new Checkbox("Complexity");
          c12.setBounds(220, 210, 86, 20);
          f.add(c12);
          Checkbox c13 = new Checkbox("Size");
          c13.setBounds(220, 300, 49, 20);
          f.add(c13);
          Checkbox c14 = new Checkbox("Structure");
          c14.setBounds(220, 320, 75, 20);
          f.add(c14);
          Checkbox c15 = new Checkbox("Complexity");
          c15.setBounds(220, 340, 86, 20);
          f.add(c15);
          Checkbox c16 = new Checkbox("Size");
          c16.setBounds(220, 460, 49, 20);
          f.add(c16);
          Checkbox c17 = new Checkbox("Structure");
          c17.setBounds(220, 480, 75, 20);
          f.add(c17);
          Checkbox c18 = new Checkbox("Complexity");
          c18.setBounds(220, 500, 86, 20);
          f.add(c18);
          Checkbox c19 = new Checkbox("Size");
          c19.setBounds(580, 170, 49, 20);
          f.add(c19);
          Checkbox c20 = new Checkbox("Structure");
          c20.setBounds(580, 190, 75, 20);
          f.add(c20);
          Checkbox c21 = new Checkbox("Complexity");
          c21.setBounds(580, 210, 86, 20);
          f.add(c21);
          Checkbox c22 = new Checkbox("Size");
          c22.setBounds(580, 300, 49, 20);
          f.add(c22);
          Checkbox c23 = new Checkbox("Structure");
          c23.setBounds(580, 320, 75, 20);
          f.add(c23);
          Checkbox c24 = new Checkbox("Complexity");
          c24.setBounds(580, 340, 86, 20);
          f.add(c24);
          Checkbox c25 = new Checkbox("Size");
          c25.setBounds(590, 460, 49, 20);
          f.add(c25);
          Checkbox c26 = new Checkbox("Structure");
          c26.setBounds(590, 480, 75, 20);
          f.add(c26);
          Checkbox c27 = new Checkbox("Complexity");
          c27.setBounds(590, 500, 86, 20);
          f.add(c27);
          Checkbox c28 = new Checkbox("Size");
          c28.setBounds(920, 170, 49, 20);
          f.add(c28);
          Checkbox c29 = new Checkbox("Structure");
          c29.setBounds(920, 190, 75, 20);
          f.add(c29);
          Checkbox c30 = new Checkbox("Complexity");
          c30.setBounds(920, 210, 86, 20);
          f.add(c30);
          Checkbox c31 = new Checkbox("Size");
          c31.setBounds(920, 300, 49, 20);
          f.add(c31);
          Checkbox c32 = new Checkbox("Structure");
          c32.setBounds(920, 320, 75, 20);
          f.add(c32);
          Checkbox c33 = new Checkbox("Complexity");
          c33.setBounds(920, 340, 86, 20);
          f.add(c33);
          Checkbox c34 = new Checkbox("Size");
          c34.setBounds(930, 450, 49, 20);
          f.add(c34);
          Checkbox c35 = new Checkbox("Structure");
          c35.setBounds(930, 470, 75, 20);
          f.add(c35);
          Checkbox c36 = new Checkbox("Complexity");
          c36.setBounds(930, 490, 86, 20);
          f.add(c36);
          ActionListener action = new MyActionListener(f, t1, t2);
          Button b1 = new Button("MetricsLevel");
          b1.setBounds(230, 600, 120, 24);
          b1.addActionListener(action);
          f.add(b1);
          Button b2 = new Button("MeasurementLevel");
          b2.setBounds(430, 600, 120, 24);
          b2.addActionListener(action);
          f.add(b2);
          Button b3 = new Button("Reset");
          b3.setBounds(630, 600, 120, 24);
          b3.addActionListener(action);
          f.add(b3);
          f.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e)
              System.exit(0);
          f.show();
        else if (e.getSource() == this.itmExit)
          System.exit(0);
    import java.awt.*;
    import java.awt.event.*;
    //Encapsulate the look and behavior of the Help menu
    public class HelpMenu extends Menu implements ActionListener
      private MainWindow main; // who owns us?
      private MenuItem itmDescription = new MenuItem("Description");
      public HelpMenu(MainWindow main)
        super("Help");
        this.main = main;   
        this.itmDescription.addActionListener(this);
        this.add(this.itmDescription);
      // respond to a few menu items
      public void actionPerformed(ActionEvent e)
        if (e.getSource() == this.itmDescription)
          System.out.println("You can get description at our website");
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.JRadioButton;
    public class MyActionListener implements ActionListener
      private Frame     frame;
      private TextField textField1;
      private TextField textField2;
      public MyActionListener(Frame frame, TextField tf1, TextField tf2)
        this.frame = frame;
        this.textField1 = tf1;
        this.textField2 = tf2;
      public void actionPerformed(ActionEvent e)
        String s = e.getActionCommand();
        if (s.equals("MetricsLevel"))
          Component[] components = this.frame.getComponents();
          int numOfCheckBoxes = 81;
          int numChecked = 0;
          for (int i = 0; i < components.length; i++)
            if (components[i] instanceof Checkbox)
              if (((Checkbox)components).getState())
    numChecked++;
    double ratio = (double) numChecked / (double) numOfCheckBoxes;
    this.textField1.setText(Double.toString(ratio));
    else if (s.equals("MeasurementLevel"))
    Component[] components = frame.getComponents();
    int numOfCheckBoxes = 81;
    int numChecked = 0;
    for (int i = 0; i < components.length; i++)
    if (components[i] instanceof Checkbox)
    if (((Checkbox)components[i]).getState())
    numChecked++;
    double ratio = (double) numChecked / (double) numOfCheckBoxes;
    this.textField2.setText(Double.toString(ratio));
    else if (s.equals("Reset"))
    this.textField1.setText("");
    this.textField2.setText("");
    for (int i = 0; i < this.frame.getComponentCount(); i++)
    Component c = this.frame.getComponent(i);
    if (c instanceof JRadioButton)
    ((JRadioButton)c).setSelected(false);
    else if (c instanceof Checkbox)
    ((Checkbox)c).setState(false);

  • Does sub program reduces the performance

    hi all,
    suppose that i have two solutions to increase the salaries of the employees for a table
    method 1:
    create or replace function inc_sal (pempno emp.empno%type) return integer
    is
    vsal emp.sal%type;
    begin
    select sal into vsal from emp where empno=pempno;
    vsal:=vsal+vsal*0.30;
    return(vsal);
    end;
    sql> select sal, inc_sal(empno) from emp;
    and
    method 2:
    sql> select sal, sal*0.30 as inc_sal from emp;
    now in the first method, for each record of the table the function is called and collect the returned value...
    but for the second method there is nothing like that
    so now which method is faster in performance, does the number of function calls in first method reduce the performance......?
    thanks and regards,
    sri ram.

    Oracle has a separate SQL and PL/SQL engine. When you go from one to the other, this is called a 'context switch'.
    A context switch is a costly operation.
    In variant 1 you seem to embed the function you wrote in SQL.
    This means
    - for each record you will have a context switch
    - in the function you call SQL: another context switch
    - The SQL in your function will show as recursive SQL and will never get merged into the main query.
    So actually variant 1 is a textbook example of 'slow by slow programming' or 'How to write unscalable applications'
    Remember Tom Kytes mantra:
    When you can do it in SQL, you should do it in SQL
    When you can't do it in SQL, you should do it in PL/SQL
    When you can't do it in PL/SQL, you should do it in Java (in the database)
    When you can't do it in Java, you should do it in any language outside the database.
    Sybrand Bakker
    Senior Oracle DBA

  • Mplayer cache option greatly reduces performance

    Hi. I needed a larger cache because I have some videos stored on another samba server and it's laggy.
    I set options: cache=20000, cache-min=10 , and that helped to play those videos smoothly, but that caused all 1280x720 mp4 files stored on my local drive to lag and A/V desync with mplayer message:
    **** Your system is too SLOW to play this!  ****
    I tried cache values from 1000 to 80000, and they lag in any case. But without the option "cache" these videos play well.
    Now I commented "cache" in config.
    [default]
    #cache=65536
    #cache-min=10
    ao=alsa
    softvol=yes
    subcp=enca:ru:cp1251
    af=pan=2:1:0:0:1:1:0:0:1:0.5:0.5:1:1
    ass=yes

    you can use different config for your local usage.

  • ActionListener/Action Performed

    Ok so, ive got my GUI to display using multiple layouts thanx to all of your help!!!! Thanx so much....Now to make the GUI do stuff. My question is, in all of my other classes, i have already written fucntions that will be tied to buttons (ie, add user[writes to db], delete user, etc), but my question lies with how do i properly implement actionListener and ActionPerformed.
    Ive been looking at this tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/events/actionlistener.html
    public class Beeper ...  implements ActionListener {
        //where initialization occurs:
            button.addActionListener(this);
        public void actionPerformed(ActionEvent e) {
         Toolkit.getDefaultToolkit().beep();
    }my question is, since i have four buttons, am i supposed to have a seperate actionPerformed() version for each button? Or Can i write one huge actionPerformed() that tells java what to do with all of my buttons (in tieing the buttons to my functions)...? Any help is greatly appreciated.
    ~Hana

    Not sure what you mean. The source is the component that fired the ActionEvent that has been sent to the listener. If a button gets clicked, the button is the source.
    If, on a button click, you want to know what is in a text area, use myTextArea.getText().
    For example, the text area contains a name, but the action you want to perform is based on wether you click the "DeleteName" or "AddName" button. Get source tells you which button is clicked. Then, you get the text and call the appropriate function. That is why you have an if/else construct in the actionPerformed() method.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Whydo i keep getting asked to display the page ff must send info that will repeat action performed ealier this is only happening using lexolous how can i stop it thank u

    message reads
    to display this page firefox must send information that will repeat any action (such as a search or order confirmation)that was performed earlier
    resend cancel
    how do i stop keep getting this pop up

    I assume that you mean a Greasemonkey script for KoC ?
    Try [/questions/780792]

  • How to Undo Multiple Actions in ActionScript [CS5]

    I am wwriting an InDesign extension for CS5 using ActionScript. I want to be able to undo a group of actions as a sungle transaction. In JS, I would use doScript() for this purpose.
    How do I do it in ActionScript?
    TIA,
    mlavie

    Harbs,
    I read all the material on the subject (thanks for the reference), however I seem not to be able to pass parameters to the JavaScript (even primitive types), which is essential for what I want to do.
    In fact, the example from the JS Scripting Guide doesn't work:
    var myParameters:String = ["Hello from DoScript", "Your message here."];
    var myJavaScript:String = "alert(\"First argument: \" + arguments[0] + \"\\rSecond argument:\" + arguments[1]);";
    InDesign.app.doScript(myJavaScript, ScriptLanguage.javascript, myParameters);
    Any ideas?
    mlavie

  • Will Materialized view log reduces the performance of DML statements on the master table

    Hi all,
    I need to refresh a on demand fast refresh Materialized view in Oracle 11GR2. For this purpose I created a Materialized view log on the table (Non partitioned) in which records will be inserted @ rate of 5000/day as follows.
    CREATE MATERIALIZED VIEW LOG ON NOTES NOLOGGING WITH PRIMARY KEY INCLUDING NEW VALUES;
    This table already has 20L records and adding this Mview log will reduce the DML performance on the table ?
    Please guide me on this.

    Having the base table maintain a materialised view log will have an impact on the speed of DML statements - they are doing extra work, which will take extra time. A more sensible question would be to ask whether it will have a significant impact, to which the answer is almost certainly "no".
    5000 records inserted a day is nothing. Adding a view log to the heap really shouldn't cause any trouble at all - but ultimately only your own testing can establish that.

  • Maybe you are looking for