[BUG] max() function in Flash
Hi,
I found a little problem with the built in min() and max() functions with pixel bender in flash.
pixel4 sample = sampleNearest(src,outCoord());
float causeBug = max(sample.r, sample.b);
dst = sample;
Basically, with the above code I would expect the output image to be the same as the input image as sample is never modified. The pixel bender toolkit does exactly this. However, in Flash (10.1) the value of the first parameter in the function is modified and the image changes (in this example blues turn purple).
The workaround is to assign off the first parameter to it's own variable before calling the function.
pixel4 sample = sampleNearest(src,outCoord());
float workaround = sample.r;
float causeBug = max(workaround, sample.b );
dst = sample;
The above code produces the same result in both flash and toolkit.
src files: http://deja-visite.com/pixelbender_bug.zip
Cheers,
Jareth
This is fixed in version 2.0 of the Pixel Bender toolkit which will be up soon at the Pixel Bender Developer Network (http://www.adobe.com/devnet/pixelbender/).
The Pixel Bender 2.0 toolkit is also installed with CS5 AE or Flash Pro or any suite that includes either of those applications.
Bob
Similar Messages
-
Bug? using MAX() function on char(1) column returns something larger
details:
-- we have a complex nested query, where we are essentially returning the max() value into a variable
-- the max() function is being used on a char(1) column
-- where MAX() is part of an inner select, we have started getting
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
errors.
SELECT MAX(X) INTO var FROM ... works in 9i and 10g
SELECT X INTO var FROM (SELECT MAX(X) X FROM ... worked in 9i, does not work in 10g!
-- We never had problems with the code until upgrading to 10g release 2.
-- the Solution is to cast the final value with TO_CHAR(). The cast MUST be done at the outer most point of the select:
SELECT TO_CHAR(X) INTO var FROM (SELECT MAX(X) X FROM ... works
SELECT X INTO var FROM (SELECT TO_CHAR(MAX(X)) X FROM ... causes an error!
The following script demonstrates the issue, and includes the solution:
* October 3, 2006
* Possible SQL bug introduced with Oracle 10G
* Natalie Gray DBA/Developer, Environment Canada
* Description:
* Have discovered a problem with using the MAX() function
* on columns of type char(1)
* only an issue when used in an inner select
* solution (see test 4)
CREATE TABLE SQL_BUG_TEST
X NUMBER,
Y NUMBER,
Z CHAR(1)
INSERT INTO SQL_BUG_TEST (X, Y, Z)
VALUES (1,1,'A');
INSERT INTO SQL_BUG_TEST (X, Y, Z)
VALUES (1,1,'B');
INSERT INTO SQL_BUG_TEST (X, Y, Z)
VALUES (1,2,'C');
INSERT INTO SQL_BUG_TEST (X, Y, Z)
VALUES (1,2,'D');
DECLARE
TYPE REC IS RECORD (
x SQL_BUG_TEST.X%TYPE,
y SQL_BUG_TEST.Y%TYPE,
z SQL_BUG_TEST.Z%TYPE
v_rec REC;
BEGIN
-- DISPLAY THE TABLE DATA
BEGIN
DBMS_OUTPUT.PUT_LINE('TABLE DATA:');
DBMS_OUTPUT.PUT_LINE('');
DBMS_OUTPUT.PUT_LINE('SELECT * FROM SQL_BUG_TEST ORDER BY X,Y,Z;');
FOR crs IN (SELECT *
FROM SQL_BUG_TEST
ORDER BY X,Y,Z) LOOP
DBMS_OUTPUT.PUT_LINE(':'||crs.X||':'||crs.Y||':'||crs.Z);
END LOOP;
EXCEPTION WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
-- TEST 1
-- returning result from MAX into a variable when the MAX is in the outer most select
-- does not cause an error
BEGIN
DBMS_OUTPUT.PUT_LINE('*****************************************************');
DBMS_OUTPUT.PUT_LINE('TEST 1');
DBMS_OUTPUT.PUT_LINE('');
DBMS_OUTPUT.PUT_LINE('SELECT X, Y, MAX(Z) Z');
DBMS_OUTPUT.PUT_LINE('FROM SQL_BUG_TEST');
DBMS_OUTPUT.PUT_LINE('GROUP BY X,Y');
FOR crs IN (SELECT X, Y, MAX(Z) Z
FROM SQL_BUG_TEST
GROUP BY X, Y
ORDER BY X,Y,Z) LOOP
DBMS_OUTPUT.PUT_LINE(':'||crs.X||':'||crs.Y||':'||crs.Z);
END LOOP;
EXCEPTION WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
-- TEST 2
-- returning MAX() from an inner select to an outer select and then into a variable
-- causes an error
BEGIN
DBMS_OUTPUT.PUT_LINE('*****************************************************');
DBMS_OUTPUT.PUT_LINE('TEST 2');
DBMS_OUTPUT.PUT_LINE('THIS DID NOT CAUSE AN ERROR WITH ORACLE 9i');
DBMS_OUTPUT.PUT_LINE('');
DBMS_OUTPUT.PUT_LINE('SELECT * INTO v_rec');
DBMS_OUTPUT.PUT_LINE('FROM');
DBMS_OUTPUT.PUT_LINE('(SELECT X, Y, MAX(Z) Z');
DBMS_OUTPUT.PUT_LINE('FROM SQL_BUG_TEST');
DBMS_OUTPUT.PUT_LINE('GROUP BY X,Y)');
DBMS_OUTPUT.PUT_LINE('WHERE Y = 1');
SELECT * INTO v_rec
FROM
(SELECT X, Y, MAX(Z) Z
FROM SQL_BUG_TEST
GROUP BY X, Y)
WHERE Y = 1;
DBMS_OUTPUT.PUT_LINE(':'||v_rec.X||':'||v_rec.Y||':'||v_rec.Z);
EXCEPTION WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
-- TEST 3
-- casting the result from MAX to char before returning to the outer select
-- still causes an error
BEGIN
DBMS_OUTPUT.PUT_LINE('*****************************************************');
DBMS_OUTPUT.PUT_LINE('TEST 3');
DBMS_OUTPUT.PUT_LINE('');
DBMS_OUTPUT.PUT_LINE('SELECT * INTO v_rec');
DBMS_OUTPUT.PUT_LINE('FROM');
DBMS_OUTPUT.PUT_LINE('(SELECT X, Y, to_char(MAX(Z)) Z');
DBMS_OUTPUT.PUT_LINE('FROM SQL_BUG_TEST');
DBMS_OUTPUT.PUT_LINE('GROUP BY X,Y)');
DBMS_OUTPUT.PUT_LINE('WHERE Y = 1');
SELECT * INTO v_rec
FROM
(SELECT X, Y, to_char(MAX(Z)) Z
FROM SQL_BUG_TEST
GROUP BY X, Y)
WHERE Y = 1;
DBMS_OUTPUT.PUT_LINE(':'||v_rec.X||':'||v_rec.Y||':'||v_rec.Z);
EXCEPTION WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
-- TEST 4 - SOLUTION
-- the return value of MAX must be cast with to_char at the point where it is assigned to
-- variable (outer most select)
BEGIN
DBMS_OUTPUT.PUT_LINE('*****************************************************');
DBMS_OUTPUT.PUT_LINE('TEST 4 SOLUTION');
DBMS_OUTPUT.PUT_LINE('');
DBMS_OUTPUT.PUT_LINE('SELECT X, Y, TO_CHAR(Z) Z INTO v_rec');
DBMS_OUTPUT.PUT_LINE('FROM');
DBMS_OUTPUT.PUT_LINE('(SELECT X, Y, MAX(Z) Z');
DBMS_OUTPUT.PUT_LINE('FROM SQL_BUG_TEST');
DBMS_OUTPUT.PUT_LINE('GROUP BY X,Y)');
DBMS_OUTPUT.PUT_LINE('WHERE Y = 1');
SELECT X, Y, TO_CHAR(Z) Z INTO v_rec
FROM
(SELECT X, Y, MAX(Z) Z
FROM SQL_BUG_TEST
GROUP BY X, Y)
WHERE Y = 1;
DBMS_OUTPUT.PUT_LINE(':'||v_rec.X||':'||v_rec.Y||':'||v_rec.Z);
EXCEPTION WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
END;I certainly looks like a bug, but you should raise an iTAR on Metalink since Oracle does not monitor this forum.
I was able to replicate your results on my 10.2.0.1 database.
There is an easier workaround than yours. Try
ALTER TABLE sql_bug_test MODIFY (z VARCHAR2(1));That seems to eliminate the problem on my instance.
John -
How to Avoid Errors in Max Function When Data Contains Blank Cells
I have a column with duration values. However, it also contains some blank cells. These "blank cells" have formulas in them, but as the cells they reference too are blank the formula doesn't produce a result.>/p>
I want to get the max value from this column. When I simply do =MAX(column-name) I get an error, presumably because some of the cells are blank. This table is going to be highly dynamic, so I don't want to limit the range of the MAX() function to only those cells with values.
So does anyone know a solution for this, please? If I was some how able to create a formula which returned the range of cells with actual values, then I could use that in the MAX() function. Or, if I could somehow tell the MAX() function to ignore blank cells, but I'm not sure either of these are possible.
Thanks,
NicI don't see a problem with "blank" (null string) cells mixed with duration cells. MAX works fine with this mix of cells. But if the "blank" cells are numbers, not text, that gives an error.
A formula always produces a result. A formula cannot result in a blank cell. The closest you can get to "blank" is a null string (the result of two quotes next to each other with nothing between them) . So the question is, what is the result that you are calling "blank"? -
Hi Everyone,
Am aware of the following flavors of MAX function
1) choose MAX from the folders/fields list (selected items tab)
2) create calculation using: MAX keep dense
3) create calculation using: MAX analytic function
questions, pls:
===========
a) with MAX regular, MAX keep dense, MAX - analytic function
is it necessary to sort it using tools/sort - choose fields to sort by?
or does the data get sorted due to the ORDER BY clause in MAX used in a calculation
b) how to understand the diff. bet. MAX keep dense and MAX - analytic function
1) i understand that analytic functions are applied after detail row processing
does MAX keep dense calculation happen during detail row processing?
2) how did you know to advise when to use MAX keep dense, and when to use MAX - analytic function?
tx for your ideas and assistance, sandraHi,
a) with MAX regular, MAX keep dense, MAX - analytic function is it necessary to sort it using tools/sort - choose fields to sort by? or does the data get sorted due to the ORDER BY clause in MAX used in a calculationIt is only necessary to use a sort if you want to have the rows returned in a specific order. The order by in the max calculation defines the maximum within the group or window. It may affect the order the rows are returned, but if it does this is not guaranteed and you should use a sort on the main query.
b) how to understand the diff. bet. MAX keep dense and MAX - analytic function
1) i understand that analytic functions are applied after detail row processing does MAX keep dense calculation happen during detail row processing?Yes
2) how did you know to advise when to use MAX keep dense, and when to use MAX - analytic function?In general, if you want the result on a single row, so you have one row for each group then you should use the aggregate max. If you want to use the same max on all the rows in the window (defined by the partition) then use the analytic max.
Rod West -
Using max function in PL/SQL
VERY URGENT...
Am new to oracle...
I've written a package that display gif images in form of histogram/bar chart. using html,
I need to use max function to display values proportionately.
please help. i need to complete this assignment by 2/9/00 by 10.00 am at the latest. I've half written a function but I don't know if there's a simpler way fo doing this. html enabledFirst of all Thanks to all gentlemen who replied ..many thanks ...
Tried the ROW_NUMBER() option but still it is taking time...have given output for the query and tkprof results as well. Even when it doesn't fetch any record ( this is a valid cased because the input header id doesn't have any workflow request submitted & hence no entry in the wf_items table)..then also see the time it has taken.
Looked at the RANK & DENSE_RANK options which were suggested..but it is still taking time..
Any further suggestions or ideas as to how this could be resolved..
SELECT 'Y', 'Y', ITEM_KEY
FROM
( SELECT ITEM_KEY, ROW_NUMBER() OVER(ORDER BY BEGIN_DATE DESC) RN FROM
WF_ITEMS WHERE ITEM_TYPE = 'xxxxzzzz' AND ROOT_ACTIVITY = 'START_REQUESTS'
AND SUBSTR(ITEM_KEY,1,INSTR(ITEM_KEY,'-') - 1) = :B1
) T WHERE RN <= 1
call count cpu elapsed disk query current rows
Parse 0 0.00 0.00 0 0 0 0
Execute 1 0.00 1.57 0 0 0 0
Fetch 1 8700.00 544968.73 8180 8185 0 0
total 2 8700.00 544970.30 8180 8185 0 0
many thanks -
Regarding MAX() function
Hi,
I am having table A. I have few records in the table A. Database version : 9.2
ID name deleted
2 XYZ N
3 ABD N
4 GJK N
5 GJK N
6 HGY N
7 YJG N
8 PIN N
9 BMF N
10 OLG N
I used the following query...
SELECT MAX(ID) FROM A WHERE DELETED='N';
It was worked fine until now....
Now i used the same query...
But the result is
MAX(ID)
9
Please help me... What is the reason?
I want the correct result...
Thanks in advance....Kamran Agayev A. wrote:
Yes you can use TO_NUMBER inside MAX function and it will not give any error in the futureHave you tested it?
SQL> create table a (id,name,deleted)
2 as
3 select '2', 'XYZ', 'N' from dual union all
4 select '3', 'ABD', 'N' from dual union all
5 select '4', 'GJK', 'N' from dual union all
6 select '5', 'GJK', 'N' from dual union all
7 select '6', 'HGY', 'N' from dual union all
8 select '7', 'YJG', 'N' from dual union all
9 select '8', 'PIN', 'N' from dual union all
10 select '9', 'BMF', 'N' from dual union all
11 select '10', 'OLG', 'N' from dual
12 /
Tabel is aangemaakt.
SQL> select max(id)
2 from a
3 where deleted = 'N'
4 /
MA
9
1 rij is geselecteerd.
SQL> select max(to_number(id))
2 from a
3 where deleted = 'N'
4 /
MAX(TO_NUMBER(ID))
10
1 rij is geselecteerd.
SQL> insert into a values ('2A', 'ABC', 'N')
2 /
1 rij is aangemaakt.
SQL> select max(to_number(id))
2 from a
3 where deleted = 'N'
4 /
select max(to_number(id))
FOUT in regel 1:
.ORA-01722: invalid numberRegards,
Rob. -
Hi,
I am using parent-child hierarchy and in my reports I want to show Max(hierarchy_level). When I use the function MAX directly in the report it works fine in every way. But I want to have this kind of column in the BI Server presentation catalog so the user does not need to add MAX in Analysis/Answers (this is 11g). Normally this would imply a Max(hierarchy_level) as a logical function, but in the BI Server it is not allowed with MAX function in the logical function so it does not work.
The hierarchy level is just a column from a dimension table and creating it as a fact column is not a very good solution. I also tried to solve this in many different ways, but only the MAX funtion in Analysis/Answers allways give the correct result. Used in combination with other dimensions etc. I want the exact same behaviour as I get when using MAX in analysis.
Any good ideas to solve this? Is there another function in the BI Server that works the same way as MAX ?Very often, about a primary key, see for example our italian accounting application (our VAT invoices:fatture IVA) ), where the holes might be a problem.
Yes Rosario, of course I know that, and that's why I said "in this scenario" : if primary key is the only purpose, I don't think holes could be a problem.
Buona giornata anche a te. -
Using Javascript Functions with Flash 8
I wanted to know how to integrate Javascript functions with
Flash 8 created swf files. I assume this would be done using
ActionScript, I know some ActionScript but am not as familiar with
it as to be able to integrate other programming languages with it.
I'd like to be able to call other programming language functions
with my swf files.
The particular case I'm working on now is to be able to open
Pop-Up windows for display of web items from within links written
in ActionScript in a swf file. In other words, have the user click
a link in a Flash movie and open a window using a Javascript
window.open function that would be called. I would like the window
to contain more flash movies that contained further links to
functions. If any one could offer up some advice or point me to a
few tutorials and how tos on how to get the Flash part of this done
I'd appreciate it.
In a broader scope, a seemless workflow linking Flash output
files to outside scripting and programming functions would be nice
to know if anyone has links or input on where I can read up on
this.
ThanksmyButton.onRelease = function () {
getURL("javascript:myFunc('myVars')");
} -
Use of MAX function in Query Designer
Dear all,
i want to create a report that gives ONE line per period that holds the MAX of several lines per period. So NO addition of the KF but just one line item.
I tried to use the MAX function and/or MAX drop-down boxes via properties on KF,
but they all provide the wrong result (mostly the MAX after summaction of the KF).
Any ideas ??
Greetz,
HermanHi Herman
Please check the KF infoobject property which might have been set to Summation. You need to change the property of the KF to MAX if you wish to have MAX value.
Hope this might be helpful to you
Thanks
Kishore Kusupati -
How to use MAX function in SSAS MDX Query
I want to run this Query with MAX Condition on LAST_DATA_UPDATE Column .
Hi Ashishsingh,
According to your description, you want to know how to use MAX function in SQL Server Analysis Services MDX Query, right? In this case, please refer to the link below which describe the syntax and sample of MDX function.
http://technet.microsoft.com/en-us/library/ms145601.aspx
http://www.mdxpert.com/Functions/MDXFunction.aspx?f=64
Hope this helps.
Regards,
Charlie Liao
TechNet Community Support -
Oracle:how to use max() function in case expression
how to use max() function in case expression, Please explain with any example
Hope this helps and should be self explanatory
with t as
(select 1 col,100 col2 from dual union
select 2 ,100 from dual union
select 2 ,200 from dual union
select 3,100 from dual union
select 3,200 from dual )
select col, case when max(col2)=100 then 'with 100 range'
when max(col2)=200 then 'with 200 range' end from t group by col -
How to use MAX() function with date field
Hi Frzz,
I have created a Graphical calculation view in which i have multiple records for each employee with different dates. But my requirement is to take the records which have maximum date.
I have converted the date into Integer and applied the MAX() function. But still am getting multiple records.
Is there is any other way we can achieve this requirement in Graphical Calculation view?? Your suggestion will really help me.
Thank you.
Krishna.Hmm... what have you tried out so far?
Look, I took the effort and created a little example, just for you
Assume we have a table that contains the logon dates of users.
Every line contains the logon date and some info on the user.
Very much like a not-normalized log file could look like.
Now, the output we want is: one line per user with the most current logon time.
Not too difficult:
1. Have a aggregation node that gives you the distinct user details - one line for every user:
2. Have another aggregation node that gives you the last (MAX) logon date per user:
Finally you do a 1:1 join on the USER_ID and map the result to the output.
Easy as pie
- Lars -
Use COUNT or MAX functions inside of a query, and you have no data found
I'm writing a query with a COUNT and a MAX function.
SELECT li.id
, MAX(m.display_date)
, COUNT(*)
FROM li JOIN m ON (m.LIID=li.LIID)
WHERE m.DISPLAY_DATE < SYSDATE - 7
GROUP BY li.id;I would like to write a query that returns always a row foe each row in the table li.
If there are no records with the condition "WHERE m.DISPLAY_DATE < SYSDATE - 7", I would like to have a row with
- COUNT(*) = 0
- MAX(m.display_date) = TO_DATE('2010-06-08', 'YYYY-MM-DD'user600979 wrote:
I'm writing a query with a COUNT and a MAX function.
SELECT li.id
, MAX(m.display_date)
, COUNT(*)
FROM li JOIN m ON (m.LIID=li.LIID)
WHERE m.DISPLAY_DATE < SYSDATE - 7
GROUP BY li.id;I would like to write a query that returns always a row foe each row in the table li.
If there are no records with the condition "WHERE m.DISPLAY_DATE < SYSDATE - 7", I would like to have a row with
- COUNT(*) = 0
- MAX(m.display_date) = TO_DATE('2010-06-08', 'YYYY-MM-DD'In that case tell me what do you want to display in the ID column. That is the first column? -
In Flash (CS3), I would like to replace the comma in my
Database data with a
return (my data is being returned comma delimited and it is
causing issues
with functions in Flash). I can't seem to figure it out in
Flash though.
From the help, I have tried to use the RedExp function but I
keep getting an
error saying: "The class or interface 'RegExp' could not be
loaded.
Any help would be greatly appreciated.
DaveCan you be more specific? Are you copy/replacing code? Text in TextFields? Other?
-
Using Max Function in View Criteria
Hi
I am having a requirement where by i need to make use of max function in view criteria but not able to see any such option. Can someone please help me over it. Here is the requirement.
In table i will be having multiple rows for an employee and i need to pick latest row based on a column say request_id For e.g.
Emp RequestId
A 1
A 2
A 3
A 4
So if i pass the employee id i should get Row Number 4. In simple SQL language I want something like this
select * from emp where empid=A and requestid=( select max(requestid) from emp where empid=A)
Just wanted to know is there any approach that i can use to do all this as part of View Criteria or any other way.
Any help is appreciated!!!
Thanks
AJOne way is this -
1)https://blogs.oracle.com/adf/entry/using_groovy_aggregate_functions_in (You might need to create a self-referencing VL for this , try if it works using a ViewAccessor too)
OR
Order by RequestId descending in your SQL for the VO if thats ok , then have the ViewCriteria for the EmpId and programmatically pickup the first row...
Maybe you are looking for
-
I've imported 3 cd's to my iTunes, but they continue to be "grey-ed out" with a dotted grey circle in front of them. The music will not sync to my iPhone. How do I get iTunes to recognize them so that they will sync?
-
Dvi to vga converter not working anywhere
Hi guys, recently my lcd screen went completely black, the macbook pro (from 2007) still turns on and still makes sounds, but the screen is completely black. i need to save important info so i used the dvi to vga adapter (not the mini one but the one
-
FIFO based pricing issue on sales orders!
This is the situations : All setups in the comany are for FIFO. Item Level, Item Group Level, and Company Level. 1. We purchased 1 item1 for 125 dollars. PO invoice completed. First one in FIFO layer. 2. purchased 1 more of same item1 for 150 dollar
-
How to set values of a parameterized message in ADF Faces?
Hi all, i've got the following problem: I want to set the values of a parameterized message before i add the message to the FacesContext. Contents of the message resource bundle: testPage.successMsg.create=The device {0} was created successfully! Cod
-
How to change key on runtime form in application server
How it is possible reconfigure key on froms in application server ???? List Values on Client = key "F9" List values on Application = key "CTRL + L" and so on..... can j have the same on client version like apllication ??? Thank You !!