Behavior of too_many_rows

Hi, this is just for info:
I had the following PL/SQL problem. Select some data, but select it only if there is exactly one record. Okay I thought, let's do it like this:
begin
select my_value
into my_var
from my_table;
exception
when no_data_found then
null;
when too_many_rows then
null;
end;
I tried it on several database versions, and I wondered about the behavior of "too_many_rows" on my 8.1.7.4.0. If there is more than one record, my_var is filled with the first value returned! The same statement on a 9i database lets my_var still be NULL. So the exact method is
begin
select my_value
into my_var
from my_table;
exception
when no_data_found then
my_var := null;
when too_many_rows then
my_var := null;
end;
That caused some bugs in my program units. I wonder if this is a bug or the behaviour was changed with intention.
Regards,
Torsten

I Tried in oracle 8i 8.1.5.0.0 and the result was the same as in your version 8, this isn´t raise the exception and the var take the first value. But in earlier version like oracle 7.2, the behaivoir is different and raise the exception.

Similar Messages

  • Session/too_many_rows error

    Hello,
    this is a strange problem that I've been working on for ages now - hopefully you can help!
    The problem is when I save my session I get a TOO_MANY_ROWS error. It sounds crazy but I've been putting exception blocks around every select...into statement in my procedure and I've found the line where the error originates.
    Below is the code - I load the session, store a variable, save the session and then retrieve a value. On my page markers 1, 1.5 and 2 are printed.
    --Create session:
    begin
    htp.p('Marker 1');
    l_session := portal30.wwsto_api_session.load_session(p_domain => 'iPortal', p_sub_domain => 'GRAPHICS_DATA') ;
    htp.p('Marker 1.5');
    l_session.set_attribute('back_url'||p_portlet_record.reference_path,back_url);
    htp.p('Marker 2');
    --error is here!
    l_session.save_session;
    htp.p('Marker 3');
    v_status := l_session.get_attribute_as_varchar2('p_status'||p_portlet_record.reference_path) ;
    exception
    when too_many_rows then
    htp.p('<SCRIPT language=JavaScript>alert("Too many rows error! \n(Error Code:'||SQLCODE||')"); </SCRIPT>');
    end;
    Any ideas?
    Thanks very much!
    Hazel

    Dianna,
    The behavior you observed could be as a result of some of the security bug fixes that our group have back ported to 10.1.0.3 patchset release. ST releases security bundle patches periodically and some of them were back ported to earlier releases.
    There are no specific documentation regarding security bundle patch contents for security reasons.
    Regards,
    Xiafang

  • Populating OUT parameters when TOO_MANY_ROWS exception is thrown

    When I was trying to write code to test out today's PL/SQL challenge quiz, the behavior appears to depend on the table being queried. I can't figure out what attribute of the table drives the behavior (or if there is a different explanation for the behavior).
    The quiz is testing what happens when a procedure does a SELECT INTO an OUT parameter and a TOO_MANY_ROWS exception is thrown. The intent is to show that even though the behavior is technically undefined, what actually happens is that the OUT parameter is populated with the first row that is selected (obviously, you would never write code that depends on this behavior-- this is solely an academic exercise). The demonstration code works as expected
    CREATE TABLE plch_emp ( emp_name VARCHAR2(100) );
    INSERT INTO plch_emp VALUES ('Jones');
    INSERT INTO plch_emp VALUES ('Smith');
    COMMIT;
    CREATE OR REPLACE PROCEDURE plch_get
      (out_name OUT plch_emp.emp_name%TYPE) IS
    BEGIN
      SELECT emp_name
      INTO out_name
      FROM plch_emp
      ORDER BY emp_name;
    EXCEPTION
      WHEN OTHERS THEN
        dbms_output.put_line('A:' || out_name);
    END;
    What will be displayed after executing the following block:
    DECLARE
      l_name plch_emp.emp_name%TYPE;
    BEGIN
      plch_get(l_name);
      dbms_output.put_line('B:' || l_name);
    END;
    /and outputs
    A:Jones
    B:JonesWhen I replicate the logic while hitting the EMP table, the PLCH_EMP table, and the newly created EMP2 table, however, I get different behavior for the EMP and EMP2 tables. The procedure that queries PLCH_EMP works as expected but the OUT parameter is NULL when either EMP or EMP2 are created. Any idea what causes the behavior to differ?
    select *
      from v$version;
    create table emp2
    as
    select *
      from emp;
    create or replace procedure p1( p_out out varchar2 )
    is
    begin
      select emp_name
        into p_out
        from plch_emp
       order by emp_name;
    exception
      when others then
        dbms_output.put_line( 'P1 A:' || p_out );
    end;
    create or replace procedure p2( p_out out varchar2 )
    is
    begin
      select ename
        into p_out
        from emp
       order by ename;
    exception
      when others then
        dbms_output.put_line( 'P2 A:' || p_out );
    end;
    create or replace procedure p3( p_out out varchar2 )
    is
    begin
      select ename
        into p_out
        from emp2
       order by ename;
    exception
      when others then
        dbms_output.put_line( 'P3 A:' || p_out );
    end;
    declare
      l_ename varchar2(100);
    begin
      p1( l_ename );
      dbms_output.put_line( 'P1 B:' || l_ename );
      p2( l_ename );
      dbms_output.put_line( 'P2 B:' || l_ename );
      p3( l_ename );
      dbms_output.put_line( 'P3 B:' || l_ename );
    end;
    SQL> select *
      2    from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL>
    SQL> create table emp2
      2  as
      3  select *
      4    from emp;
    Table created.
    SQL>
    SQL> create or replace procedure p1( p_out out varchar2 )
      2  is
      3  begin
      4    select emp_name
      5      into p_out
      6      from plch_emp
      7     order by emp_name;
      8  exception
      9    when others then
    10      dbms_output.put_line( 'P1 A:' || p_out );
    11  end;
    12  /
    Procedure created.
    SQL>
    SQL> create or replace procedure p2( p_out out varchar2 )
      2  is
      3  begin
      4    select ename
      5      into p_out
      6      from emp
      7     order by ename;
      8  exception
      9    when others then
    10      dbms_output.put_line( 'P2 A:' || p_out );
    11  end;
    12  /
    Procedure created.
    SQL>
    SQL> create or replace procedure p3( p_out out varchar2 )
      2  is
      3  begin
      4    select ename
      5      into p_out
      6      from emp2
      7     order by ename;
      8  exception
      9    when others then
    10      dbms_output.put_line( 'P3 A:' || p_out );
    11  end;
    12  /
    Procedure created.
    SQL>
    SQL> declare
      2    l_ename varchar2(100);
      3  begin
      4    p1( l_ename );
      5    dbms_output.put_line( 'P1 B:' || l_ename );
      6
      7    p2( l_ename );
      8    dbms_output.put_line( 'P2 B:' || l_ename );
      9
    10    p3( l_ename );
    11    dbms_output.put_line( 'P3 B:' || l_ename );
    12
    13  end;
    14  /
    P1 A:Jones
    P1 B:Jones
    P2 A:
    P2 B:
    P3 A:
    P3 B:
    PL/SQL procedure successfully completed.Justin

    Billy  Verreynne  wrote:
    So we can then reasonably assume that the test or environment itself somehow interferes with the results? After all, the very same cursor is executed and the same PL/SQL engine uses that cursor interface.Clearly, there is something in my environment that is wonky. It just bugs me that I can't figure out what that variable is.
    Your test was done as a single anonymous PL/SQL block. Which means each proc that was called referenced the same variable/memory - are there perhaps PL/SQL optimisation enabled for the database or session? Or any other settings that could influence the test? Have you tried calling the procedures directly from SQL*Plus using a bind var and not via an anon block and a local var in that block?I have. And the results were the same
    SQL> var ename varchar2(100);
    SQL> exec p1( :ename );
    P1 A:Jones
    PL/SQL procedure successfully completed.
    SQL> exec p2( :ename );
    P2 A:
    PL/SQL procedure successfully completed.
    SQL> exec p3( :ename );
    P3 A:
    PL/SQL procedure successfully completed.
    As a sanity test - what happens when proc P3 for example is changed to a catersian join/union of emp2 and plch_emp? Do the test results change? Or you can change it as follows:
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure p5( p_out out varchar2 )
      2  is
      3  begin
      4    --// force a value into p_out using a successful fetch
      5    select emp_name
      6      into p_out
      7      from plch_emp
      8     where rownum = 1;
      9    --// force an error and determine if p_out was overwritten
    10    select ename
    11      into p_out
    12      from emp2
    13     order by ename;
    14  exception
    15    when others then
    16      dbms_output.put_line( 'P5:' || p_out );
    17* end;
    18  /
    Procedure created.
    SQL> exec p5( :ename );
    P5:Jones
    PL/SQL procedure successfully completed.
    Of course, you can also put this one down to using an operating system like Windows as a poor database server and not as a magnificent client gaming platform... Well, sure. But you can probably only play World of Warcraft so long before you need to write some PL/SQL.
    Justin

  • MDB Timeouts and transaction behavior

    Hi, thanks in advance for any help with this.
    We have a MDB where we have set the timeout to five minutes. In a particular case this timeout is being reached but even though the MDB times out the transaction and sends the message for redelivery the original transaction that was processing the message continues until something happens from an application standpoint to cause that original transaction to complete. This means that we have the same message processed twice under these circumstances.
    I would have expected that if a transaction timed out that the transaction would have been terminated and therefore our processing would have stopped. Is there a way to force this behavior or do we have to put an alarm in our code and kill ourselves such that we never encounter the transaction time out?
    Thanks,
    Sue Shanabrook

    I should have mentioned that we are using container managed transactions.

  • Unexpected Behavior error while creating a connection in IDT

    Hi Everyone,
    I have created a connection on top of a database using ODBC.
    I could able to see the connection in IDT.
    I have mentioned the user name and pw correctly  and tried testing the connection and got the error "unexpected behavior"
    PFA error.
    what could be the reason? any idea?
    Thanks.

    I find this 32-bit vs. 64-bit ODBC somewhat confusing.  I know you aren't dealing with Crystal Reports, but this blog post does provide some clarity.  It has a link to this Microsoft knowledge base article from which I quote...
    A 64-bit version of the Microsoft Windows operating system includes the following versions of the
    Microsoft Open Database Connectivity (ODBC) Data Source Administrator tool (Odbcad32.exe):
    The 32-bit version of the Odbcad32.exe file is located in the %systemdrive%\Windows\SysWoW64 folder.
    The 64-bit version of the Odbcad32.exe file is located in the %systemdrive%\Windows\System32 folder.
    One other warning.  In my experience I have found that you cannot run both the 32-bit and 64-bit ODBC admin tools at the same time.  If you have one running and try and start the other one it will just bring up the one you already had running.
    To make sure I know which instance I am in at any give time I have created a dummy data source that corresponds to the instance; 32-bit or 64-bit.
    Let us know how it goes.
    Noel

  • Capturing DVCAM in FCP 6.0.2 and encountering strange capture behavior

    I have FCP 6.0.2 and OSX 10.5.2 and QT 7.3.1. I have been capturing several DVCAM cassettes using my Sony DSR-20 deck. Although I have done this countless times before in earlier versions of FCP, I am encountering some strange repetitive behavior. I am capturing 30 minute clips one at a time. When I use batch capture it will cue the tape up properly to the in point...and then start capturing until it gets to about 10-12 minutes in, and then capture unexpectedly stops, no dialogue box, the tape rewinds and starts capturing again from the original in point. On this second capture, the tape sails past the 10 minute mark and keeps going to the end of the 30 minute clip. It then stops, gives me the dialogue box that it has successfully captured. And it has.
    But every DVCAM tape I captured today exhibited the same behavior. Capture would be successful until about about 10 minutes in, then FCP aborts (no dropped frame message, no dialogue box) rewinds the tape back to the in point, tries again, and this time succeeds with the second pass capturing the entire clip. Note at the 10 minute mark there is no scene change or no camera start/stop.
    Have other users experienced this issue? And if so, is there a workaround or a possible patch forthcoming from FCP?
    Many thanks,
    John

    Yes, each tape has an in and out point defined. In my 6 years of editing with Final Cut and DVCAM tapes I've never encountered this issue before in the capturing process until now. I will have to see in future weeks with other captures whether this is an on-going issue or not, but at least I can capture for now.

  • Is there any way to add dynamic parameter in sql without breaking Server Behavior

    Hello, i'm building multiple language site.. i would like to know if there is possible way to add dynamic parameter in my query, without break the server behavior.
    For example:
    mysql_select_db($database_dxc_conn, $dxc_conn);
    $query_Recordset1 = "SELECT article.articleName, article.articleDesc FROM article";
    $Recordset1 = mysql_query($query_Recordset1, $dxc_conn) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    will become something like this:
    $additionalSQL=", article.articleName_en";
    mysql_select_db($database_dxc_conn, $dxc_conn);
    $query_Recordset1 = "SELECT article.articleName, article.articleDesc $additionalSQL FROM article";
    $Recordset1 = mysql_query($query_Recordset1, $dxc_conn) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    this is just an example, my real scenarion is far more complicated than this... however this kind of approach break the server behavior and force to do hand-coding...
    i would like to know if there's better way to do such thing like this...

    viktor.iwan wrote:
    Hello, i'm building multiple language site.. i would like to know if there is possible way to add dynamic parameter in my query, without break the server behavior.
    Server behaviors are simply bits of boilerplate code automatically generated by Dreamweaver. Editing the code doesn't "break" it (unless your edits are badly written). However, once you edit the code, Dreamweaver no longer recognizes it, so you lose the ability to drag recordset results from the Bindings panel.
    If you want to edit server behavior code, the best way to handle it is to lay out your page as you want, using the Bindings panel. Once everything has been done, only then edit the server behavior code.

  • Odd behavior when using custom Composite/CompositeContext and antialiasing

    Hi,
    I created a custom Composite/CompositeContext class and when I use it with antialiasing it causes a black bar to appear. I seems it has nothing to do with the compose() code but just that fact that I set my own Composite object. The submitted code will show you what I mean. There are 3 check boxes 1) allows to use the custom Composite object, 2) allows to ignore the compose() code in the CompositeContext and 3) toggles the antialiasing flag in the rendering hints. When the antialiasing flag is set and the Composite object is used the bar appears regardless of if the compose() method is executed or not. If the Composite object is not used the bar goes away.
    The Composite/CompositeContext class performs clipping and gradient paint using a Ellipse2D.Float instance.
    a) When the Composite is not used the code does a rectangular fill.
    b) When the Composite is used it should clip the rectangular fill to only the inside of a circle and do a gradient merge of background color and current color.
    c) If the compose() method is ignored then only the background is painted.
    d) When antialiasing is turned on the black bar appears, i) if you ignore the compose() method it remains, ii) if you do not use the Composite object the bar disappears (???)
    NOTE: the compose method's code is only for illustration purposes, I know that AlphaComposite, clipping and/or Gradient paint can be used to do what the example does. What I am trying to find out is why the fact of simply using my Composite object with antialiasing will cause the odd behavior.  Been trying to figure it out but haven't, any help is appreciated.
    Thx.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import javax.swing.*;
    public class TestCustomComposite2
    extends JFrame
    implements ActionListener {
        private JCheckBox useCompositeChk, useAntialiasingChk, useCompositeContextChk;
        private Shape clippingShape = new Ellipse2D.Float(100, 100, 100, 100);
        private MergeComposite composite = new MergeComposite();
        public TestCustomComposite2() {
            super("Test Custom Composite");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel cp = (JPanel) getContentPane();
            cp.setLayout(new BorderLayout());
            cp.add(new TestCanvas(), BorderLayout.CENTER);
            JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
            panel.add(useCompositeChk = new JCheckBox("Use Composite", true));
            useCompositeChk.addActionListener(this);
            panel.add(useCompositeContextChk = new JCheckBox("Use Composite Context", true));
            useCompositeContextChk.addActionListener(this);
            panel.add(useAntialiasingChk = new JCheckBox("Use Antialiasing"));
            useAntialiasingChk.addActionListener(this);
            cp.add(panel, BorderLayout.SOUTH);
            pack();
            setVisible(true);
        public void actionPerformed(ActionEvent evt) {
            useCompositeContextChk.setEnabled(useCompositeChk.isSelected());
            invalidate();
            repaint();
        private class TestCanvas
        extends JComponent {
            public TestCanvas() {
                setSize(300, 300);
                setPreferredSize(getSize());
            public void paint(Graphics gfx) {
                Dimension size = getSize();
                Graphics2D gfx2D = (Graphics2D) gfx;
                gfx2D.setColor(Color.GRAY);
                gfx2D.fillRect(0, 0, size.width, size.height);
                RenderingHints rh = null;
                if(useAntialiasingChk.isSelected()) {
                    rh = gfx2D.getRenderingHints();
                    gfx2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                Rectangle r = clippingShape.getBounds();
                //gfx2D.setColor(Color.GREEN);
                //gfx2D.drawRect(r.x, r.y, r.width, r.height);
                gfx2D.setColor(Color.YELLOW);
                gfx2D.fill(clippingShape);
                Composite oldComposite = null;
                if(useCompositeChk.isSelected()) {
                    oldComposite = gfx2D.getComposite();
                    gfx2D.setComposite(composite);
                gfx2D.setColor(Color.ORANGE);
                gfx2D.fillRect(r.x, r.y, r.width + 1, r.height + 1);
                if(oldComposite != null)
                    gfx2D.setComposite(oldComposite);
                if(rh != null)
                    gfx2D.setRenderingHints(rh);
        public class MergeComposite
        implements Composite, CompositeContext {
            public CompositeContext createContext(ColorModel srcColorModel,
                                                  ColorModel dstColorModel,
                                                  RenderingHints hints) {
                return this;
            public void compose(Raster src,
                                Raster dstIn,
                                WritableRaster dstOut) {
                if(!useCompositeContextChk.isSelected())
                    return;
                int[] srcPixel = null;
                int[] dstPixel = null;
                for(int sy = src.getMinY(); sy < src.getMinY() + src.getHeight(); sy++) {
                    for(int sx = src.getMinX(); sx < src.getMinX() + src.getWidth(); sx++) {
                        int cx = sx - dstOut.getSampleModelTranslateX();
                        int cy = sy - dstOut.getSampleModelTranslateY();
                        if(!clippingShape.contains(cx, cy)) continue;
                        srcPixel = src.getPixel(sx, sy, srcPixel);
                        int ox = dstOut.getMinX() + sx - src.getMinX();
                        int oy = dstOut.getMinY() + sy - src.getMinY();
                        if(ox < dstOut.getMinX() || ox >= dstOut.getMinX() + dstOut.getWidth()) continue;
                        if(oy < dstOut.getMinY() || oy >= dstOut.getMinY() + dstOut.getHeight()) continue;
                        dstPixel = dstIn.getPixel(ox, oy, dstPixel);
                        float mergeFactor = 1.0f * (cy - 100) / 100;
                        dstPixel[0] = merge(mergeFactor, srcPixel[0], dstPixel[0]);
                        dstPixel[1] = merge(mergeFactor, srcPixel[1], dstPixel[1]);
                        dstPixel[2] = merge(mergeFactor, srcPixel[2], dstPixel[2]);
                        dstOut.setPixel(ox, oy, dstPixel);
            protected int merge(float mergeFactor, int src, int dst) {
                return (int) (mergeFactor * src + (1.0f - mergeFactor) * dst);
            public void dispose() {
        public static void main(String[] args) {
            new TestCustomComposite2();
    }

    I got a better version to work as expected. Though there will probably be issues with the transformation to display coordinates as mentioned before. At least figured out some of the kinks of using a custom Composite/CompositeContext object.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import javax.swing.*;
    public class TestCustomComposite2
    extends JFrame
    implements ActionListener {
        private JCheckBox useCompositeChk, useAntialiasingChk, useCompositeContextChk;
        private Shape clippingShape = new Ellipse2D.Float(100, 100, 100, 100);
        private MergeComposite composite = new MergeComposite();
        public TestCustomComposite2() {
            super("Test Custom Composite");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel cp = (JPanel) getContentPane();
            cp.setLayout(new BorderLayout());
            cp.add(new TestCanvas(), BorderLayout.CENTER);
            JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
            panel.add(useCompositeChk = new JCheckBox("Use Composite", true));
            useCompositeChk.addActionListener(this);
            panel.add(useCompositeContextChk = new JCheckBox("Use Composite Context", true));
            useCompositeContextChk.addActionListener(this);
            panel.add(useAntialiasingChk = new JCheckBox("Use Antialiasing"));
            useAntialiasingChk.addActionListener(this);
            cp.add(panel, BorderLayout.SOUTH);
            pack();
            setVisible(true);
        public void actionPerformed(ActionEvent evt) {
            useCompositeContextChk.setEnabled(useCompositeChk.isSelected());
            invalidate();
            repaint();
        private class TestCanvas
        extends JComponent {
            public TestCanvas() {
                setSize(300, 300);
                setPreferredSize(getSize());
            public void paint(Graphics gfx) {
                Dimension size = getSize();
                Graphics2D gfx2D = (Graphics2D) gfx;
                gfx2D.setColor(Color.GRAY);
                gfx2D.fillRect(0, 0, size.width, size.height);
                RenderingHints rh = null;
                if(useAntialiasingChk.isSelected()) {
                    rh = gfx2D.getRenderingHints();
                    gfx2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                Rectangle r = clippingShape.getBounds();
                //gfx2D.setColor(Color.GREEN);
                //gfx2D.drawRect(r.x, r.y, r.width, r.height);
                gfx2D.setColor(Color.YELLOW);
                gfx2D.fill(clippingShape);
                Composite oldComposite = null;
                if(useCompositeChk.isSelected()) {
                    oldComposite = gfx2D.getComposite();
                    gfx2D.setComposite(composite);
                gfx2D.setColor(Color.ORANGE);
                gfx2D.fillRect(r.x, r.y, r.width + 1, r.height + 1);
                if(oldComposite != null)
                    gfx2D.setComposite(oldComposite);
                if(rh != null)
                    gfx2D.setRenderingHints(rh);
        public class MergeComposite
        implements Composite, CompositeContext {
            public CompositeContext createContext(ColorModel srcColorModel,
                                                  ColorModel dstColorModel,
                                                  RenderingHints hints) {
                return this;
            public void compose(Raster src,
                                Raster dstIn,
                                WritableRaster dstOut) {
    //            dumpRaster("SRC   ", src);
    //            dumpRaster("DSTIN ", dstIn);
    //            dumpRaster("DSTOUT", dstOut);
    //            System.out.println();
                if(dstIn != dstOut)
                    dstOut.setDataElements(0, 0, dstIn);
                if(!useCompositeContextChk.isSelected())
                    return;
                int[] srcPixel = null;
                int[] dstPixel = null;
                int w = Math.min(src.getWidth(), dstIn.getWidth());
                int h = Math.min(src.getHeight(), dstIn.getHeight());
                int xMax = src.getMinX() + w;
                int yMax = src.getMinY() + h;
                for(int x = src.getMinX(); x < xMax; x++) {
                    for(int y = src.getMinY(); y < yMax; y++) {
                        try {
                            // THIS MIGHT NOT WORK ALL THE TIME
                            int cx = x - dstIn.getSampleModelTranslateX();
                            int cy = y - dstIn.getSampleModelTranslateY();
                            if(!clippingShape.contains(cx, cy)) {
                                dstPixel = dstIn.getPixel(x, y, dstPixel);
                                dstOut.setPixel(x, y, dstPixel);
                            else {
                                srcPixel = src.getPixel(x, y, srcPixel);
                                dstPixel = dstIn.getPixel(x, y, dstPixel);
                                float mergeFactor = 1.0f * (cy - 100) / 100;
                                dstPixel[0] = merge(mergeFactor, srcPixel[0], dstPixel[0]);
                                dstPixel[1] = merge(mergeFactor, srcPixel[1], dstPixel[1]);
                                dstPixel[2] = merge(mergeFactor, srcPixel[2], dstPixel[2]);
                                dstOut.setPixel(x, y, dstPixel);
                        catch(Throwable t) {
                            System.out.println(t.getMessage() + " x=" + x + " y=" + y);
            protected int merge(float mergeFactor, int src, int dst) {
                return (int) (mergeFactor * src + (1.0f - mergeFactor) * dst);
            protected void dumpRaster(String lbl,
                                      Raster raster) {
                System.out.print(lbl + ":");
                System.out.print(" mx=" + format(raster.getMinX()));
                System.out.print(" my=" + format(raster.getMinY()));
                System.out.print(" rw=" + format(raster.getWidth()));
                System.out.print(" rh=" + format(raster.getHeight()));
                System.out.print(" tx=" + format(raster.getSampleModelTranslateX()));
                System.out.print(" ty=" + format(raster.getSampleModelTranslateY()));
                System.out.print(" sm=" + raster.getSampleModel().getClass().getName());
                System.out.println();
            protected String format(int value) {
                String txt = Integer.toString(value);
                while(txt.length() < 4)
                    txt = " " + txt;
                return txt;
            public void dispose() {
        public static void main(String[] args) {
            new TestCustomComposite2();
    }

  • Is Mail.app one of the "erratic" behavior apps with a reset system clock?

    I am hoping someone can help with a fine detail of mail.app (v2.1.3) behavior.
    I had an incident where an iMac sent out 200+ smtp hits a minute and was tossed of the network for presumed zombie spaming.
    I think I have actually tracked the problem to an unfortunate conjunction of circumstances that is actually innocent (if still annoying)
    Let me set up the story:
    1. This is a common use computer, so Mail is not configured (except that it is --I'll get to that in a moment) and
    2. Safari will invoke Mail when you click on an "email link"
    Mostly everyone just quits mail if they goof and click an email link.
    BUT some time ago at least one person invoked Mail and composed a message. This message, naturally, remained in the outbox ever since. That person learned that they can't send email that way, so ever since they just cmd-Q Mail.
    BUT Before this person learned, they walked through the mail-config and told mail to try hitting smtp.mac.com:"nonExistantUser".
    So that covers the lead-up. Two days ago, mail was invoked via a Safari link, BUT it wasn't quit, it was sent to the background.
    Where it undoubtedly tried to send the outbox repeatedly until it was kicked off the network.
    Here is what I don't understand:
    Under this scenario of a mis-configured .mac address, will mail repeatedly try and fail to smtp at the maximum possible rate?
    OR
    Is the one other factor I am about to describe responsible?
    The one other factor:
    The clock battery is dead and there was a power failure at 4am that day.
    The system clock reset to 1969.
    Of course, nobody reset it.
    Is mail.app one of the apps that the finder message warns "may behave erratically"?
    (a GROSS simplification) does it have a bit of code like:
    1 check time-of-last-send-mail-attempt
    check newest-item-in-outbox
    if newest-item more recent then last-send-attempt
    do send-mail and record time-of-last-send-mail-attempt
    and go to 1
    else wait X minutes and go to 1
    which, if the clock was mis-set to 1969 would always record a last-send-attempt prior to anything in the outbox and trigger a send loop.
    Does anyone know if either Mail is tenacious about sending to a bad .mac address, or gets ridiculous under this circumstance for bad-clock-set?
    Marc

    I am hoping someone can help with a fine detail of mail.app (v2.1.3) behavior.
    I had an incident where an iMac sent out 200+ smtp hits a minute and was tossed of the network for presumed zombie spaming.
    I think I have actually tracked the problem to an unfortunate conjunction of circumstances that is actually innocent (if still annoying)
    Let me set up the story:
    1. This is a common use computer, so Mail is not configured (except that it is --I'll get to that in a moment) and
    2. Safari will invoke Mail when you click on an "email link"
    Mostly everyone just quits mail if they goof and click an email link.
    BUT some time ago at least one person invoked Mail and composed a message. This message, naturally, remained in the outbox ever since. That person learned that they can't send email that way, so ever since they just cmd-Q Mail.
    BUT Before this person learned, they walked through the mail-config and told mail to try hitting smtp.mac.com:"nonExistantUser".
    So that covers the lead-up. Two days ago, mail was invoked via a Safari link, BUT it wasn't quit, it was sent to the background.
    Where it undoubtedly tried to send the outbox repeatedly until it was kicked off the network.
    Here is what I don't understand:
    Under this scenario of a mis-configured .mac address, will mail repeatedly try and fail to smtp at the maximum possible rate?
    OR
    Is the one other factor I am about to describe responsible?
    The one other factor:
    The clock battery is dead and there was a power failure at 4am that day.
    The system clock reset to 1969.
    Of course, nobody reset it.
    Is mail.app one of the apps that the finder message warns "may behave erratically"?
    (a GROSS simplification) does it have a bit of code like:
    1 check time-of-last-send-mail-attempt
    check newest-item-in-outbox
    if newest-item more recent then last-send-attempt
    do send-mail and record time-of-last-send-mail-attempt
    and go to 1
    else wait X minutes and go to 1
    which, if the clock was mis-set to 1969 would always record a last-send-attempt prior to anything in the outbox and trigger a send loop.
    Does anyone know if either Mail is tenacious about sending to a bad .mac address, or gets ridiculous under this circumstance for bad-clock-set?
    Marc

  • Can anyone explain this behavior and tell me how to fix it?

    Using NetBeans 6.5 on Windows, Glassfish v2.1
    I have a JSF application with a page that has a tab set.
    On one of the tabs I have a panel with company information.
    One of the components on the page is an InputText field with the value bound to a session bean variable.
    The tab also has an Add button.
    Here is what the JSP looks like for the input text and button components
       <h:inputText binding="#{MainPage.companyNameTF}" id="companyNameTF" readonly="#{SessionBean1.readOnlyFlag}"
       <h:commandButton action="#{MainPage.mainAddBtn_action}" disabled="#{SessionBean1.disableEdit}" id="mainAddBtn"
            style="font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; left: 425px; top: 380px; position: absolute; width: 75px" value="Add"/>
         This is all plain vanilla stuff and I would expect that when the Add button is pushed, the session bean property would be filled with
    the value entered in the input text field.
    In the java code for the page, I have a method to process the Add button push.
    Originally, it just called a method in the session bean to check that a value was entered in the input text field by checking the bound
    session bean property.
    For some reason, that was not getting filled and I was getting either a null or empty string rather than the value in the text field.
    I added some checking in the method that processes the Add button push so I could check the values in the debugger.
    Here is a sample of that code:
        public String mainAddBtn_action() {
            String s = sb1.getCompanyName();
            s = (String)this.companyNameTF.getValue();
            s = (String)this.companyNameTF.getSubmittedValue();I check this in the debugger and NONE of the variants that I have listed have the value that was entered into the text field.
    The submittedValue is null and the others are empty strings (that is what they were initalized to).
    This is all pertty straight forward stuff and I am at a loss to explain what is happening.
    Can anyone expain this behavior, and, most important, how can I force the values to be present when the Add button is pushed.
    I have never experienced this problem before, and have no clue what is causing it.
    Thanks.

    Basically, the component bindings are just being used in plain vanilla get/set modes.
    I set them to "" when I do a clear for the fields and they are set to a value via the text field.
    No other action other than to read the values via get to insert them into the database.
    And, I always use the get/set methods rather than just setting the value directly.
    This is what is so strange about this behavior - I have created dozens of database add/update/delete pages using this same model and have not had a problem with them - even in a tab context.
    Not a clue why this one is different.
    I did notice that I had an error on the page (in IE7, you get a small triangle warning sign when something is not right).
    I figured that might be the problem - maybe buggering up the rendering process.
    I tracked that down and do not get that anymore (it had to do with the PDF display I was trying to get working a while back), but that did not resolve the problem.
    I don't think there are any tab conflicts - none of the components are shared between tabs, but I will see what happens when I move a couple of the components out of the tab context.
    I noticed that it seems to skip a cycle. Here is what I can do.
    1) Fill in text fields and add a record - works fine the first time.
    2) Clear the text fields
    3) Enter new data in the text fields and push Add
    4) I get an error saying fields are blank from my data check process.
    5) Enter new data and push Add - the record is added with the new data.
    My work around is to not enter data in step 3 and just accept the error message in step 4, then go ahead and enter the real data in step 5.
    Very ugly, but it works every time.

  • How do I fix this 'funny' JavaScript/Ajax behavior?

    Hello all!
    I have this kind of funny problem, or, well, a funny result...
    The problem is almost solved tho, but it's just this strange behavior that I can't solve.
    You can see what I mean here:
    http://apex.oracle.com/pls/apex/f?p=9949:101:1370355978553401
    Username: visitor
    Password: visitor
    Login first, then edit the URL to go to page 24 (or just click on "Web Platform", then in the submenu click on "Meals and templates", and then in the custom menu on the left click on "Show templates".
    If you have done that, click on any of the two links in the report.
    You'll see that suddenly, the whole page seems to be shown inside another region (the region named "Menu2", underneath the normal menu region).
    It's like... A page within a page. Pageception (Inception... Pageception... Get it?).
    Now, all this happens WITHOUT refreshing. Yes, I want this to be dynamic. My question is:
    How do I change my code in such a way, that it does NOT display the whole page 24 inside that menu2 region? Because I want to display a popup, not a page within a page...
    My code for doing so is in my Page Attributes. In the JavaScript tab, I have the following code for the popup, and in it you will find the code to get these values in the page items as well:
    $( function(){
      $('#ModalForm').dialog(
         modal: true,
         autoOpen: false,
         width: 500,
         height: 350,
         buttons:{ Calculate: function(){calculateTotal();},
                   Close: function(){closeForm();}        
    function openForm(pFoodTemplateId, pMealTypeId)
    var getone = new htmldb_Get('shiny',&APP_ID., null, 24); // initialize get
    getone.add('P24_TEMPLATEID', pFoodTemplateId);
    getone.add('P24_MEALID', pMealTypeId);
    gReturn = getone.get();
    getone = null;
    $('#ModalForm').dialog('open');
    function closeForm()
    { $('#ModalForm').dialog('close');}
    $(document).ready(function()
        {$('a.temppop').click(function() {openForm();});
    });"Shiny" is the name of the ID of my "menu2" region.
    In case I'm not clear (which I probably am, since I'm in a rush):
    I have 2 page items that get the value of the selected row's foodtemplateid and mealtypeid. The column link URL from my report is:
    javascript: openForm(#FOODTEMPLATEID#, #MEALTYPEID#); So, in a nutshell, item :P24_TEMPLATEID gets the value of the foodtemplateid that corresponds to the row you selected, and item :P24_MEALID gets the value of the mealtypeid that corresponds to the row you selected.
    Thank you for your time. I really appreciate it.
    Apex version: 4.1.1.00.23

    Hi,
    Maybe JavaScript should be something like this
    function openForm(pFoodTemplateId, pMealTypeId){
    $("#P24_TEMPLATEID").text(pFoodTemplateId);
    $("#P24_MEALID").text(pMealTypeId);
    var getone = new htmldb_Get(null, &APP_ID., "APPLICATION_PROCESS=DUMMY", &APP_PAGE_ID.);
    getone.add("P24_TEMPLATEID", pFoodTemplateId);
    getone.add("P24_MEALID", pMealTypeId);
    gReturn = getone.get();
    getone = null;
    $("#ModalForm").dialog("open");
    }Or
    function openForm(pFoodTemplateId, pMealTypeId){
    $s("P24_TEMPLATEID", pFoodTemplateId);
    $s("P24_MEALID", pMealTypeId);
    var getone = new htmldb_Get(null,&APP_ID.,"APPLICATION_PROCESS=DUMMY",&APP_PAGE_ID.);
    getone.add("P24_TEMPLATEID", pFoodTemplateId);
    getone.add("P24_MEALID", pMealTypeId);
    gReturn = getone.get();
    getone = null;
    $("#ModalForm").dialog("open");
    }Regards,
    Jari
    My Blog: http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai
    Edited by: jarola on Apr 19, 2012 3:56 PM

  • Surface Pro 3 Type Cover Scrolling Behavior

    I asked the same question in the surface comminity forum, and the support engineer suggested that I relay my question here.
    I've just purchased a surface pro 3 with type cover. It's a great machine and I use it for web developement projects on the go. A major part of the stack I use has to be run in linux, so I run a virtual machine with ubuntu server. I use putty to ssh into
    the vm, and rely on vim for code editing. On my previous machine I was able to get mouse scrolling support working in vim, as the events are relayed over by putty. This works even with 2 finger scrolling on trackpads of various sorts. However, this does not
    work on the type cover for surface pro 3.
    After some observations, I realized that the 2 finger scrolling on type cover's trackpad would trigger a screen scrolling animation when the scrollbars hit the end points, a behavior similar to scrolling via the touch screen. So I am guessing that instead
    of using the traditional mouse wheel events, the new trackpad uses screen scrolling events? Which explains why putty couldn't relay the scrolling to vim.
    I am wonder if this behavior can be optional or not. Perhaps a configuration somewhere would allow me to make the trackpad fire the usual mouse wheel like scrolling events so that my putty + vim combination could still benefit from the trackpad?

    Hi,
    Regarding Surface pro 3 type cover issue, we may first take a look at the following troubleshooting guide:
    Troubleshoot your Surface Cover
    For the type cover usage, please see:
    Type Cover
    Apologize for that we don't have enough materials to check the issue you mentioned here, for the usage of surface Pro 3 and its type cover, for special personal support, please take a try with the
    Contact us.
    Thank you for your understanding.
    Best regards
    Michael Shao
    TechNet Community Support

  • Swap Image Behavior with Text

    I am trying to figure something out but can't seem to find
    it. I'm sure it must be pretty simple, but I'm stumped. Basically,
    I have a main image and a few thumbnail images below it. I've
    attached the Swap Image behavior to each thumb to change the main
    image to a different photo and then changed the onMouseOver to
    onClick.
    The problem is I want to also have some photo text or caption
    below the main image to change. Does anyone know how to do this
    with more or less stock DW behaviors? Or if not, how to do it in
    the most efficient way possible?
    Thanks in advance.
    -Bill

    You could always embed the caption information in the image,
    you know? That
    would be the simplest way. Is that possible?
    Alternatively you could create a series of stacked
    containers, each hidden,
    in the location where you want your captions. Then you would
    make your
    onclick event do both the image swap and the Show/Hide on the
    associated
    caption container (*and* a hide on all the rest of the
    caption containers).
    This can be pretty tedious when there are lots of images, and
    you are using
    only the DW User interface (as opposed to Code view). It will
    also take you
    into the realm of positioned elements (probably) which can be
    troublesome
    themselves.
    Finally, if this is all too much for you, there are EXCELLENT
    alternatives
    over at projectseven ($) for doing something like this right
    out of the box.
    http://www.projectseven.com/
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "captcashew" <[email protected]> wrote in
    message
    news:[email protected]...
    >I am trying to figure something out but can't seem to
    find it. I'm sure it
    >must
    > be pretty simple, but I'm stumped. Basically, I have a
    main image and a
    > few
    > thumbnail images below it. I've attached the Swap Image
    behavior to each
    > thumb
    > to change the main image to a different photo and then
    changed the
    > onMouseOver
    > to onClick.
    >
    > The problem is I want to also have some photo text or
    caption below the
    > main
    > image to change. Does anyone know how to do this with
    more or less stock
    > DW
    > behaviors? Or if not, how to do it in the most efficient
    way possible?
    >
    > Thanks in advance.
    >
    > -Bill
    >
    > <p><img src="images/215-suite-2.jpg" alt="Main
    Photo" name="mainImage"
    > width="300" height="225" id="mainImage" /></p>
    > <p> </p>
    > <p> </p>
    > <p><img src="images/215-suite-2.jpg"
    alt="Thumbnail Photo 1"
    > name="thumb1"
    > width="100" height="75" id="thumb1"
    >
    onclick="MM_swapImage('mainImage','','images/215-suite-2.jpg',1)"
    />
    > <img src="images/renovations_02-after.jpg"
    alt="Thumbnail Photo 2"
    > name="thumb2" width="100" height="75" id="thumb2"
    >
    onclick="MM_swapImage('mainImage','','images/renovations_02-after.jpg',1)"
    > />
    > <img src="images/renovations_03-after.jpg"
    alt="Thumbnail Photo 3"
    > name="thumb3" width="100" height="75" id="thumb3"
    >
    onclick="MM_swapImage('mainImage','','images/renovations_03-after.jpg',1)"
    > /></p>
    >

  • Each time I click the "Open a New Tab" button, how do I make FF open to my homepage and why isn't this default behavior?

    Firefox does not default to your homepage when you manually open a new tab. It should do so.
    Is there a way to make FF do this? Is it an addon? If so, should this not be default behavior and just be incorporated into the browser?

    # Type ''about:config'' in Firefox's location bar
    # Find ''browser.newtab.url''
    # Double click on it
    # Paste your homepage link into the text box
    # Click ''Ok''

  • Nasty table behavior (bug?) in FM 7.1 (structured)

    Hello,
    I have found that an Import => Element Definitions... command changes paragraph styles in tables.
    Here what I've done (all in structured FM 7.1 WinXP):
    1. opened new doc based on template.
    2. added two identical tables - formats came from template:
    - 1 head row (white text, black background),
    - 2 body rows (black text),
    - 3 cols in every row.
    3. typed some text in header row and in body rows.
    4. put cursor in second table, selected and applied (to selection) another format via Table Designer.
    5. run File => Import => Element Definitions... from template (the same one I've used in step 1)
    6. RESULT: all para styles in second table became Body; table where original format was not changed kept the original styles.
    Does anybody knows how to deal with it? Template/EDD problem?
    Thanks
    Slava

    Slava,
    Since the table is part of a structured flow, importing element definitions may indeed affect its formatting.
    If the new element definitions do not contain format rules that apply directly to the content of your table cells, the formatting of the cells is determined by the table format. In particular, the information in the table format includes the paragraph format used for each cell in the first row of each of the three parts of the table (heading, body, and footing) in the table from which the format was created (or updated). Since an actual table may have more columns than stored in the table format, FrameMaker's default behavior is to apply the paragraph format stored in the table format for the first cell in the row associated with that table part.
    Your two tables have different table formats. If different paragraph formats are stored in the two table formats, then, yes, importing element definitions will apply different paragraph formats to the cells in the two tables.
    --Lynne

Maybe you are looking for

  • Administrate virtual info cube with services

    hi, all, if you come across an existing virtual info cube with services, HOW can you find out the name of the function module, that provides the data? best regards neven

  • Ok code is not getting in bp transaction

    HI All, Using BUPT i have added some custom fields in transaction BP for the role SAP Credit Management Under the Tab Fiscal Year Information. In my custom screen I have used the FM FS02_BUPA_BP021_GET to get the values in Fiscal Year Tab. Now my req

  • Connecting R/3 server to BW server.

    Hi All, I have Copied my BW Production server to a TEST BW Server with all DATA. I  also have  a TEST SAP R/3 server, which is the COPY of my SAP Production R/3 Server. My Target is not to connect this BW test server to my SAP R/3 Test server.  So th

  • Green-bar only works on first matrix in list

    Hi there, I used this tutorial (http://blogs.msdn.com/b/chrishays/archive/2004/08/30/greenbarmatrix.aspx) to have a Green-bar effect in my matrix.  However I have this matrix placed in a list which is grouped on colour (its for items of clothing) whi

  • JDeveloper 9.0.3.1 is very slow

    Hi, I have installed 9.0.3.1 and created the project from scratch. Previously I was using 903 which was very fast in bringing up my application in normail.debug mode. Now it is behaving very slow. the only difference is I am using CVS for my source c