What's wrong with executing procedure in package???

I am new to SQL Developer. I had developed a PL/SQL package<br>
(called COMMON_SQL) and compiled<br>
in my database. I could see my package in USER_OBJECTS<br><p>
COMMON_SQL          13966          PACKAGE     03-APR-07     03-APR-07     2007-04-03:22:46:27     VALID     N     N     N<br>
COMMON_SQL          13967          PACKAGE BODY     03-APR-07     03-APR-07     2007-04-03:22:48:21     VALID     N     N     N<br><p>
I did not find any compilation error on the package in USER_ERRORS,<br>
i.e. the package was compiled and deployed successfully in my database.<br><p>
But when ran the procedure CHECK_AND_DROP_OBJ in the package
as follows:<br>
declare flag integer := 1;<br>
execute COMMON_SQL.CHECK_AND_DROP_OBJ('EXCEPTIONS','TABLE',flag);<br>
/<br><p>
It gave me the following error message:<br>
Error report:<br>
ORA-06550: line 2, column 65:<br>
PLS-00103: Encountered the symbol "end-of-file" when <br>expecting one of the following:<br>
begin function package pragma procedure subtype type use<br>
<an identifier> <a double-quoted delimited-identifier> form<br>
current cursor<br>
06550. 00000 - "line %s, column %s:\n%s"<br>
*Cause:    Usually a PL/SQL compilation error.<br>
*Action:<br><p>
where line 2, column 65 pointed to the last semicolon on the second line.<br><p>
So why did it produce such an error?<br>
Can anyone tell me what the problem was?<br>
Do I need to configure or initialize SQL Developer?<br><p>
Thanks for your help in advance,<br><p>
AK<br><p>
P.S. Here is the body of my package COMMON_SQL:<br>
create or replace package body COMMON_SQL<br>
as<br>
<code> -- This procedure check for the existence of any database object by type.<br>
-- It drops the object if it exists.<br>
-- obj is the name of the dtabase object<br>
-- type is the type of the object: table, index, sequence, synonym<br>
-- flag has different types of values. <br>
-- For in, flag = 1 for print debug message.<br>
-- For out, flag = 0 for object not found.<br>
-- flag = 1 for object found and dropped.<br>
-- flag = -1 for error.<br>
procedure CHECK_AND_DROP_OBJ (obj in varchar2, type in varchar2, flag in out integer)<br>
is<br>
obj_type USER_CATALOG.TABLE_TYPE%type;<br>
str varchar2(100);<br>
cursor obj_cur is<br>
select TABLE_TYPE from USER_CATALOG where TABLE_NAME = obj;<br>
begin<br>
open obj_cur;<br>
fetch obj_cur into obj_type;<br>
if obj_cur%NOTFOUND<br>
then<br>
str := 'obj ' || obj || ' is not found';<br>
if flag = 1<br>
then<br>
DBMS_OUTPUT.PUT_LINE(str);<br>
end if;<br>
flag := 0; -- return 0<br>
elsif obj_type = type<br>
then<br>
str := 'drop ' || obj_type || ' ' || obj;<br>
execute immediate(str);<br>
if flag = 1<br>
then<br>
DBMS_OUTPUT.PUT_LINE(str);<br>
end if;<br>
flag := 1; -- return 1<br>
else<br>
str := 'obj ' || obj || ' has type mismatch';<br>
if flag = 1<br>
then<br>
DBMS_OUTPUT.PUT_LINE(str);<br>
end if;<br>
flag := -1; -- return -1<br>
end if;<br>
close obj_cur;<br>
--exception<br>
null;  ??<br>
END; --CHECK_AND_DROP_OBJ <br>
END;<br>
</code>
Message was edited by:
user567947
Message was edited by:
user567947
Message was edited by:
user567947
Message was edited by:
user567947
Message was edited by:
user567947

smitjb,<br><p>
I modified the package slightly and redeployed the package successfully.<br>
Then I ran the stored procedure as you suggested:<br>
declare debugf integer:=1;<br>
rc integer:=0;<br>
begin<br> SYSTEM.COMMON_SQL.CREATE_AND_DROP_OBJ('MPGCV_USER_SEQ','SEQUENCE',debugf,rc);<br>
end;<br>
/<br><p>
But I still got, sort of, similar error:<br>
Error starting at line 1 in command:<br>
declare debugf integer:=1;<br>
rc integer:=0;<br>
begin<br>
SYSTEM.COMMON_SQL.CREATE_AND_DROP_OBJ('MPGCV_USER_SEQ','SEQUENCE',debugf,rc);<br>
end;<br>
Error report:<br>
ORA-06550: line 4, column 23:<br>
PLS-00302: component 'CREATE_AND_DROP_OBJ' must be declared<br>
ORA-06550: line 4, column 5:<br>
PL/SQL: Statement ignored<br>
06550. 00000 - "line %s, column %s:\n%s"<br>
*Cause:    Usually a PL/SQL compilation error.<br>
*Action:<br><p>
I checked USER_ERRORS (found no error), and USER_OBJECTS and found both the package spec and body<br>
So why did it not recognize the package and its stored procedure?<br>
I was using SYSTEM account and should have the correct schema and privilege.<br>
Any idea?<br><p>
Thanks,<br><p>
AK<br><p>
P.S. Here is the body of my package:<br>
<code>
-- This package body contains all the functions/procedures<br>
-- needed by any PL/SQL scripts<br>
create or replace package body SYSTEM.COMMON_SQL<br>
as<br>
-- This procedure check for the existence of any database object by type.<br>
-- It drops the object if it exists.<br>
-- obj is the name of the dtabase object<br>
-- otype is the type of the object: table, index, sequence, synonym<br>
-- debugf indicates to print debugging message or not. <br>
-- rc is the return code, <br>
-- rc = 0 for object not found.<br>
-- rc = 1 for object found and dropped.<br>
-- rc = -1 for error.<br>
procedure CHECK_AND_DROP_OBJ (obj in varchar2, otype in varchar2, debugf in integer, rc out integer)<br>
is<br>
obj_type USER_CATALOG.TABLE_TYPE%type;<br>
str varchar2(100);<br>
cursor obj_cur is<br>
select TABLE_TYPE from USER_CATALOG where TABLE_NAME = obj;<br>
begin<br>
open obj_cur;<br>
fetch obj_cur into obj_type;<br>
if obj_type = otype<br>
then<br>
str := 'drop ' || obj_type || ' ' || obj;<br>
execute immediate(str);<br>
if debugf = 1<br>
then<br>
DBMS_OUTPUT.PUT_LINE(str);<br>
end if;<br>
rc := 1; -- return 1<br>
else<br>
str := 'obj ' || obj || ' has type mismatch';<br>
if debugf = 1<br>
then<br>
DBMS_OUTPUT.PUT_LINE(str);<br>
end if;<br>
rc := -1; -- return -1<br>
end if;<br>
close obj_cur;<br>
exception<br>
when NO_DATA_FOUND<br>
then<br>
str := 'obj ' || obj || ' is not found';<br>
if debugf = 1<br>
then<br>
DBMS_OUTPUT.PUT_LINE(str);<br>
end if;<br>
rc := 0; -- return 0<br>
when OTHERS<br>
then<br>
str := 'error encountered SQLCODE:' || to_char(SQLCODE) || <br>
' SQLERRM:' || SQLERRM;<br>
if debugf = 1<br>
then<br>
DBMS_OUTPUT.PUT_LINE(str);<br>
end if;<br>
rc := -1; -- return -1<br>
END; --CHECK_AND_DROP_OBJ <br>
END;<br>
/<br>
</code>

Similar Messages

  • What is wrong with this procedure?

    Hello:
    I am trying to create the following procedure but it does not compile. Can somebody tell me what I am doing wrong?
    CREATE OR REPLACE PROCEDURE InnoBox_SA.spCheckUser
              ciUserID IN VARCHAR(20),
              coUserID OUT VARCHAR(20),
              cLastName OUT VARCHAR(20),
              cFirstName OUT VARCHAR(20),
              cAdminInd OUT CHAR(1)
    AS
         BEGIN
              SELECT
                   user_ID_C INTO coUserID,
                   Last_Name_C INTO cLastName,
                   First_Name_C INTO cFirstName,
                   Admin_Ind_C INTO cAdminInd
              FROM
                   InnoBox_SA.S_USER
              WHERE
                   User_ID_C = ciUserID;
              IF coUserID IS NULL THEN
                   BEGIN
                        INSERT INTO InnoBox_SA.S_USER
                             (User_ID_C,
                             Created_By_C,
                             Updated_By_C)
                        VALUES
                             (ciUserID,
                             'FirstTime',
                             'FirstTime');
                   END;
         END;
    Thanks.
    Venki

    Kamal:
    I made it even simpler:
    CREATE OR REPLACE PROCEDURE InnoBox_SA.spCheckUser
              ciUserID VARCHAR(20)
    AS
         cUserID VARCHAR(20);
         BEGIN
              SELECT
                   user_ID_C INTO cUserID
              FROM
                   InnoBox_SA.S_USER
              WHERE
                   User_ID_C = ciUserID;
              IF cUserID IS NULL THEN
                   INSERT INTO InnoBox_SA.S_USER
                        (User_ID_C,
                        Created_By_C,
                        Updated_By_C)
                   VALUES
                        (ciUserID,
                        'FirstTime',
                        'FirstTime');
              END IF;
         END;
    All it takes is a User ID. If it does not exist, then it creates one.
    I used SQL-plus to create the procedure. Pl-SQL just informs me that the procedure was created with compiled errors.
    If I used EM to recompile, it says
    "Line # = 3 Column # = 19 Error Text = PLS-00103: Encountered the symbol "(" when expecting one of the following:
    := . ) , @ % default character
    The symbol ":=" was substituted for "(" to continue."
    Line 3 is refering to
    that's on Line 2 in my procedure.
    Thanks for your help.
    Venki

  • What's wrong with my procedure?

    I have written a stored procedure that takes a column name (or a partial column name) as a parameter, and lists of all the tables in the database that have a column name like that.
    It's not working. It doesn't return a list of tables and columns like it should. It returns nothing. Here's the procedure:
    =======================================
    set serveroutput on
    CREATE OR REPLACE PROCEDURE col_find(p_col_text VARCHAR2) IS
    BEGIN
         DECLARE     CURSOR cur1 IS
              select table_name, column_name
              from all_tab_columns
              where lower(column_name) = lower('%p_col_text%')
         BEGIN
              for rec1 in cur1
              loop
                   dbms_output.put_line(rec1.table_name || '.' || rec1.column_name);
              end loop;
         EXCEPTION when others then
              dbms_output.put_line('error');
         END;
    END;
    show errors;
    quit;
    =======================================
    I have found that having this type of helper procedure around is a great time-saver. I have more experience in Sybase than in Oracle, and this procedure is very simple to write in Sybase. Does anybody see what my problem is?

    Thanks for the help! But it's still coming back with nothing. Here's the updated procedure:
    set serveroutput on
    CREATE OR REPLACE PROCEDURE col_find(p_col_text VARCHAR2) IS
    BEGIN
         DECLARE     CURSOR cur1 IS
              select table_name, column_name
              from all_tab_columns
              where lower(column_name) like lower('%' || p_col_text || '%')
         BEGIN
              for rec1 in cur1
              loop
                   dbms_output.put_line(rec1.table_name || '.' || rec1.column_name);
              end loop;
         EXCEPTION when others then
              dbms_output.put_line('error');
         END;
    END;
    show errors;
    quit;

  • What's wrong with my store procedure?

    HI, I can't figure out what's wrong with my stored procedure. I believe i have a "commit;" where it's not supposed to be. What i really want to acheive is save the record once it finds those keywords. Maybe my syntax is all wrong.
    I am getting the following error msg. PLS-00103
    create or replace
    procedure sp_diag is
    DECLARE
    v_setting_key NUMBER(18);
    v_parent NUMBER(22);
    v_name VARCHAR2(100);
    v_class_key NUMBER(22);
    CURSOR c1 IS
    select setting_key, setting_class_key,name
    from cms2wire.setting_list;
    CURSOR c2 IS
    select setting_class_key, parent_class_key,name
    from cms2wire.setting_class
    where setting_class_key = v_parent;
    BEGIN
    OPEN c1;
    LOOP
    FETCH c1 into v_setting_key, v_parent, v_name;
    EXIT when c1%NOTFOUND;
    WHILE v_parent != null
    LOOP
    OPEN c2;
    FETCH c2 into v_class_key, v_parent, v_name;
    CLOSE c2;
    IF v_name='Diag.'or v_name='Settings.' THEN
    COMMIT;
    END IF;
    END LOOP;
    END LOOP;
    CLOSE c1;
    END;
    -------------------------------------------------------------------------------------

    Now, the way I see it, if you want to save the information, then you need to put it some place, so your slow-by-slow stored procedure becomes something like
    INSERT INTO some_table (column list)
      SELECT a.setting_key,
             a.setting_class_key,
             a.name
             b.setting_class_key,
             b.parent_class_key,
             b.name
        FROM cms2wire.setting_list  a,
             cms2wire.setting_class b
       WHERE a.setting_class_key = a.setting_class_key
         AND b.name in ('Diag.', 'Settings.');
    COMMIT;does it not?

  • What is wrong with the idl code generated by packager.exe?

    Hello everybody,
    I am trying to figure out what is wrong with the idl code generated by packager.exe. In the evaluation for the bug posted at http://developer.java.sun.com/developer/bugParade/bugs/4964563.html it says that the IDispatch interface is not exposed correctly and thus early binding of java objects is not possible using the current activex bridge implementation.
    As I am no idl expert I have no idea what that means. However, I managed to dig out the idl code generated by packager.exe for the following example bean:
    package test;
    public class MyBean
         protected int value;
         public MyBean()
         public void setMyValue(int _value)
              value = _value;
         public int getMyValue()
              return value;
         public MyBean getSelfReference()
              return this;
    }The corresponding idl code generated by packager.exe is
    uuid(81B0BF63-2A55-11D8-A73E-000475EBF021),
    version(1.0)
    library MyBean
    importlib("Stdole2.tlb");
    dispinterface MyBeanSource;
    dispinterface MyBeanDispatch;
    uuid(81B0BF64-2A55-11D8-A73E-000475EBF021),
    version(1.0)
    dispinterface MyBeanSource {
    properties:
    methods:
    uuid(81B0BF65-2A55-11D8-A73E-000475EBF021),
    version(1.0)
    dispinterface MyBeanDispatch {
    properties:
    [id(4097)]
    int myValue;
    methods:
    [id(32768)]
    VARIANT_BOOL equals(IDispatch* arg0);
    [id(32769)]
    IDispatch* getClass();
    [id(32770)]
    int getMyValue();
    [id(32771)]
    IDispatch* getSelfReference();
    [id(32772)]
    int hashCode();
    [id(32773)]
    void notify();
    [id(32774)]
    void notifyAll();
    [id(32775)]
    void setMyValue(int arg0);
    [id(32776)]
    BSTR toString();
    [id(32779)]
    VARIANT wait([optional] VARIANT var0, [optional] VARIANT var1);
    uuid(81B0BF62-2A55-11D8-A73E-000475EBF021),
    version(1.0)
    coclass MyBean {
    [default, source] dispinterface MyBeanSource;
    [default] dispinterface MyBeanDispatch;
    };Does anyone know what is wrong with this code and maybe how to fix the idl code? Generating the dll should then be easy (I already tried several variations of the idl code but as my idl knowledge is limited it didn't really do what I wanted).

    Then the question is why it does work with visual controls (even if you set them to non-visible)?

  • What's wrong with my approval procedure query ?

    Hi everybody,
    This is my query :
    SELECT DISTINCT 'TRUE' FROM RDR1 WHERE $[$38.U_Prix_plancher.number] >=$[$38.Price.number]
    What's wrong with that ?
    Thanks
    Ara

    Ara,
    The problem is not with your Query but the problem is with the way the Query gets trigerred for an Approval Process.
    SAP only recognizes the value of a $[$38.x.x] parameter when that particular row is active.
    I suggest you can test this by simply highlight that particular row which breaks the rule and try to Add the document and you will see that the Approval Procudure will fire.
    Also remember an Approval Procudure works only when you are in Add Mode and does not on Update.
    Regards
    Suda

  • I can't figure out what's wrong with this code

    First i want this program to allow me to enter a number with the EasyReader class and depending on the number entered it will show that specific line of this peom:
    One two buckle your shoe
    Three four shut the door
    Five six pick up sticks
    Seven eight lay them straight
    Nine ten this is the end.
    The error message i got was an illegal start of expression. I can't figure out why it is giving me this error because i have if (n = 1) || (n = 2) statements. My code is:
    public class PoemSeventeen
    public static void main(String[] args)
    EasyReader console = new EasyReader();
    System.out.println("Enter a number for the poem (0 to quit): ");
    int n = console.readInt();
    if (n = 1) || (n = 2)
    System.out.println("One, two, buckle your shoe");
    else if (n = 3) || (n = 4)
    System.out.println("Three, four, shut the door");
    else if (n = 5) || (n = 6)
    System.out.println("Five, six, pick up sticks");
    else if (n = 7) || (n = 8)
    System.out.println("Seven, eight, lay them straight");
    else if (n = 9) || (n = 10)
    System.out.println("Nine, ten, this is the end");
    else if (n = 0)
    System.out.println("You may exit now");
    else
    System.out.println("Put in a number between 0 and 10");
    I messed around with a few other thing because i had some weird errors before but now i have narrowed it down to just this 1 error.
    The EasyReader class code:
    // package com.skylit.io;
    import java.io.*;
    * @author Gary Litvin
    * @version 1.2, 5/30/02
    * Written as part of
    * <i>Java Methods: An Introduction to Object-Oriented Programming</i>
    * (Skylight Publishing 2001, ISBN 0-9654853-7-4)
    * and
    * <i>Java Methods AB: Data Structures</i>
    * (Skylight Publishing 2003, ISBN 0-9654853-1-5)
    * EasyReader provides simple methods for reading the console and
    * for opening and reading text files. All exceptions are handled
    * inside the class and are hidden from the user.
    * <xmp>
    * Example:
    * =======
    * EasyReader console = new EasyReader();
    * System.out.print("Enter input file name: ");
    * String fileName = console.readLine();
    * EasyReader inFile = new EasyReader(fileName);
    * if (inFile.bad())
    * System.err.println("Can't open " + fileName);
    * System.exit(1);
    * String firstLine = inFile.readLine();
    * if (!inFile.eof()) // or: if (firstLine != null)
    * System.out.println("The first line is : " + firstLine);
    * System.out.print("Enter the maximum number of integers to read: ");
    * int maxCount = console.readInt();
    * int k, count = 0;
    * while (count < maxCount && !inFile.eof())
    * k = inFile.readInt();
    * if (!inFile.eof())
    * // process or store this number
    * count++;
    * inFile.close(); // optional
    * System.out.println(count + " numbers read");
    * </xmp>
    public class EasyReader
    protected String myFileName;
    protected BufferedReader myInFile;
    protected int myErrorFlags = 0;
    protected static final int OPENERROR = 0x0001;
    protected static final int CLOSEERROR = 0x0002;
    protected static final int READERROR = 0x0004;
    protected static final int EOF = 0x0100;
    * Constructor. Prepares console (System.in) for reading
    public EasyReader()
    myFileName = null;
    myErrorFlags = 0;
    myInFile = new BufferedReader(
    new InputStreamReader(System.in), 128);
    * Constructor. opens a file for reading
    * @param fileName the name or pathname of the file
    public EasyReader(String fileName)
    myFileName = fileName;
    myErrorFlags = 0;
    try
    myInFile = new BufferedReader(new FileReader(fileName), 1024);
    catch (FileNotFoundException e)
    myErrorFlags |= OPENERROR;
    myFileName = null;
    * Closes the file
    public void close()
    if (myFileName == null)
    return;
    try
    myInFile.close();
    catch (IOException e)
    System.err.println("Error closing " + myFileName + "\n");
    myErrorFlags |= CLOSEERROR;
    * Checks the status of the file
    * @return true if en error occurred opening or reading the file,
    * false otherwise
    public boolean bad()
    return myErrorFlags != 0;
    * Checks the EOF status of the file
    * @return true if EOF was encountered in the previous read
    * operation, false otherwise
    public boolean eof()
    return (myErrorFlags & EOF) != 0;
    private boolean ready() throws IOException
    return myFileName == null || myInFile.ready();
    * Reads the next character from a file (any character including
    * a space or a newline character).
    * @return character read or <code>null</code> character
    * (Unicode 0) if trying to read beyond the EOF
    public char readChar()
    char ch = '\u0000';
    try
    if (ready())
    ch = (char)myInFile.read();
    catch (IOException e)
    if (myFileName != null)
    System.err.println("Error reading " + myFileName + "\n");
    myErrorFlags |= READERROR;
    if (ch == '\u0000')
    myErrorFlags |= EOF;
    return ch;
    * Reads from the current position in the file up to and including
    * the next newline character. The newline character is thrown away
    * @return the read string (excluding the newline character) or
    * null if trying to read beyond the EOF
    public String readLine()
    String s = null;
    try
    s = myInFile.readLine();
    catch (IOException e)
    if (myFileName != null)
    System.err.println("Error reading " + myFileName + "\n");
    myErrorFlags |= READERROR;
    if (s == null)
    myErrorFlags |= EOF;
    return s;
    * Skips whitespace and reads the next word (a string of consecutive
    * non-whitespace characters (up to but excluding the next space,
    * newline, etc.)
    * @return the read string or null if trying to read beyond the EOF
    public String readWord()
    StringBuffer buffer = new StringBuffer(128);
    char ch = ' ';
    int count = 0;
    String s = null;
    try
    while (ready() && Character.isWhitespace(ch))
    ch = (char)myInFile.read();
    while (ready() && !Character.isWhitespace(ch))
    count++;
    buffer.append(ch);
    myInFile.mark(1);
    ch = (char)myInFile.read();
    if (count > 0)
    myInFile.reset();
    s = buffer.toString();
    else
    myErrorFlags |= EOF;
    catch (IOException e)
    if (myFileName != null)
    System.err.println("Error reading " + myFileName + "\n");
    myErrorFlags |= READERROR;
    return s;
    * Reads the next integer (without validating its format)
    * @return the integer read or 0 if trying to read beyond the EOF
    public int readInt()
    String s = readWord();
    if (s != null)
    return Integer.parseInt(s);
    else
    return 0;
    * Reads the next double (without validating its format)
    * @return the number read or 0 if trying to read beyond the EOF
    public double readDouble()
    String s = readWord();
    if (s != null)
    return Double.parseDouble(s);
    // in Java 1, use: return Double.valueOf(s).doubleValue();
    else
    return 0.0;
    Can anybody please tell me what's wrong with this code? Thanks

    String[] message = {
        "One, two, buckle your shoe",
        "One, two, buckle your shoe",
        "Three, four, shut the door",
        "Three, four, shut the door",
        "Five, six, pick up sticks",
        "Five, six, pick up sticks",
        "Seven, eight, lay them straight",
        "Seven, eight, lay them straight",
        "Nine, ten, this is the end",
        "Nine, ten, this is the end"
    if(n>0)
        System.out.println(message[n]);
    else
        System.exit(0);

  • What is wrong with as3

    this is not a question about 'how i do X'. is rather a 'discussion' (flame or whatever, but to defend or argue about aspects, not people) about 'what is wrong with as3' and what aspects whould be taken into consideration for updates. right now i am using as3, and since i paid for this license, i choose this tool over some alternatives and i am using it to do stuff for other people who pay me to do it, i think it can be helpful for all of us if some actions are started in the right direction. i have already posted about 'all people in adobe are dumbasses that do not know how to make a scripting tool and are messing up my work', but i was pissed at the time (i still am pissed) but i believe this is not the right aproach. instead, if this goes to the right people in adobe, we all may get something in the future, like better and easier todo apps and web presentations.
    pre: not only about the as3 specification, but COMPLY with the specification that you set. for example, some time ago there were problems with matrix transforms. this was corrected later with a patch. but this means it is not even doing what is is supposed to do
    1. scriptable masks and movement, sprites and child sprites: there is a sprite with a mask, the mask is a shape drawn via script, something like
    somemask=new shape();
    somemask.graphics.beginfill();
    (...etc)
    somesprite.mask=somemask;
    just like that. now add some child sprites to 'somesprite', and make 'somesprite' move, scale and rotate. there you will have something like a kaleidoscope, but not what you expected to do with your script. as the child sprites move in the parent mask, you will see that the child sprites appear or dissapear kind of randomly, and if the child sprites are textfields, it may be that the text is rendered outside the mask, or partially rendered outside the mask (as in only part of the text), rendered with the wrongf rotation or in the wrong place. some child sprites are clipped correctly, some dissapear totally when only a part should dissapear (clipped) etc.
    way around: have not tried it yet, but i have the impression that bitmaps have different criteria for clipping, so i am thinking of trying this: appli an empty filter (a filter with params so it does not have any effect on the sprite or in the textfield) so the sprite is rendered as bitmap before doing anything else with it. as i said, i have not done it yet, but it may be a way around this problem, to avoid all this inconsistency with clipping
    1-b. inconsistency between hierarchy and coordinates, specially masks: you apply a mask to a sprite, yet the sprite has a set of coordinates (so 'x' in the sprite means an x relative to its container), yet the mask applied to the very same sprite, as another reference as reference for coordinates (like the stage)
    2. painting via script: in any other languaje, in any other situation, something like:
    beginFill(params);
    (...stuff 1)
    endFill();
    beginFill(params);
    (...stuff 2)
    endFill();
    (...etc)
    means: render region of block 1, then render region of block 2 etc, and no matter what, it should be consistent, since there is noplace for ambiguity. if you read it, you may think what that means, even if you dont run it you may have an idea of the picture you want to draw, but not with as3. as3 somehow manages to screw something that simple, and mixes all the blocks, and somehow uses the boundaries of one block as boundaries for other block. is like all blocks are dumped into whatever, and then uses all lines defined into it as boundaries for a unique block. it changes all boundaries and generates inconsistency between what is shown and redraw regions of the resulting picture, like lines that go to the end of the screen and then dont go away in the next frames, even tough the beginfill endfill block should prevent it
    3. event flow: i dont know what was the policy behind as3 event flow design. it is in no way similar or an extension to previous event flow, neither with any event flow in any other plattform. i dont know how most people start with as3; in my case, i unpacked, installed and when i tried to do something with what i already knew i could not, so i started reading the as3 docs, and since is like 800 pages long, i just read the basics and the rest i would 'wing it'. in the part of the event flow, there was something about bubbling and stuff, it was not clear at all and when i tried to do what is was said in the documentation (like preventing events to 'bubble', as is called in the documentation), i could not see any effect but i could see it was a mess. flash is not the only thing out there to work with pictures or to work with mouse events, but is the only one that deals with things like 'target' and 'currentTarget'. my first experience on needing this was when i was dealing with my own event handlers (so the only thing that had control over mouse was the stage, and i would admin everything via script). there were events generated everywhere, the stage got events that were not genrated directly over the stage, but got there not with stage coordinates but the coordinates relative to the sprite that generated the event. so if i hover the mopuse over the stage, and the stage has some things on it how does it work? i get multiple event calls, like it was hovering multiple times over the stage in a single frame, but in each call with different coordinates? and what if i set all child sprites as mouseenabled=false or compare like 'if (event.target != event.currenttarget)', what if i move the mouse over a child, does it prevent the move mouse event at all? or does it filter only the event call with only stage coordinates? in my case, every time i move over another clip (with mouseenabled = true), the stage gets it as 'mouse up', even tough there was never a mouse release, what the hell? do even the people at adobe know how to handle events with their own tool when they require it? why does an event 'bubble' when i have not specifically tell it to do it? mi thought is that this event flow was very poorly conceived, and tough the intention may have been that there were different cases and it shopuld cover all cases, they actually introduced new problems that were not present in traditional ways to handle it, and it is neither the easier way to handle things, and this way, a very simple problem turns into a very ugly thing because it must handle things that were not neccesary to handle, or were implicit in other situations.
    4. legacy: since as3, all interaction is different, and if you want to do things in the new plattform, using the new features, what you already knew just goes to the garbage can. when a new tool arrives, it should be an extension to previous tools (which is a reason to update instead of just buying a new tool from a different vendor). if everything i had or knew just means nothing from now on, then i can not say 'i know flash script', and my previous knowledge gives me no advantage when aproaching the new version. as3 is a new aproach that requires doc reading and stuff, even if you knew something about previous as specifications or other oo languajes. if you decide to change things from now on, like the things mentioned in this post, instead of just throwing away everything the users alerady knew about the tool, do like in java releases, they mark some things as 'deprecated', they keep working as they should, give a warning, but also a message saying this feature is deprecated, we suggest you use this library instead.
    5. lack of previous functionality: if you 'update' something, it meand all previos functionality is still there (probably improved, but not with bugs if it was working fine), plus something else. now it seems backwards, there are some things that could be done in previous versions but not in this one, like 'duplicatemovieclip'
    6. inconsistency with scripting/programming paradigms: (ok, fancy work, but fits perfectly here): as3 proposed ways to handle things, but the people who designed it got 'too creative', and they did something that is not consistent neither with previous versions of as or with other languajes. the documentations is full of things like 'it looks like x languaje or languaje family, but instead of using XXX word, you must use YYY'. great, what is this? namespaces 'work like', but 'differently' for example from java, .net, .c. its got the idea that a namespace means a grouped functionality but there are rules about where should be placed the file (ok, java has this also, .net takes care of it automatically if all files are registered in the project), but what you got is a mess that 'if you know other languajes you got the general idea, but nonetheless, even if you knew this or previosu versions of as, you still have to read whatever we decided arbitrarily just to be different'. namespaces, event handling, vars definition which is not like previous scripting neither like fully typed languajes.. is just a mess.
    7. lack of scripting and graphics integration: unlike flash and adobe tools that just got on the graphics side leaving all the scripting integratuion apart, most tools from other vendors integrate very well interacton with what is on the screen. the script editor: very poor. autocompletion? a drop down list that does not heklp at all, appears in the wrong places, and when you need it to go, it does not go (so if i want to move away from the uncalled drop down list, i have to click somewhere else, making developement slowewr instead of helping, so the drop down list does not capture all events when i dont want to). in other ides you double click somewhere and it will go to the part of code relevant to that event or whatever. for example microsoft tools, ok i am antimicrosoft, and one of the reasons was that when windows 95 got to market proposing itself as the ONLY pc os you could use if you wanted to keep useing the apps you already had, it was a lousy product full of flaws but you had to keep using it because you had no choice. what is so different from what is happening with flash just now? yet the ide of c# is awesome, works very well and seems reliable.
    adobe people: not all user are designers that just make pretty pictures. if it is not intended for scripting then why is it there. and if there are corrections to be done, they should patch all versions, not only the last one. previous version users also paid for their versions.

    Well, there is no point in arguing.
    I personally believe AS3 does exactly what it promises to do within limits (read: reasonable limits) of ECMA type of language. And sometimes it doesn’t do what we expect it to for it cannot possibly emulate everyone’s thinking process. The task, I guess, is to learn to think in terms of AS3 – not to try to make AS3 think like us. No language covers all the grounds. And no, it is not Java - with no negative or positive connotation. It is what it is. Period. I just hope that AS5 will be more Java like.
    You are right about the fact that it is not necessary to know all the aspects of language in order to perform the majority of tasks. But it is paramount to have a clear idea about such fundamental concepts as display list model and events. For instance, depth swap has no meaning in terms of AS3 because display list object stacking is controlled automatically and there is no need for all these jumping through hoops one has to perform in order to control depth in AS2. There no more gaps in depths and one always know where to find things.
    Similarly, there is no point in having duplicateMovieClip method. More conventional OOP ways of object instantiation accomplishes just that and much more. Just because OOP object instantiation needs to be learned doesn’t mean past hacks have place in modern times. duplicateMovieClip is a horse carriage standing next to SUV. What one should choose to travel?
    Events are implemented to the tee in the context of ECMA specifications. I consider Events model as very solid, it works great (exactly as expected) and never failed me. True, it takes time to get used to it. But what doesn’t?
    By the way, speaking about events, contrary to believe in Adobe’s inconsideration to their following. Events are implemented with weakly reference set to false although it would be better to have it set to true. I think this is because there are smart and considerate people out there who knew how difficult it would be for programming novices to deal with lost listeners.
    I think AS3 is million times better than AS2. And one of the reasons it came out this way is that Adobe made a very brave and wise decision to break totally loose from AS2’s inherent crap. They have created a totally new and very solid language. If they had tried to make it backward compatible – it would be a huge screw up, similar to how our friends at Microsoft are prostituting VB and VBA – extremely irritating approach IMHO.
    Also, Flash legacy issues shouldn’t be overlooked. Flash did not start as a platform for programmers. Entire timeline concept in many ways is not compatible with the best OOP practices and advancements. I think for anyone who is used to writing classes the very fact of coding on timeline sounds awkward. It feels like a hack (and AS2 IS a pile of hacks) – the same things can be nicely packaged into classes and scale indefinitely. As such I wouldn’t expect Adobe to waste time on hacking timeline concept issues by making smarter editor. They have made a new one – FlexBuilder – instead. Serious programmers realize very soon that Flash IDE is not for developing industrial strength applications anyway. So, why bother with channeling great minds into polishing path to the dead end?
    I would like to state that all this is coming form a person who knew Flash when there was no AS at all. And I applaud every new generation of this wonderful tool.
    I believe Adobe does a great job making transition from timeline paradigm to total OOP venue as smooth as possible. And no, they don’t leave their devoted followers behind contrary to many claims. They are working on making developing Flash applications as easy as possible for people of all walks. Welcome Catalyst!
    Of course there is not enough information about AS3 capabilities and features. But, on the other hand, I don’t know any area of human kind activities that does.

  • What's wrong with this SQL?

    what's wrong with this SQL?
    Posted: Jan 16, 2007 9:35 AM Reply
    Hi, everyone:
    when I insert into table, i use the fellowing SQL:
    INSERT INTO xhealthcall_script_data
    (XHC_CALL_ENDED, XHC_SWITCH_PORT, XHC_SCRIPT_ID, XHC_FAX_SPECIFIED)
    VALUES (SELECT TO_DATE(HH_END_DATE||' '||HH_END_TIME,'MM/DD/YY HH24:MI:SS'), HH_SWITCHPORT, HH_SCRIPT,'N'
    FROM tmp_healthhit_load WHERE HH_SCRIPT !='BROCHURE' UNION
    SELECT TO_DATE(HH_END_DATE||' '||HH_END_TIME,'MM/DD/YY HH24:MI:SS'), HH_SWITCHPORT, HH_SCRIPT,'N' FROM tmp_healthhit_load WHERE HH_SCRIPT !='BROCHURE');
    I always got an error like;
    VALUES (SELECT TO_DATE(HH_END_DATE||' '||HH_END_TIME,'MM/DD/YY HH24:MI:SS'), HH_SWITCHPORT,
    ERROR at line 3:
    ORA-00936: missing expression
    but I can't find anything wrong, who can tell me why?
    thank you so much in advance
    mpowel01
    Posts: 1,516
    Registered: 12/7/98
    Re: what's wrong with this SQL?
    Posted: Jan 16, 2007 9:38 AM in response to: jerrygreat Reply
    For starters, an insert select does not have a values clause.
    HTH -- Mark D Powell --
    PP
    Posts: 41
    From: q
    Registered: 8/10/06
    Re: what's wrong with this SQL?
    Posted: Jan 16, 2007 9:48 AM in response to: mpowel01 Reply
    Even I see "missing VALUES" as the only error
    Eric H
    Posts: 2,822
    Registered: 10/15/98
    Re: what's wrong with this SQL?
    Posted: Jan 16, 2007 9:54 AM in response to: jerrygreat Reply
    ...and why are you doing a UNION on the exact same two queries?
    (SELECT TO_DATE(HH_END_DATE||' '||HH_END_TIME,'MM/DD/YY HH24:MI:SS') ,HH_SWITCHPORT ,HH_SCRIPT ,'N' FROM tmp_healthhit_load WHERE HH_SCRIPT !='BROCHURE' UNION SELECT TO_DATE(HH_END_DATE||' '||HH_END_TIME,'MM/DD/YY HH24:MI:SS') ,HH_SWITCHPORT ,HH_SCRIPT ,'N' FROM tmp_healthhit_load WHERE HH_SCRIPT !='BROCHURE');
    jerrygreat
    Posts: 8
    Registered: 1/3/07
    Re: what's wrong with this SQL?
    Posted: Jan 16, 2007 9:55 AM in response to: mpowel01 Reply
    Hi,
    thank you for your answer, but the problem is, if I deleted "values" as you pointed out, and then execute it again, I got error like "ERROR at line 3:
    ORA-03113: end-of-file on communication channel", and I was then disconnected with server, I have to relogin SQLplus, and do everything from beganing.
    so what 's wrong caused disconnection, I can't find any triggers related. it is so wired?
    I wonder if anyone can help me about this.
    thank you very much
    jerry
    yingkuan
    Posts: 1,801
    From: San Jose, CA
    Registered: 10/8/98
    Re: what's wrong with this SQL?
    Posted: Jan 16, 2007 9:59 AM in response to: jerrygreat Reply
    Dup Post
    jerrygreat
    Posts: 8
    Registered: 1/3/07
    Re: what's wrong with this SQL?
    Posted: Jan 16, 2007 10:00 AM in response to: Eric H Reply
    Hi,
    acturlly what I do is debugging a previous developer's scipt for data loading, this script was called by Cron work, but it never can be successfully executed.
    I think he use union for eliminating duplications of rows, I just guess.
    thank you
    jerry
    mpowel01
    Posts: 1,516
    Registered: 12/7/98
    Re: what's wrong with this SQL?
    Posted: Jan 16, 2007 10:03 AM in response to: yingkuan Reply
    Scratch the VALUES keyword then make sure that the select list matches the column list in number and type.
    1 insert into marktest
    2 (fld1, fld2, fld3, fld4, fld5)
    3* select * from marktest
    UT1 > /
    16 rows created.
    HTH -- Mark D Powell --
    Jagan
    Posts: 41
    From: Hyderabad
    Registered: 7/21/06
    Re: what's wrong with this SQL?
    Posted: Jan 16, 2007 10:07 AM in response to: jerrygreat Reply
    try this - just paste the code and give me the error- i mean past the entire error as it is if error occurs
    INSERT INTO xhealthcall_script_data
    (xhc_call_ended, xhc_switch_port, xhc_script_id,
    xhc_fax_specified)
    SELECT TO_DATE (hh_end_date || ' ' || hh_end_time, 'MM/DD/YY HH24:MI:SS'),
    hh_switchport, hh_script, 'N'
    FROM tmp_healthhit_load
    WHERE hh_script != 'BROCHURE'
    UNION
    SELECT TO_DATE (hh_end_date || ' ' || hh_end_time, 'MM/DD/YY HH24:MI:SS'),
    hh_switchport, hh_script, 'N'
    FROM tmp_healthhit_load
    WHERE hh_script != 'BROCHURE';
    Regards
    Jagan
    jerrygreat
    Posts: 8
    Registered: 1/3/07
    Re: what's wrong with this SQL?
    Posted: Jan 16, 2007 11:31 AM in response to: Jagan Reply
    Hi, Jagan:
    thank you very much for your answer.
    but when I execute it, I still can get error like:
    ERROR at line 1:
    ORA-03113: end-of-file on communication channel
    so wired, do you have any ideas?
    thank you very much

    And this one,
    Aother question about SQL?
    I thought I already told him to deal with
    ORA-03113: end-of-file on communication channel
    problem first.
    There's nothing wrong (syntax wise) with the query. (of course when no "value" in the insert)

  • What is wrong with my XPath Query ??

    Hi Guys,
    please help me to solve the following problem. Trying to execute :
    XPathAPI.selectNodeList(MyNode,"//*[starts-with()='WType']")
    throws always an exception :
    javax.xml.transform.TransformerException: FuncStartsWith only allows 2 arguments
    What doesn't that mean ? What's wrong with my query ?

    According to my XSLT book, the starts-with() function requires 2 arguments. You haven't given it any arguments, and that seems to be exactly what the error message is telling you. And it returns a boolean, so comparing that with a string isn't going to work either.
    I suggest you will find Mulberry's xsl-list a better place to ask questions about XSLT than a Java forum. You can find it here:
    http://www.mulberrytech.com/xsl/xsl-list/

  • What is wrong with my Photoshop CS3 extended?

    Hello. I don't understand what's wrong with my CS3 extended, but i don't have Render filters under Filter menu. Have everything else but no Render. Anybody ever had same problem?
    thank you

    >
    "probably bad version of photoshop...
    Very possible if you didn't buy it from an authorised dealer. There have been some very convincing counterfeits being sold all over the world, and one of the tell-tales is that not everything in the application works and /or there are things missing from it.
    Does the disk or the packaging have "Printed in Singapore" on it?

  • What's wrong with my XPath statement using dom4j?

    I'm pretty new to XML. However, I did pick up a book and I'm pretty much through it. I got a copy of dom4j and I created a sample XML file. I'm able to parse the data and find out the child elements of root but I'm having problems with using XPath no matter what I do. Here's my code:
    import org.dom4j.*;
    import org.dom4j.io.*;
    import java.util.*;
    import java.io.*;
    public class XMLACL {
      org.dom4j.Document doc;
      org.dom4j.Element root;
      XMLACL(String x) {
        String tempFile = System.getProperty("user.dir") + "/winsudo.xml";
        tempFile = tempFile.replace('\\', '/');
        SAXReader xmlReader = new SAXReader();
        try {
          doc = xmlReader.read(tempFile);
        catch (Exception e) {}
        root = doc.getRootElement();
        //treeWalk();
        //iterateRootChildren("grant");
        XPath xpathSelector = DocumentHelper.createXPath("/grant[@prompt='no']");  
        List results = xpathSelector.selectNodes(doc);
        for (Iterator iter = results.iterator(); iter.hasNext(); ) {
         Element element = (Element) iter.next();
          System.out.println(element.getName());
    }And here's my XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <config>
         <alias name="admin">
              <user>geneanthony</user>
              <user>mike</user>
              <user>rob</user>
         </alias>
         <grant prompt="no" runas="root" service="no">
              <user>geneanthony</user>
              <command>!ALL</command>
         </grant>
         <grant>
              <user>geneanthony</user>
              <group>users</group>
              <command>C:/Program Files/Mozilla Firefox/firefox.exe</command>
         </grant>
         <grant>
              <alias>admin</alias>
              <command>!Panels</command>
         </grant>
    </config>I'm currently getting this error:
    C:\Borland\JBuilder2005\jdk1.4\bin\javaw -classpath "C:\code\java\WinSudo\classes;C:\Borland\JBuilder2005\jdk1.4\jre\javaws\javaws.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\charsets.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\dnsns.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\ldapsec.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\localedata.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\sunjce_provider.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\im\indicim.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\im\thaiim.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\jce.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\jsse.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\plugin.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\rt.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\sunrsasign.jar;C:\Borland\JBuilder2005\jdk1.4\lib\dt.jar;C:\Borland\JBuilder2005\jdk1.4\lib\htmlconverter.jar;C:\Borland\JBuilder2005\jdk1.4\lib\tools.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\jRegistryKey.jar;C:\Borland\JBuilder2005\jdk1.4\lib\hsqldb.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\dom4j-1.6.1.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\syntax.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\IzPack-install-3.7.2.jar" winsudo.Main
    java.lang.NoClassDefFoundError: org/jaxen/JaxenException
         at org.dom4j.DocumentFactory.createXPath(DocumentFactory.java:230)
         at org.dom4j.DocumentHelper.createXPath(DocumentHelper.java:121)
         at winsudo.XMLACL.<init>(XMLACL.java:26)
         at winsudo.Main.main(Main.java:15)
    Exception in thread "main"
    Can someone tell me what's wrong with my code. None of the samples I've seen came with the XML files so I don't know if I when I start the XPATH I need to use / for the root element, or // or a forward slash and the root name. Can I please get some help!

    Thank you! I didn't haven Jaxen I thought everything was in the package and I must have missed it in the tutorials. That resolved the dropouts and I think I'm good know. I couldn't think for the life of me what I was doing wrong!

  • What's wrong with the server?

    execute me ~what's wrong with the server? I can‘t use the command nohup any longer.Can somebody help me?
    root@shhis1new # nohup
    Segmentation Fault (core dumped)
    root@shhis1new # nohup ls
    Segmentation Fault (core dumped)
    root@shhis1new # nohup /opt/SUNWexplo/bin/explorer -w all &
    [1] 6871
    root@shhis1new #
    [1]+ Segmentation Fault (core dumped) nohup /opt/SUNWexplo/bin/explorer -w all
    root@shhis1new # uname -a
    SunOS shhis1new 5.9 Generic_122300-19 sun4u sparc SUNW,Netra-T12
    System Configuration: Sun Microsystems sun4u Sun Fire E2900
    System clock frequency: 150 MHZ
    Memory size: 49152 Megabytes
    Best Regards
    <email address removed by moderator>
    Edited by: 884082 on 2011-11-22 下午10:00

    Moderator Action:
    You email address has been removed from your post.
    You wouldn't want bad people to send you spam messages for the rest of your life, eh?
    Moderator Advice:
    If this is the same E2900 that you have mentioned in every one of your other forum posts, then it would seem you need to contact Technical Support and open a proper support request. These forums are NOT techsupport and that system seems so poorly configured that it needs deep analysis. Such investigation cannot be done by using an online forum.
    The immediate solution is to log on to the SC of that box and power it down, then boot it back up. At least it will be running after that.

  • What's wrong with my multi-threaded Matrix Mult. code? 1 thread is fastest

    For some reason, 1 thread performs the best. What's wrong with my implementation?
    import java.util.Random;
    import java.util.Date;
    import java.util.concurrent.ExecutorService;
    import java.util.concurrent.Executors;
    import java.util.concurrent.TimeUnit;
    public class Matrix {     
         private int values[][];
         private int rows;
         private int columns;
         public Matrix(int r, int c) {
              this.rows = r;
              this.columns = c;
              this.values = new int[r][c];
         private void randomize() {
              Random generator = new Random();
              for (int r = 0; r < this.rows; r++) {
                   for (int c = 0; c < this.columns; c++) {
                        this.values[r][c] = generator.nextInt(10);
         public String toString() {
              String out = "";
              for (int r = 0; r < this.rows; r++) {
                   for (int c = 0; c < this.columns; c++) {
                        if (c == 0) out += "[";
                        else out += "\t";
                        out += this.values[r][c];
                   out += "]\n";
              return out;
         public boolean equals(Object obj) {
              Matrix other = (Matrix) obj;
              if (this.columns != other.columns || this.rows != other.rows)  {
                   return false;
              for (int r = 0; r < this.rows; r++) {
                   for (int c = 0; c < this.columns; c++) {
                        if (this.values[r][c] != other.values[r][c]) {
                             return false;
              return true;
         // matrix multiplication using single thread
         public Matrix times(Matrix other) {
              assert(this.columns == other.rows);
              Matrix out = new Matrix(this.rows, other.columns);
              for (int r = 0; r < this.rows; r++) {
                   for (int c = 0; c < other.columns; c++) {
                        int dotProduct = 0;
                        for (int z = 0; z < this.columns; z++) {
                             dotProduct += this.values[r][z] * other.values[z][c];
                        out.values[r][c] = dotProduct;
              return out;
         // matrix multiplication with many threads
         public Matrix ptimes(Matrix other, int numberOfThreads) throws InterruptedException { // parallel
              assert(this.columns == other.rows);
              Matrix out = new Matrix(this.rows, other.columns);
              ExecutorService threadExecutor = Executors.newFixedThreadPool(numberOfThreads);
              for (int r = 0; r < this.rows; r++) {
                   for (int c = 0; c < other.columns; c++) {
                        threadExecutor.execute(new HelperThread(r, c, this, other, out));
              threadExecutor.shutdown();
              threadExecutor.awaitTermination(2, TimeUnit.DAYS);
              return out;
         private class HelperThread implements Runnable {
              private int row;
              private int col;
              private Matrix a;
              private Matrix b;
              private Matrix out;
              HelperThread(int r, int c, Matrix a, Matrix b, Matrix o) {
                   this.row = r;
                   this.col = c;
                   this.a = a;
                   this.b = b;
                   this.out = o;
              public void run() {
                   int dotProduct = 0;
                   for (int z = 0; z < a.columns; z++) {
                        dotProduct += this.a.values[row][z] * this.b.values[z][col];
                   this.out.values[row][col] = dotProduct;
         public static void main(String[] args) throws InterruptedException {
              int size = 100;
              Matrix a = new Matrix(size, size);
              a.randomize();     
              Matrix b = new Matrix(size, size);
              b.randomize();
              for (int t = 1; t < 15; t++) {
                   long start = new Date().getTime();
                   System.out.print(t + " threads: ");
                   Matrix c = a.ptimes(b, t);
                   //System.out.println(c);
                   long finish = new Date().getTime();
                   System.out.println((finish - start) + " milliseconds");
                   Matrix d = a.times(b);
                   assert(c.equals(d));
    }

    This one is even faster. On my dual core I get:
    Warmup
    Single Threaded
    5.20616 milliseconds
    5.52872 milliseconds
    5.12708 milliseconds
    5.59048 milliseconds
    5.16104 milliseconds
    5.1838 milliseconds
    5.37104 milliseconds
    5.1788 milliseconds
    5.18636 milliseconds
    5.15736 milliseconds
    Multi Threaded with 2 threads
    3.22184 milliseconds
    2.86552 milliseconds
    2.86284 milliseconds
    3.67032 milliseconds
    3.08032 milliseconds
    2.97388 milliseconds
    2.93084 milliseconds
    3.44012 milliseconds
    2.89744 milliseconds
    2.88136 milliseconds
    As you can see the Multi-Threaded versions are now faster.
        // matrix multiplication with many threads
        ExecutorService threadExecutor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
        public Matrix ptimes(Matrix other) throws InterruptedException, ExecutionException {
            assert (this.columns == other.rows);
            Matrix out = new Matrix(this.rows, other.columns);
            Future futures[] = new Future[rows];
            for (int r = 0; r < this.rows; r++) {
                futures[r] = threadExecutor.submit(new HelperThread(r, this, other, out));
            for(Future f : futures) {
                f.get();
            return out;
        private class HelperThread implements Callable<Object> {
            private int row;
            private Matrix a;
            private Matrix b;
            private Matrix out;
            HelperThread(int r, Matrix a, Matrix b, Matrix o) {
                this.row = r;
                this.a = a;
                this.b = b;
                this.out = o;
            public String call() throws Exception {
                int dotProduct = 0;
                for (int c = 0; c < b.columns; c++) {
                    for (int z = 0; z < a.columns; z++) {
                        dotProduct += this.a.values[row][z] * this.b.values[z][c];
                    this.out.values[row][c] = dotProduct;
                return null;
        public static void main(String[] args) throws InterruptedException, ExecutionException {
            int size = 100;
            Matrix a = new Matrix(size, size);
            a.randomize();
            Matrix b = new Matrix(size, size);
            b.randomize();
            System.out.println("Warmup");
            for (int t = 0; t < 1000; t++) {
                Matrix c = a.ptimes(b);
                Matrix d = a.times(b);
                assert (c.equals(d));
            System.out.println("Single Threaded");
            for (int t = 0; t < 10; t++) {
                long start = System.nanoTime();
                Matrix d = a.times(b);
                long finish = System.nanoTime();
                System.out.println((finish - start)/1000000.0 + " milliseconds");
            System.out.println("Multi Threaded with " + Runtime.getRuntime().availableProcessors() + " threads");
            for (int t = 0; t < 10; t++) {
                long start = System.nanoTime();
                Matrix c = a.ptimes(b);
                long finish = System.nanoTime();
                System.out.println((finish - start)/1000000.0 + " milliseconds");
                Matrix d = a.times(b);
                assert (c.equals(d));
            System.exit(0);
        }

  • What's wrong with FaceTime

    When is it going to start back working? What's wrong with it?

    If you are having issues with Facetime, and your device is running iOS 7.1, and you have followed the troubleshooting procedures (http://support.apple.com/kb/TS3367), contact apple support.
    The http://www.apple.com/support/systemstatus/ page states that if you are experiencing an issue not listed, to contact support .

Maybe you are looking for