Re: Bug or feature?

2018-04-05 Thread David Adams via 4D_Tech
Hey, long thread - I was even part of it at some point. I just wanted to
send out a big *thank you* to Jeff Kain for starting it. (And to Chip for
the awesome feature bug picture.)

I'm writing now because I've been banging my head against the desk for a
couple of days trying to get past a problemthe very problem Jeff
reported. I don't want to go through or rehash the whole thread, it's there
in the archives for anyone that cares. But my current issue (16R3 macOS) is
a bit the same, and a bit different. The big difference is that *there is
nothing wrong with the JSON*. It's valid JSON. But 4D blows up on some of
it, some of the time and the *ON ERR CALL* does not check. Jeff's trick
with declaring Is object has at least stopped the blocking error. Now I'll
have to see if the system is actually working.

This has all been a bit slow for me as the error only appears in compiled
mode and only in one method (more on that in a moment.) And there are
nearly 6M records in my test file and over 8M in production. When you blow
up, the process is dead, you're compiled and you can't get anything back to
identify *which* record blew up. So I grafted in some logging code to log
activity before it happens so that I could figure out what the problem is.
I didn't ;-) But at least I can look and see the record.

Tim Penner made a solid point earlier about Booleans in JSON being all
lower-case. I'm wondering if that has something to do with it? Here's a
clause from the JSON:

{
  "name": "is Name Finalized",
  "old": "False",
  "new": "True"
}

Except here's the thing, those are formatted as quoted JSON strings, not
booleans. We don't want booleans, we want strings. These are valid strings.
If we wanted bools, it would look like this:

{
  "name": "is Name Finalized",
  "old": false,
  "new": true
}

Not what we want, but Tim's point is worth keeping in mind. I'm wondering
if without the Is object hint, 4D is getting overly-aggressive about
interpreting "True" and "False" (or "true" and "false") as Booleans? No
idea.

Regarding the "but my JSON is okay!" claim, here's how I checked. The 4D
bits are all in compiled mode:

-- My main big method with an *ON ERR CALL* that doesn't have any
callbacks, current method name, etc. It's either empty or Error:=Error.
This fails, and on the same record(s).
--> This method loads the data into a text array and the value is then
parsed from there, it is not directly parsed as a field

-- A big loop that scans over the same records but only copies the data
into a variable and parse it. *I don't get any errors from the same records*
.

-- Checking an individual record in an input and clicking a button that has
a little parser script. *I don't get any errors from the same records*.

-- Copy the JSON out and putting it into a JSON format window I've got (two
text vars, one in and one out.) The JSON stringify stuff works fine to
pretty print or flatten the JSON.

-- Copy the JSON out and into any JSON tool you like. No problem.

So, it's very weird. 4D blows up on the JSON in one case and no other.

If anyone can suggest why this might be happening, I'd love to hear about
it.

More to the point, should we explicitly set Is object pretty much
everywhere in our code. We have a ton of calls to *JSON Parse* that would
need updates, if this is the case. Is there any  downside to specifying Is
Object to be aware of?

Thanks!

P.S. If possible, please CC me directly in responses on dpad...@gmail.com
as I do not monitor this list.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
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: v13 - Win 7 and LEP

2018-04-05 Thread Keisuke Miyako via 4D_Tech
some testing reveals that...

XCOPY returns an "invalid path error" if the source path ends with a folder 
separator
XCOPY begins an "is this a file or a path" dialog if the destination path does 
NOT end with a folder separator

so here is a small example

> $command:="cmd.exe /C xcopy "
>
> $src:=System folder(Desktop)+"src"+Folder separator
> CREATE FOLDER($src;*)
>
> C_BLOB($VOID)
> BLOB TO DOCUMENT($src+Generate UUID;$VOID)
> BLOB TO DOCUMENT($src+Generate UUID;$VOID)
> BLOB TO DOCUMENT($src+Generate UUID;$VOID)
>
> $src:=System folder(Desktop)+"src"  //must remove folder separator
> $dst:=System folder(Desktop)+"dst"+Folder separator  // must add folder 
> separator
>
> $command:=$command+$src+" "+$dst
>
>   //SET ENVIRONMENT VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"false")
>   //SET ENVIRONMENT VARIABLE("_4D_OPTION_HIDE_CONSOLE";"true")
>
> C_TEXT($in;$out;$err)
> LAUNCH EXTERNAL PROCESS($command;$in;$out;$err)

if you are not sure how paths should be escaped
take a look at the "PATH_Escape" method in this component:

https://github.com/miyako/4d-component-sublaunch

notice the rules to escape string (LEP_Escape) and path (PATH_Escape) are 
slightly different.

P.S.

COPY DOCUMENT was updated in v14 to support the copying of folders.
http://doc.4d.com/4Dv14/4D/14.4/COPY-DOCUMENT.301-2511853.en.html



**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
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: Signed emails to the list?

2018-04-05 Thread Epperlein, Lutz (agendo) via 4D_Tech
Hi Tim,

thanks, it seems to work, the signed email is delivered via iNUG.

Lutz

> -Original Message-
> From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Epperlein, 
> Lutz
> (agendo) via 4D_Tech
> Sent: Thursday, April 5, 2018 9:42 AM
> To: Timothy Penner ; 4D iNug Technical 
> <4d_tech@lists.4d.com>
> Cc: Epperlein, Lutz (agendo) 
> Subject: RE: Signed emails to the list?
>
> Hi Tim,
>
> Ok, here is a signed one ...
> Background: It is a S/MIME-signed email using MS Outlook.
>
> Regards
> Lutz
>
> > -Original Message-
> > From: Timothy Penner [mailto:tpen...@4d.com]
> > Sent: Thursday, March 29, 2018 6:36 PM
> > To: 4D iNug Technical <4d_tech@lists.4d.com>
> > Cc: Epperlein, Lutz (agendo) 
> > Subject: [Junk released by User action] RE: Signed emails to the list?
> >
> > Hi Lutz,
> >
> > > it seems signing of emails prevents the delivery ...
> >
> > I don't think that sending signed emails to the iNUG has ever worked...
> > However, I just
> > made a small modification to the list settings that may start to allow it 
> > to
> > work;  would
> > you like to retry sending a signed message?
> >
> > Kind Regards,
> >
> > Tim PENNER
> >
> >
> >
> > Timothy Penner
> > Senior Technical Services Engineer
> >
> > 4D Inc
> > 95 S. Market Street, Suite #240
> > CA 95113 San Jose
> > United States
> >
> > Telephone : +1-408-557-4600
> > Standard :  +1-408-557-4600
> > Fax :   +1-408-271-5080
> > Email : tpen...@4d.com
> > Web :   www.4D.com
> >
>
> *
> *
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> 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)
FAQ:  http://lists.4d.com/faqnug.html
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: Signed emails to the list?

2018-04-05 Thread Epperlein, Lutz (agendo) via 4D_Tech
Hi Tim,

Ok, here is a signed one ...
Background: It is a S/MIME-signed email using MS Outlook.

Regards
Lutz

> -Original Message-
> From: Timothy Penner [mailto:tpen...@4d.com]
> Sent: Thursday, March 29, 2018 6:36 PM
> To: 4D iNug Technical <4d_tech@lists.4d.com>
> Cc: Epperlein, Lutz (agendo) 
> Subject: [Junk released by User action] RE: Signed emails to the list?
>
> Hi Lutz,
>
> > it seems signing of emails prevents the delivery ...
>
> I don't think that sending signed emails to the iNUG has ever worked... 
> However, I just
> made a small modification to the list settings that may start to allow it to 
> work;  would
> you like to retry sending a signed message?
>
> Kind Regards,
>
> Tim PENNER
>
>
>
> Timothy Penner
> Senior Technical Services Engineer
>
> 4D Inc
> 95 S. Market Street, Suite #240
> CA 95113 San Jose
> United States
>
> Telephone : +1-408-557-4600
> Standard :  +1-408-557-4600
> Fax :   +1-408-271-5080
> Email : tpen...@4d.com
> Web :   www.4D.com
>

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