[0.8] Array.max and Array.min

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[0.8] Array.max and Array.min

Krycek
Hi,

I was trying to use qx.lang.Array.max and it is not doing what I want. Looking at the code, those 2 functions use statics values from Number class:

var result = Number.MIN_VALUE; (for max method) and
var result = Number.MAX_VALUE; (for min method)

so, if an array has [ 0 ] (or a negative value), it should return "0" that is my highest value, shouldn't it? but it return Number.MIN_VALUE (5e-324) that doesn't even is in the array.

I guess it should use Number.NEGATIVE_INFINITY and Number.POSITIVE_INFINITY



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: [0.8] Array.max and Array.min

Petr Kobalíček
Hmm, If array hasn't values, shouldn't it result null or undefined
instead of 0 ?

2008/8/13 Guilherme Aiolfi <[hidden email]>:

> Hi,
>
> I was trying to use qx.lang.Array.max and it is not doing what I want.
> Looking at the code, those 2 functions use statics values from Number class:
>
> var result = Number.MIN_VALUE; (for max method) and
> var result = Number.MAX_VALUE; (for min method)
>
> so, if an array has [ 0 ] (or a negative value), it should return "0" that
> is my highest value, shouldn't it? but it return Number.MIN_VALUE (5e-324)
> that doesn't even is in the array.
>
> I guess it should use Number.NEGATIVE_INFINITY and Number.POSITIVE_INFINITY
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: [0.8] Array.max and Array.min

Krycek
but [ 0 ] has values. But that's is another problem, before return "result" it should do a test. Here is "max" function the way I think it should be:

    max : function(arr)
    {
      var result = Number.NEGATIVE_INFINITY;

      for (var i=0, l=arr.length; i<l; i++)
      {
        if (arr[i] > result) {
          result = arr[i];
        }
      }

      return result == Number.NEGATIVE_INFINITY? null : result;
    }

if arr.length is 0, returns null.

2008/8/13 Petr Kobalíček <[hidden email]>
Hmm, If array hasn't values, shouldn't it result null or undefined
instead of 0 ?

2008/8/13 Guilherme Aiolfi <[hidden email]>:
> Hi,
>
> I was trying to use qx.lang.Array.max and it is not doing what I want.
> Looking at the code, those 2 functions use statics values from Number class:
>
> var result = Number.MIN_VALUE; (for max method) and
> var result = Number.MAX_VALUE; (for min method)
>
> so, if an array has [ 0 ] (or a negative value), it should return "0" that
> is my highest value, shouldn't it? but it return Number.MIN_VALUE (5e-324)
> that doesn't even is in the array.
>
> I guess it should use Number.NEGATIVE_INFINITY and Number.POSITIVE_INFINITY
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: [0.8] Array.max and Array.min

Petr Kobalíček
Hi Guilherme,

I have another way :-)

    max : function(arr)
    {
      var i, len=arr.length, result = arr[0];
      for (i = 1; i < len; i++) if (arr[i] > result) result = arr[i];
      return result;
    }

    min : function(arr)
    {
      var i, len=arr.length, result = arr[0];
      for (i = 1; i < len; i++) if (arr[i] < result) result = arr[i];
      return result;
    }

arr[0] will give undefined if arrray length is zero and for loop will
be never executed. This code is my current thinking, not tested but
should work:)

2008/8/13 Guilherme Aiolfi <[hidden email]>:

> but [ 0 ] has values. But that's is another problem, before return "result"
> it should do a test. Here is "max" function the way I think it should be:
>
>     max : function(arr)
>     {
>       var result = Number.NEGATIVE_INFINITY;
>
>       for (var i=0, l=arr.length; i<l; i++)
>       {
>         if (arr[i] > result) {
>           result = arr[i];
>         }
>       }
>
>       return result == Number.NEGATIVE_INFINITY? null : result;
>     }
>
> if arr.length is 0, returns null.
>
> 2008/8/13 Petr Kobalíček <[hidden email]>
>>
>> Hmm, If array hasn't values, shouldn't it result null or undefined
>> instead of 0 ?
>>
>> 2008/8/13 Guilherme Aiolfi <[hidden email]>:
>> > Hi,
>> >
>> > I was trying to use qx.lang.Array.max and it is not doing what I want.
>> > Looking at the code, those 2 functions use statics values from Number
>> > class:
>> >
>> > var result = Number.MIN_VALUE; (for max method) and
>> > var result = Number.MAX_VALUE; (for min method)
>> >
>> > so, if an array has [ 0 ] (or a negative value), it should return "0"
>> > that
>> > is my highest value, shouldn't it? but it return Number.MIN_VALUE
>> > (5e-324)
>> > that doesn't even is in the array.
>> >
>> > I guess it should use Number.NEGATIVE_INFINITY and
>> > Number.POSITIVE_INFINITY
>> >
>> >
>> >
>> >
>> > -------------------------------------------------------------------------
>> > This SF.Net email is sponsored by the Moblin Your Move Developer's
>> > challenge
>> > Build the coolest Linux based applications with Moblin SDK & win great
>> > prizes
>> > Grand prize is a trip for two to an Open Source event anywhere in the
>> > world
>> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> > _______________________________________________
>> > qooxdoo-devel mailing list
>> > [hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>> >
>> >
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
>> world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: [0.8] Array.max and Array.min

Fabian Jakobs
Administrator
Petr Kobalíček schrieb:

> Hi Guilherme,
>
> I have another way :-)
>
>     max : function(arr)
>     {
>       var i, len=arr.length, result = arr[0];
>       for (i = 1; i < len; i++) if (arr[i] > result) result = arr[i];
>       return result;
>     }
>
>     min : function(arr)
>     {
>       var i, len=arr.length, result = arr[0];
>       for (i = 1; i < len; i++) if (arr[i] < result) result = arr[i];
>       return result;
>     }
>
> arr[0] will give undefined if arrray length is zero and for loop will
> be never executed. This code is my current thinking, not tested but
> should work:)
>  

Hi Petr,

could you open a bug report for this. This should definitively be fixed
in the framework.

Best Fabian

--
Fabian Jakobs
JavaScript Framework Developer

1&1 Internet AG
Brauerstraße 48
76135 Karlsruhe

Amtsgericht Montabaur HRB 6484

Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas Gottschlich, Matthias Greve, Robert Hoffmann, Markus Huhn, Oliver Mauss, Achim Weiss
Aufsichtsratsvorsitzender: Michael Scheeren


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: [0.8] Array.max and Array.min

Petr Kobalíček
Yes, it's #1171

2008/8/14 Fabian Jakobs <[hidden email]>:

> Petr Kobalíček schrieb:
>> Hi Guilherme,
>>
>> I have another way :-)
>>
>>     max : function(arr)
>>     {
>>       var i, len=arr.length, result = arr[0];
>>       for (i = 1; i < len; i++) if (arr[i] > result) result = arr[i];
>>       return result;
>>     }
>>
>>     min : function(arr)
>>     {
>>       var i, len=arr.length, result = arr[0];
>>       for (i = 1; i < len; i++) if (arr[i] < result) result = arr[i];
>>       return result;
>>     }
>>
>> arr[0] will give undefined if arrray length is zero and for loop will
>> be never executed. This code is my current thinking, not tested but
>> should work:)
>>
>
> Hi Petr,
>
> could you open a bug report for this. This should definitively be fixed
> in the framework.
>
> Best Fabian
>
> --
> Fabian Jakobs
> JavaScript Framework Developer
>
> 1&1 Internet AG
> Brauerstraße 48
> 76135 Karlsruhe
>
> Amtsgericht Montabaur HRB 6484
>
> Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas Gottschlich, Matthias Greve, Robert Hoffmann, Markus Huhn, Oliver Mauss, Achim Weiss
> Aufsichtsratsvorsitzender: Michael Scheeren
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: [0.8] Array.max and Array.min

Fabian Jakobs
Administrator
Petr Kobalíček schrieb:
> Yes, it's #1171
>  
thank you

> 2008/8/14 Fabian Jakobs <[hidden email]>:
>  
>> Petr Kobalíček schrieb:
>>    
>>> Hi Guilherme,
>>>
>>> I have another way :-)
>>>
>>>     max : function(arr)
>>>     {
>>>       var i, len=arr.length, result = arr[0];
>>>       for (i = 1; i < len; i++) if (arr[i] > result) result = arr[i];
>>>       return result;
>>>     }
>>>
>>>     min : function(arr)
>>>     {
>>>       var i, len=arr.length, result = arr[0];
>>>       for (i = 1; i < len; i++) if (arr[i] < result) result = arr[i];
>>>       return result;
>>>     }
>>>
>>> arr[0] will give undefined if arrray length is zero and for loop will
>>> be never executed. This code is my current thinking, not tested but
>>> should work:)
>>>
>>>      
>> Hi Petr,
>>
>> could you open a bug report for this. This should definitively be fixed
>> in the framework.
>>
>> Best Fabian
>>
>> --
>> Fabian Jakobs
>> JavaScript Framework Developer
>>
>> 1&1 Internet AG
>> Brauerstraße 48
>> 76135 Karlsruhe
>>
>> Amtsgericht Montabaur HRB 6484
>>
>> Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas Gottschlich, Matthias Greve, Robert Hoffmann, Markus Huhn, Oliver Mauss, Achim Weiss
>> Aufsichtsratsvorsitzender: Michael Scheeren
>>
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>    
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>  


--
Fabian Jakobs
JavaScript Framework Developer

1&1 Internet AG
Brauerstraße 48
76135 Karlsruhe

Amtsgericht Montabaur HRB 6484

Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas Gottschlich, Matthias Greve, Robert Hoffmann, Markus Huhn, Oliver Mauss, Achim Weiss
Aufsichtsratsvorsitzender: Michael Scheeren


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: [0.8] Array.max and Array.min

Petr Kobalíček
Sorry for opening this topic (I noticed accepted bug in bugzilla and I
don't know how to add comment there)

This is small test case how browsers works:

// TEST 1
var arr = [1, 2, 3, 4];

arr.length = 0;
alert(arr[0]); // undefined

// TEST 2
var arr = {};
arr.length = 3;
arr[0] = 1;

arr.length = 0;
alert(arr[0]); // 1

I don't know if there are incompatibilities between browsers. My
implementation of min and max depends on TEST1. If there are browsers
that will return different value than 'undefined' in TEST1 then my
approach is wrong. So, if anybody use object in min and max, the
result is undefined and I think it's correct.

I tested my functions and I think it's correct, generic and fast. For
example input can be also array of strings (but I don't know usability
of that:) )

Cheers
- Petr

2008/8/14 Fabian Jakobs <[hidden email]>:

> Petr Kobalíček schrieb:
>> Yes, it's #1171
>>
> thank you
>
>> 2008/8/14 Fabian Jakobs <[hidden email]>:
>>
>>> Petr Kobalíček schrieb:
>>>
>>>> Hi Guilherme,
>>>>
>>>> I have another way :-)
>>>>
>>>>     max : function(arr)
>>>>     {
>>>>       var i, len=arr.length, result = arr[0];
>>>>       for (i = 1; i < len; i++) if (arr[i] > result) result = arr[i];
>>>>       return result;
>>>>     }
>>>>
>>>>     min : function(arr)
>>>>     {
>>>>       var i, len=arr.length, result = arr[0];
>>>>       for (i = 1; i < len; i++) if (arr[i] < result) result = arr[i];
>>>>       return result;
>>>>     }
>>>>
>>>> arr[0] will give undefined if arrray length is zero and for loop will
>>>> be never executed. This code is my current thinking, not tested but
>>>> should work:)
>>>>
>>>>
>>> Hi Petr,
>>>
>>> could you open a bug report for this. This should definitively be fixed
>>> in the framework.
>>>
>>> Best Fabian
>>>
>>> --
>>> Fabian Jakobs
>>> JavaScript Framework Developer
>>>
>>> 1&1 Internet AG
>>> Brauerstraße 48
>>> 76135 Karlsruhe
>>>
>>> Amtsgericht Montabaur HRB 6484
>>>
>>> Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas Gottschlich, Matthias Greve, Robert Hoffmann, Markus Huhn, Oliver Mauss, Achim Weiss
>>> Aufsichtsratsvorsitzender: Michael Scheeren
>>>
>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> qooxdoo-devel mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>
>>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>
>>
>
>
> --
> Fabian Jakobs
> JavaScript Framework Developer
>
> 1&1 Internet AG
> Brauerstraße 48
> 76135 Karlsruhe
>
> Amtsgericht Montabaur HRB 6484
>
> Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas Gottschlich, Matthias Greve, Robert Hoffmann, Markus Huhn, Oliver Mauss, Achim Weiss
> Aufsichtsratsvorsitzender: Michael Scheeren
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: [0.8] Array.max and Array.min

Fabian Jakobs
Administrator
Petr Kobalíček schrieb:
> Sorry for opening this topic (I noticed accepted bug in bugzilla and I
> don't know how to add comment there)
>  
You need to be logged in to comment on bugs. You can create an account
here: <http://bugzilla.qooxdoo.org/createaccount.cgi>

It would be great if you could post this mail as comment to the bug
because otherwise the risk is there that this information is lost.

Best Fabian


> This is small test case how browsers works:
>
> // TEST 1
> var arr = [1, 2, 3, 4];
>
> arr.length = 0;
> alert(arr[0]); // undefined
>
> // TEST 2
> var arr = {};
> arr.length = 3;
> arr[0] = 1;
>
> arr.length = 0;
> alert(arr[0]); // 1
>
> I don't know if there are incompatibilities between browsers. My
> implementation of min and max depends on TEST1. If there are browsers
> that will return different value than 'undefined' in TEST1 then my
> approach is wrong. So, if anybody use object in min and max, the
> result is undefined and I think it's correct.
>
> I tested my functions and I think it's correct, generic and fast. For
> example input can be also array of strings (but I don't know usability
> of that:) )
>
> Cheers
> - Petr
>
> 2008/8/14 Fabian Jakobs <[hidden email]>:
>  
>> Petr Kobalíček schrieb:
>>    
>>> Yes, it's #1171
>>>
>>>      
>> thank you
>>
>>    
>>> 2008/8/14 Fabian Jakobs <[hidden email]>:
>>>
>>>      
>>>> Petr Kobalíček schrieb:
>>>>
>>>>        
>>>>> Hi Guilherme,
>>>>>
>>>>> I have another way :-)
>>>>>
>>>>>     max : function(arr)
>>>>>     {
>>>>>       var i, len=arr.length, result = arr[0];
>>>>>       for (i = 1; i < len; i++) if (arr[i] > result) result = arr[i];
>>>>>       return result;
>>>>>     }
>>>>>
>>>>>     min : function(arr)
>>>>>     {
>>>>>       var i, len=arr.length, result = arr[0];
>>>>>       for (i = 1; i < len; i++) if (arr[i] < result) result = arr[i];
>>>>>       return result;
>>>>>     }
>>>>>
>>>>> arr[0] will give undefined if arrray length is zero and for loop will
>>>>> be never executed. This code is my current thinking, not tested but
>>>>> should work:)
>>>>>
>>>>>
>>>>>          
>>>> Hi Petr,
>>>>
>>>> could you open a bug report for this. This should definitively be fixed
>>>> in the framework.
>>>>
>>>> Best Fabian
>>>>
>>>> --
>>>> Fabian Jakobs
>>>> JavaScript Framework Developer
>>>>
>>>> 1&1 Internet AG
>>>> Brauerstraße 48
>>>> 76135 Karlsruhe
>>>>
>>>> Amtsgericht Montabaur HRB 6484
>>>>
>>>> Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas Gottschlich, Matthias Greve, Robert Hoffmann, Markus Huhn, Oliver Mauss, Achim Weiss
>>>> Aufsichtsratsvorsitzender: Michael Scheeren
>>>>
>>>>
>>>> -------------------------------------------------------------------------
>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>>>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>>>> Grand prize is a trip for two to an Open Source event anywhere in the world
>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>> _______________________________________________
>>>> qooxdoo-devel mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>>
>>>>
>>>>        
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> qooxdoo-devel mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>
>>>
>>>
>>>      
>> --
>> Fabian Jakobs
>> JavaScript Framework Developer
>>
>> 1&1 Internet AG
>> Brauerstraße 48
>> 76135 Karlsruhe
>>
>> Amtsgericht Montabaur HRB 6484
>>
>> Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas Gottschlich, Matthias Greve, Robert Hoffmann, Markus Huhn, Oliver Mauss, Achim Weiss
>> Aufsichtsratsvorsitzender: Michael Scheeren
>>
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>    
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>  


--
Fabian Jakobs
JavaScript Framework Developer

1&1 Internet AG
Brauerstraße 48
76135 Karlsruhe

Amtsgericht Montabaur HRB 6484

Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas Gottschlich, Matthias Greve, Robert Hoffmann, Markus Huhn, Oliver Mauss, Achim Weiss
Aufsichtsratsvorsitzender: Michael Scheeren


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel