RE: collection.min() Returns Null

2018-07-27 Thread Stephen J. Orth via 4D_Tech
Mr. Cannon,

Thanks, it's just weird as it's been happening for several days now, and it
not every message.  Each day it is a selective message the comes in many
times.

I don't get the digest, I receive individual emails.  It almost seems like
one email is getting stuck and Outlook thinks it never downloaded the
message.


Steve

-Original Message-
From: Cannon Smith [mailto:can...@synergyfarmsolutions.com] 
Sent: Friday, July 27, 2018 8:00 AM
To: s.o...@the-aquila-group.com; 4D iNug Technical <4d_tech@lists.4d.com>
Subject: Re: collection.min() Returns Null

Hi Steve,

FWIW, I'm only getting one copy of each message.

--
Cannon Smith


**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: collection.min() Returns Null

2018-07-27 Thread Cannon Smith via 4D_Tech
Hi Steve,

FWIW, I'm only getting one copy of each message.

--
Cannon Smith

> On Jul 27, 2018, at 5:51 AM, Stephen J. Orth via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> For the past few days I'm getting multiples of the same message, over and 
> over.  Today I received like 15 copies of this message.  Yesterday it was a 
> response from Jeff Kain.
> 
> Is this happening to anyone else?

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: collection.min() Returns Null

2018-07-27 Thread Stephen J. Orth via 4D_Tech
For the past few days I'm getting multiples of the same message, over and over. 
 Today I received like 15 copies of this message.  Yesterday it was a response 
from Jeff Kain.

Is this happening to anyone else?


Steve

-Original Message-
From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Cannon Smith 
via 4D_Tech
Sent: Thursday, July 26, 2018 8:12 PM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Cc: Cannon Smith 
Subject: Re: collection.min() Returns Null

Hi Miyako,

Perfect! Thanks, that makes sense and works well.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Jul 26, 2018, at 3:27 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> in your case, you could do something like
> 
> $cTest:=$cTest..filter("remove_null")
> 
> where the project method remove_null is
> 
> C_OBJECT($1)
> 
> $1.result:=($1.value#Null)
> 

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: collection.min() Returns Null

2018-07-26 Thread Cannon Smith via 4D_Tech
Hi Miyako,

Perfect! Thanks, that makes sense and works well.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Jul 26, 2018, at 3:27 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> in your case, you could do something like
> 
> $cTest:=$cTest..filter("remove_null")
> 
> where the project method remove_null is
> 
> C_OBJECT($1)
> 
> $1.result:=($1.value#Null)
> 

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: collection.min() Returns Null

2018-07-26 Thread Keisuke Miyako via 4D_Tech
one thing to keep in mind is that this (rules on sorting) does not apply to 
count() or average()

- count does NOT count null, object, collection

the doc. says that the method only counts  "non-null" values. non-null does not 
include object or collection

- average() does not include null, object, collection in calculation

date is converted to seconds.

Is this what others are expecting or is this a bug?



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: collection.min() Returns Null

2018-07-26 Thread Keisuke Miyako via 4D_Tech
it is documented.

min()

http://doc.4d.com/4Dv17/4D/17/collectionmin.301-3730928.en.html

says

If the collection contains different types of values, the collection.min( ) 
method will return the minimum value within the first element type in the type 
list order (see collection.sort( ) description).

and the page on sort() says:

If the collection contains elements of different types, they are first grouped 
by type and sorted afterwards. Types are returned in the following order:

• null
• booleans
• strings
• numbers
• objects
• collections
• dates

> 2018/07/27 4:59、Cannon Smith via 4D_Tech <4d_tech@lists.4d.com>のメール:
> Is this what others are expecting or is this a bug?




**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: collection.min() Returns Null

2018-07-26 Thread Keisuke Miyako via 4D_Tech
query() is not the only member function to filter a collection.

in your case, you could do something like

$cTest:=$cTest..filter("remove_null")

where the project method remove_null is

C_OBJECT($1)

$1.result:=($1.value#Null)

2018/07/27 5:09、Cannon Smith via 4D_Tech 
<4d_tech@lists.4d.com>のメール:
Anyone know what I should be doing here?



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: collection.min() Returns Null

2018-07-26 Thread Cannon Smith via 4D_Tech
Hi Christian,

Thanks. The values are a series that need to be graphed. Some values in a 
series may be null, indicating that the graph line should be skipped at that 
point since we don’t know what the value is. That’s why I decided to use 
C_COLLECTION instead of ARRAY REAL to hold the values. As I build the graph, I 
need to know the min and max values in the series.

Yes, I can loop through the collection, of course. I just figured the 
collection probably had a function that would allow me to reduce the collection 
to non-nulls before applying .min() or .max() without having to loop. Trying to 
learn how to use all the collection functions.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Jul 26, 2018, at 2:13 PM, Christian Sakowski 
>  wrote:
> 
> Yes, this is expected. You can only do a query() on a Collection with objects.
> Where do you get these values? You should select before to get only non-null 
> values or remove them from the collection with a For/Each-Loop.

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: collection.min() Returns Null

2018-07-26 Thread Christian Sakowski via 4D_Tech
Yes, this is expected. You can only do a query() on a Collection with objects.
Where do you get these values? You should select before to get only non-null 
values or remove them from the collection with a For/Each-Loop.
--

Grüße/Regards,
[heubach-media] | Christian Sakowski
christian.sakow...@heubach-media.de
iChat/AIM: SakowskiF
Tel: +49/(0)40/52 10 59-23



> Am 26.07.2018 um 22:09 schrieb Cannon Smith via 4D_Tech 
> <4d_tech@lists.4d.com>:
> 
> As a follow up, I thought I would try to remove the null’s from the 
> collection use collection.query(), but I don’t know what to use for the query 
> string since there are no named object properties in the collection.
> 
>   $cTest:=New collection(100;200;Null;80)
>   $lMin:=$cTest.query("#null").min() //<—What should the query string be? 
> Or should I be using a different function?
> 
> Anyone know what I should be doing here?
> 
> Thanks.
> 
> --
> Cannon.Smith
> Synergy Farm Solutions Inc.
> Hill Spring, AB Canada
> 403-626-3236
> 
> 
> 
> 
>> On Jul 26, 2018, at 1:59 PM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> I was surprised that the following code tries to return null instead of 80:
>> 
>> $cTest:=New collection(100;200;Null;80)
>> $lMin:=$cTest.min()
>> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **


--
heubach media
Osterfeldstr. 12-14 | Haus 1 | Eingang Nord
22529 Hamburg
tel: 040 / 52 10 59 - 10 | fax: -99
mail: i...@heubach-media.de
home: www.heubach-media.de
Geschäftsführer|CEO: Matthias Heubach

Mieten Sie Ihre Computer, iPads & Drucker für Ihre Events bei:
http://www.milo-rental.com

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben,
informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht 
gestattet.
 
This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail.
Any unauthorized copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: collection.min() Returns Null

2018-07-26 Thread Cannon Smith via 4D_Tech
As a follow up, I thought I would try to remove the null’s from the collection 
use collection.query(), but I don’t know what to use for the query string since 
there are no named object properties in the collection.

$cTest:=New collection(100;200;Null;80)
$lMin:=$cTest.query("#null").min() //<—What should the query string be? 
Or should I be using a different function?

Anyone know what I should be doing here?

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Jul 26, 2018, at 1:59 PM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I was surprised that the following code tries to return null instead of 80:
> 
> $cTest:=New collection(100;200;Null;80)
> $lMin:=$cTest.min()
> 

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

collection.min() Returns Null

2018-07-26 Thread Cannon Smith via 4D_Tech
I was surprised that the following code tries to return null instead of 80:

$cTest:=New collection(100;200;Null;80)
$lMin:=$cTest.min()

I would have expected that a Null value in the collection would be ignored when 
looking for the minimum value.

Is this what others are expecting or is this a bug?

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**