RE: Calculate values of arrays...

2021-11-01 Thread Joshua Hunter via 4D_Tech
I am aware of what an array is. I'm not sure if you're being serious or not at 
this point.

But from the docs:

The functions of this theme perform calculations on a series of values.

The Average, Max, Min, Sum, Sum squares, Std deviation and Variance functions 
are applied to fields or arrays:

When applied to fields, they use the current selection of records,
When applied to arrays, they use array elements.


Each command has examples. Also from the docs:

Example 2  

This example gets the highest value in the array:

 ARRAY REAL($ArrGrades;0)
 QUERY([Exams];[Exams]Exam_Date=!01/07/11!)
 SELECTION TO ARRAY([Exams]Exam_Grade;$ArrGrades)
 vMax:=Max($ArrGrades)


-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Jörg Knebel via 
4D_Tech
Sent: Monday, November 1, 2021 12:37 PM
To: 4D Tech Mailing List Technical <4d_tech@lists.4d.com>
Cc: Jörg Knebel 
Subject: Re: Calculate values of arrays... 



> On 02 /11 /2021, at 02:24, Joshua Hunter via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> You want the docs for 'On a Series'
> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoc.4d.com%2F4Dv19R2%2F4D%2F19-R2%2FOn-a-Series.201-5493482.en.htmldata=04%7C01%7Cjoshua%40dwdev.com%7C499e1bb59b194a3744b108d99d6ef72d%7C9aa9e914bc4247ea8bd05d0497a4c311%7C0%7C0%7C637713922193566270%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=SBCBtITrNcuwCqMKw1GyOAUAX0%2BevmaMNdWTpf%2FQWk0%3Dreserved=0
>  
> <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoc.4d.com%2F4Dv19R2%2F4D%2F19-R2%2FOn-a-Series.201-5493482.en.htmldata=04%7C01%7Cjoshua%40dwdev.com%7C499e1bb59b194a3744b108d99d6ef72d%7C9aa9e914bc4247ea8bd05d0497a4c311%7C0%7C0%7C637713922193566270%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=SBCBtITrNcuwCqMKw1GyOAUAX0%2BevmaMNdWTpf%2FQWk0%3Dreserved=0>
And this works on an ARRAY how?

You do know what an ARRAY is?
**
4D Internet Users Group (4D iNUG)
New Forum: 
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdiscuss.4d.com%2Fdata=04%7C01%7Cjoshua%40dwdev.com%7C499e1bb59b194a3744b108d99d6ef72d%7C9aa9e914bc4247ea8bd05d0497a4c311%7C0%7C0%7C637713922193566270%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=9660Yd73u%2F%2Fxrv7ekiq5GsisKQ7a7nEPOYhJLGL4nu4%3Dreserved=0
Archive:  
https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.4d.com%2Farchives.htmldata=04%7C01%7Cjoshua%40dwdev.com%7C499e1bb59b194a3744b108d99d6ef72d%7C9aa9e914bc4247ea8bd05d0497a4c311%7C0%7C0%7C637713922193566270%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=nR5EhMyJOcfdGAdGJB8F3RDASGyKO2NCkIiPyzwQdDQ%3Dreserved=0
Options: 
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.4d.com%2Fmailman%2Foptions%2F4d_techdata=04%7C01%7Cjoshua%40dwdev.com%7C499e1bb59b194a3744b108d99d6ef72d%7C9aa9e914bc4247ea8bd05d0497a4c311%7C0%7C0%7C637713922193566270%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=26fvTDknRLmrjhTGxM6HCR8QDUjUQLcnM9k00VezsVY%3Dreserved=0
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**
**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
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: Calculate values of arrays...

2021-11-01 Thread Joshua Hunter via 4D_Tech
You want the docs for 'On a Series'
https://doc.4d.com/4Dv19R2/4D/19-R2/On-a-Series.201-5493482.en.html

--Joshua

-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Jörg Knebel via 
4D_Tech
Sent: Monday, November 1, 2021 5:05 AM
To: 4D Tech Mailing List Technical <4d_tech@lists.4d.com>
Cc: Jörg Knebel 
Subject: Calculate values of arrays... 

G' day,

I'm sure I have seen it before but can't remember where. :-(

I'm looking for "Get/Calculate Minimum, Maximum, Average etc." on (numeric) 
Arrays.

Is there anybody willing to help?

Thanks

Cheers
Jörg
**
4D Internet Users Group (4D iNUG)
New Forum: 
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdiscuss.4d.com%2Fdata=04%7C01%7Cjoshua%40dwdev.com%7Ced2e4961effc436e482c08d99d2fd1a9%7C9aa9e914bc4247ea8bd05d0497a4c311%7C0%7C0%7C637713650993605896%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=PKTAU0iGpdUtfZR4o6Zw38IWFtuvxMNLaGud1FEpBRA%3Dreserved=0
Archive:  
https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.4d.com%2Farchives.htmldata=04%7C01%7Cjoshua%40dwdev.com%7Ced2e4961effc436e482c08d99d2fd1a9%7C9aa9e914bc4247ea8bd05d0497a4c311%7C0%7C0%7C637713650993605896%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=JUO%2BlEDCtd2yDNn2F0vsTsTQnusaZORJ1dyz3qUxfI0%3Dreserved=0
Options: 
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.4d.com%2Fmailman%2Foptions%2F4d_techdata=04%7C01%7Cjoshua%40dwdev.com%7Ced2e4961effc436e482c08d99d2fd1a9%7C9aa9e914bc4247ea8bd05d0497a4c311%7C0%7C0%7C637713650993605896%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=pvG9HLgfWRIUOQQ8dqGOl9LWuP6uNLDw7ZhhcFGufzs%3Dreserved=0
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**
**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
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: Anyone used Twilio SMS?

2020-04-17 Thread Joshua Hunter via 4D_Tech
I've used Twilio since about 2015, but not from 4D. I've found their support to 
be friendly and helpful. Their pricing is transparent and they offer good 
logging and let you control your maximum spend. I highly recommend them. I 
haven't had an outage that I noticed and it costs me less per message now than 
it did when I started.

Joshua Hunter
jos...@dwdev.com
(425)673-1974
www.dwdev.com
Dataworks Development, Inc.
Providing secure and configurable data management solutions for research and 
clinical labs since 1987.  

-Original Message-
From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Kirk Brooks 
via 4D_Tech
Sent: Wednesday, April 15, 2020 8:12 AM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Cc: Kirk Brooks 
Subject: Anyone used Twilio SMS?

I'm looking for some feedback and any code you are willing to share.

Thanks

-- 
Kirk Brooks
San Francisco, CA
==
**
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
**
**
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
**

Thanks and Goodbye

2017-05-30 Thread Joshua Hunter via 4D_Tech
After 7 years working with Cheryl Michels and her team at Dataworks Development 
building Freezerworks I've decided it is time to move on. Before I go I wanted 
to reach out to everyone on the iNug and those that I met at Summits and other 
conferences to say thank you for the help you've given me over the years.

If there is one thing that I really appreciate about 4D it is the community and 
the willingness to help and teach. I'm a better programmer for what I learned. 
Some of you have managed to do things with 4D I wouldn't have thought possible.

I'm not sure what I'm doing next. If you need help on a project, please let me 
know. I've been working remotely for the past 5 years.  I'm experienced with 4D 
(v11-v15.3), Python (Flask, Django, server-side), Angular, WordPress, web 
services, APIs (REST, SOAP), Swagger/OpenAPI, SQL, version control (git, 
mercurial) and more.

Since I won't be following this list closely any longer, please get in contact 
at http://joshuahunter.com  if I can be of any help (work or just questions).

All best and thank you again,
Joshua

Joshua Hunter
hunte...@gmail.com
(425) 673-1974
www.dwdev.com
Dataworks Development, Inc.
Providing secure and configurable data management solutions for research and 
clinical labs since 1987.


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

RE: Can't delete methods

2017-05-17 Thread Joshua Hunter via 4D_Tech
Doug,

We had this problem with a few methods. Went on for years. We could edit the 
content, but not delete them (tried every single 4D user including designer). 
At some point after multiple 4D version upgrades and repairs we were able to 
remove them. Not sure what the exact fix was. I just made sure that they were 
empty so that no matter what they couldn't get called and do something.

Joshua Hunter
jos...@dwdev.com
(425)673-1974
www.dwdev.com
Dataworks Development, Inc.
Providing secure and configurable data management solutions for research and 
clinical labs since 1987.


-Original Message-
From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Doug Hall via 
4D_Tech
Sent: Wednesday, May 17, 2017 1:46 PM
To: 4D iNug Technical
Cc: Doug Hall
Subject: Re: Can't delete methods

I repaired my structure, as suggested and still cannot delete the methods.
They're from a 4D 2004 converted Foundation structure. Most of those methods 
will delete just fine, but I've found four, so far, that will not go away.

:-/
Doug

On Wed, May 17, 2017 at 9:50 AM, Kirk Brooks via 4D_Tech < 
4d_tech@lists.4d.com> wrote:

> Ah - sometimes the Explorer doesn't completely set itself to the 
> 'area' you clicked on in the left column. So if you 'think' you've 
> selected the "Methods" you may not have. Click it again and then try the 
> delete again.
>
> On Wed, May 17, 2017 at 7:40 AM, Doug Hall via 4D_Tech < 
> 4d_tech@lists.4d.com
> > wrote:
>
> > I'm just clicking the minus sign below the project methods list. Is 
> > there another way?
> >
> > On Wed, May 17, 2017 at 9:39 AM, Doug Hall 
> wrote:
> >
> > > Nothing but a system alert sound.
> > >
> > > On Wed, May 17, 2017 at 9:14 AM, Kirk Brooks via 4D_Tech < 
> > > 4d_tech@lists.4d.com> wrote:
> > >
> > >> Doug,
> > >> How are you trying to delete them and what happens when you do?
> > >>
> > >> On Wed, May 17, 2017 at 7:07 AM, Doug Hall via 4D_Tech < 
> > >> 4d_tech@lists.4d.com
> > >> > wrote:
> > >>
> > >> > I have a few methods that I can't delete. I looked in the 
> > >> > method
> > >> properties
> > >> > and can find nothing out of the ordinary, which might be 
> > >> > preventing
> > >> this.
> > >> > They're not used anywhere in my database, and I even emptied 
> > >> > the
> > >> methods.
> > >> > Can someone please point me in the right direction, here?
> > >> >
> > >> > Thanks,
> > >> > Doug
> > >> > 
> > **
> > >> > 4D Internet Users Group (4D iNUG)
> > >> > FAQ:  http://lists.4d.com/faqnug.html
> > >> > Archive:  http://lists.4d.com/archives.html
> > >> > Options: http://lists.4d.com/mailman/options/4d_tech
> > >> > Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> > >> > 
> > **
> > >>
> > >>
> > >>
> > >>
> > >> --
> > >> Kirk Brooks
> > >> San Francisco, CA
> > >> ===
> > >>
> > >> *The only thing necessary for the triumph of evil is for good men 
> > >> to
> do
> > >> nothing.*
> > >>
> > >> *- Edmund Burke*
> > >> 
> **
> > >> 4D Internet Users Group (4D iNUG)
> > >> FAQ:  http://lists.4d.com/faqnug.html
> > >> Archive:  http://lists.4d.com/archives.html
> > >> Options: http://lists.4d.com/mailman/options/4d_tech
> > >> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> > >> 
> **
> > >
> > >
> > >
> > 
> > **
> > 4D Internet Users Group (4D iNUG)
> > FAQ:  http://lists.4d.com/faqnug.html
> > Archive:  http://lists.4d.com/archives.html
> > Options: http://lists.4d.com/mailman/options/4d_tech
> > Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> > 
> > **
> >
>
>
>
> --
> Kirk Brooks
> San Francisco, CA
> ===
>
> *The only thing necessary for the triumph of evil is for good men to 
> do
> nothing.*
>
> *- Edmund Burke*
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
>
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**
**
4D Internet Users Group (4D iNUG)
FAQ:  

RE: How can I suppress the web server creating default index.html?

2017-04-14 Thread Joshua Hunter via 4D_Tech
I haven't tried but could you either:

a) Use WEB SET ROOT FOLDER to change the web root on startup to an empty 
directory
-or-
b) delete the file after it is created on startup

Joshua Hunter
jos...@dwdev.com
(425)673-1974
www.dwdev.com
Dataworks Development, Inc.
Providing secure and configurable data management solutions for research and 
clinical labs since 1987.


-Original Message-
From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Kirk Brooks 
via 4D_Tech
Sent: Friday, April 14, 2017 7:37 AM
To: 4D iNug Technical
Cc: Kirk Brooks
Subject: How can I suppress the web server creating default index.html?

I have my webserver (v15.4) set up to respond to the index page and prompt for 
login. It seems 4D will crate this page each time it starts up if it's not 
there. I don't want it there because I want to catch the it manually.

Can I suppress 4D's urge to create that page if it's missing?

--
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

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

RE: 4D Server Crashes When Tracing Buggy Web Connection Code

2017-04-06 Thread Joshua Hunter via 4D_Tech
The web server process is very sensitive to any bugs. We ran into the exact 
problem you are having. Our web team was suddenly very unpopular with the other 
developers. Any bug and the whole app would crash.

We no longer run any code on the web server process on 4D server. Instead we 
run a client application that acts as a web server. This works pretty well.

The code that gets traced is the code on the machine that handled the request. 
So if you make the request to your web server client application it will trace 
there. The web server on client can run on the same physical server as your 4D 
server so long as they aren't both handling requests on the same port.

The biggest hurdle we had was getting the correct 4D licensing. There was a 
special license to make the client run the web server. This may be made more 
difficult because we are an OEM.

Joshua Hunter
jos...@dwdev.com
(425)673-1974
www.dwdev.com
Dataworks Development, Inc.
Providing secure and configurable data management solutions for research and 
clinical labs since 1987.


-Original Message-
From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Sannyasin 
Siddhanathaswami via 4D_Tech
Sent: Thursday, April 6, 2017 2:14 PM
To: 4D iNug Tech
Cc: Sannyasin Siddhanathaswami
Subject: 4D Server Crashes When Tracing Buggy Web Connection Code

Aloha,

If I trace On Web Connection code on 4D Server v15.3 Mac, and I goof and 
reference an out of index array (I know I’m the first to ever do that), our 
server crashes. It just quits to the Finder, no error message nothing. I view 
the trace via screen sharing to the server machine.

This is disastrous when other people are using 4D!!

Have others run into this? What’s the best way to debug On Web Connection code 
without crashing the server?

Maybe starting the webserver on 4D client? But how does adding a “Trace" On Web 
Connection code work? Won’t it still trace on the 4D Server?

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

RE: LEP and Python Script

2017-02-15 Thread Joshua Hunter via 4D_Tech
Cannon,

The way your script is setup it looks like you are passing it one or more file 
names or paths. That will work, but if you want to pass it data directly you 
could pass in a json string and then read the command line arguments by 
importing the sys module. Then sys.argv will be a list (python equivalent to a 
4D array) of passed in values with the zeroth element being the name of the 
script itself (so skip that one).

# ---
import sys  # import sys module
my_json = sys.argv[1] # set my_jason equal to the first non-script name 
parameter
# ---

If you need to get fancier with parsing arguments passed in you can also look 
at argparse.

Once you are done doing your parsing instead of (or in addition to) your print 
statement I think you want to use sys.stdout.write().

Maybe like this:
# ---
sys.stdout.write(json.dumps(jsonObj, sort_keys=True, indent=2))
sys.exit(0)  # 0 = no errors
# ---

To call your script I would do this:

// ---
C_TEXT($tIn;$tOut) // $tIn is blank, stdout will end up in $tOut
Launch External Process("python yourscript.py jsonfilepath_or_text";$tIn;$tOut)
// ---

I did a quick test (Windows) and this works for me.  I'd also be remiss if I 
didn't recommend using Python 3 instead of Python 2.

Let me know if I can be of more help,

Joshua

Joshua Hunter
jos...@dwdev.com
(425)673-1974
www.dwdev.com
Dataworks Development, Inc.
Providing secure and configurable data management solutions for research and 
clinical labs since 1987.


-Original Message-
From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Cannon Smith 
via 4D_Tech
Sent: Wednesday, February 15, 2017 11:57 AM
To: 4D iNUG Technical
Cc: Cannon Smith
Subject: LEP and Python Script

I’ve been given a python script which takes JSON and returns JSON with all the 
keys alphabetized which is helpful for comparing revisions in version control. 
However, I can’t figure out how to use LAUNCH EXTERNAL PROCESS and pass some 
JSON to it and get the result back. If anyone here knows how it can be done, 
I’d appreciate the help (I know nothing about python). MacOS if it matters.

Here is the script:

#!/usr/bin/python
import fileinput
import json
if __name__ == "__main__":
  jsonStr = ''
  for a_line in fileinput.input():
jsonStr = jsonStr + ' ' + a_line.strip()
  jsonObj = json.loads(jsonStr)  
  print json.dumps(jsonObj, sort_keys=True, indent=2) 

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




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