Re: Count of young new developers after ...

2021-08-06 Thread James Crate via 4D_Tech
On Aug 5, 2021, at 8:15 AM, Jörg Knebel via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
>> On 05 /08 /2021, at 01:59, James Crate via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> 4D has been around since the 80s, …
> 
> That means we could talk about the decades passed for a long time.
> 
> Sorry, but I don’t have the time for this.

We  don’t need to talk about the past decades. My point was that 4D may be 
about the same size (I don’t really know), it’s never been big, and that’s fine 
because it doesn’t seem to be necessary for them to stay in business. 

> Just curious, did you start developing in 4D on Mac or Windows?

I have been fortunate to have only developed on a Mac for my entire career. I 
have used and deployed to other platforms. As this question may relate to 4D, 
4D was Mac-only when I started using it.

Jim

**
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: Count of young new developers after ...

2021-08-04 Thread James Crate via 4D_Tech
On Aug 4, 2021, at 2:18 AM, Jörg Knebel via 4D_Tech <4d_tech@lists.4d.com> 
wrote:

>> On 04 /08 /2021, at 01:52, James Crate via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> I’m curious why that should matter.
> 
> Think about it a bit harder and it will come to you.

4D has been around since the 80s, and even if sales isn’t growing by huge 
amounts, it seems relatively stable over the years, enough to at least keep the 
business going reasonably. If the intention was to be sold and cash out, that 
would have happened a long time ago. If legacy systems being retired was 
happening faster than newer systems were being added, then there would be a 
decline in revenue over the years. Since 4D shares at least some financial info 
at Summits, at least, we should be able to see several years decline before 4D 
decides it just isn’t worth it anymore. And even if they decided to shut down 
tomorrow, the existing software will probably run on current OS versions for at 
least a couple years, and on legacy hardware for years after that. 

I’m on the younger side of 4D developers at just under 50, and I don’t expect 
to have to worry about what to do with my client’s legacy 4D database. If 4D 
doesn’t exist 40 years from now, why should I care? That’s someone else’s 
problem. Technologies come and technologies go. C'est la vie. 

> Hey extending the language and hopefully the functionality with it is great.
> 
> For example C_Objects is a great useful extension, unfortunately it was 
> integrated more than 20 years later than ObjectTools and still misses things 
> OT offers.

Yes, 4D is very far behind the curve in language features. This is not new, but 
it’s their product and their choices. We all have choices. I have not chosen 4D 
for a new clean slate project in more than 15 years. It doesn’t mean there is 
no project where I would choose 4D, it just hasn’t been a good choice for any 
of my projects because it’s just one tool in a reasonably sized toolbox. It 
works well enough that it’s not yet worth rewriting the legacy structure I 
maintain and extend. 

> Implementing helpful things is good, but one should never abandon elements in 
> use like FTP… in the Internet-Command-Plug-IN etc.

I’m honestly surprised they still ship the Internet Commands plugin. The last 
thing I tried using it for was NET_Ping and it was too unreliable to be useful. 
You can always use curl or PHP for FTP. I’ve had issues with the built-in HTTP 
client commands since they were added so I mostly use curl already, it’s very 
reliable accessed via LEP.

Jim Crate

**
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: Count of young new developers after ...

2021-08-03 Thread James Crate via 4D_Tech
On Aug 3, 2021, at 9:03 AM, Jörg Knebel via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> … the implementation of the additional programming paradigm?
> 
> Is there any information available in regards of the extended subject?
> 
> So, how many new and young (age < 40 years) developers have been attracted to 
> 4D since the new “silver-bullet” additions have been made to the 
> language/design/development mode/etc.

I’m curious why that should matter. Do you not appreciate some slight 
modernization of the language for yourself? If not, where do you think 
development of 4D should have stopped? V3? V6? Surely before V11, I mean 
embedding raw SQL into the code is pretty much the worst idea in most other 
environments. 

Jim Crate

**
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: [4D v18.3; Mac {10.13.6} + {10.15.7}] LEP-voodoo

2021-03-26 Thread James Crate via 4D_Tech
On Mar 26, 2021, at 4:17 AM, Jörg Knebel via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
>> On 26 /03 /2021, at 22:03, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> it is the app that needs to be notarised.
>> 
>> the rules discussed so far are common to all apps, nothing is specific to 4D.
> 
> I understand, it is totally my fault that it doesn’t work in 
> interpreted/debugging mode.

Not exactly your fault. Even if you were creating an app in Xcode you could 
specify camera access in the entitlements section, but it still wouldn’t work 
on 10.15+, and then you’d have to google, and eventually you might find the 
StackOverflow question with an answer specifying the necessary Info.plist keys 
you needed to add. There’s probably a page on the Apple developer documentation 
that indicates which Info.plist keys you need to add to access the camera but 
if it’s there is it’s easy to miss. I recently went through this when updating 
a macOS app; I’ve actually done all this before for a different app and I still 
ended up googling like a newbie doing it for the first time. 

The big difference is that this is not something those that develop only 4D 
normally have to deal with, and 4D’s built-in options for setting up app 
signing are somewhat lacking.

Jim
**
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: [4D v18.3; Mac {10.13.6} + {10.15.7}] LEP-voodoo

2021-03-24 Thread James Crate via 4D_Tech
On Mar 24, 2021, at 6:09 PM, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
>> Does the —deep option actually work anymore? The signing script I use for an 
>> app compiled with runtime has to sign every executable component in the 
>> built app. 
> 
> yes it works.
> I use --deep to sign every framework, bundle, plugin from the inside out.
> think of it like sealing smaller boxes before putting them inside a larger 
> box and then an even larger box.
> 
> the problem with --deep is that it might miss a few components in case of a 
> complex package
> and that you can not customise the signature of each component inside the app 
> (their entitlements in particular).
> 
> you can try to --deep sign the app in one shot, it may or may not work.

From my experience it no longer works on a complex app like a built 4D app with 
many included frameworks in several different directories. I do still use the 
—deep option for each individual thing that I sign but I just wasn’t sure that 
it actually did anything anymore.

>> have to completely re-sign and notarize a 4D app, which will likely require 
>> changing the bundle ID in the info.plist\
> 
> there is no need to touch the bundle ID for code signing or notarisation.

So if Jorg wanted to change the entitlements on the 4D.app he uses for 
development so it could access the camera, he could just re-sign with the new 
entitlements and his developer ID and notarize a copy of 4D.app with the bundle 
ID "com.4d.4d”? I never tried this but I just assumed notarization would 
require a different bundle ID. I guess the combination of bundle ID + developer 
ID would still be unique, but I guess I just assumed that Apple wouldn’t let 
that happen.

Btw, I’m pretty sure camera access requires entries in info.plist in addition 
to the entitlements but I guess that’s probably already been covered.  It’s 
also worth noting that the “4D.entitlements” used by 4D’s SignApp.sh has 
com.apple.security.device.camera set to true so theoretically the only extra 
thing needed should be the info.plist keys and a built signed notarized app 
should be allowed to access the camera. 


Jim

> **
> 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
> **

**
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: [4D v18.3; Mac {10.13.6} + {10.15.7}] LEP-voodoo

2021-03-24 Thread James Crate via 4D_Tech
On Mar 20, 2021, at 5:53 PM, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
wrote:

> the above code unfortunately will not grant access to the camera because it 
> is missing 2 critical elements:
> 
> 1. edit "info.plist" to explain what the app needs the camera for
> 2. supply an entitlements file that will be embedded in the code signature
> 
> for examples see https://github.com/miyako/4d-utility-build-application
> 
> in addition, the use of "deep" (sign from the outside in) and "force" 
> (over-write existing signature of plugins and frameworks)
> can work against your objective. again, the above example shows how to sign 
> from the inside out.
> 
> 4D itself does not need access to the camera in order to fully function,
> it is understandable that 4D does not have the permission by default.

Does the —deep option actually work anymore? The signing script I use for an 
app compiled with runtime has to sign every executable component in the built 
app. 

In any case, in order to make this work, Jorg will either have to completely 
re-sign and notarize a 4D app, which will likely require changing the bundle ID 
in the info.plist, which may actually prevent 4D from working. Or, do some 
development, build with Runtime, sign that runtime with appropriate 
entitlements, and test the signed notarized app to see if it’s working yet. 
This just the reality of accessing the camera in today’s world.

Jim Crate
**
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: gitignore for projects

2020-05-24 Thread James Crate via 4D_Tech
I went the other direction and excluded everything except what I wanted to 
include, since I end up with stuff in the folder with the 4D structure that I 
don’t want to track. I should add an ignore for the .DS_Store files too. I’ll 
add the Settings folder at some point too.


# Ignore everything
*

# except the folders we want
!/Project
!/Resources

# and those folders' contents
!/Project/**
!/Resources/**

# allow specific files
!.gitignore


Jim Crate


> On Jan 6, 2020, at 10:38 AM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Mike,
> To your original question about which files to ignore I drop all the MacOS
> specific files (obviously).
> 
> The RESOURCES folder is placed outside the Project folder. Data, Components
> and Plugins are too. So the actual folder I make the git repo is the
> database folder. Project folder is really the alternative to the
> binary files. So inside of this folder I exclude the Preferences,
> userPreferences and Logs. Here's a recent one:
> 
> # Untracked files and directories:
> dataFile/
> Logs/
> 
> Preferences/
> 
> userPreferences.*/
> 
> # OS generated files #
> ##
> .DS_Store
> .DS_Store?
> ._*
> .Spotlight-V100
> .Trashes
> ehthumbs.db
> Thumbs.db
> 
> 
> 
> On Mon, Jan 6, 2020 at 6:49 AM Mike Kerner via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> 
>> method comments are gone - does that mean that they aren't even
>> exported when the project is created?
>> 
> It's that way now. I haven't heard anything concrete regarding what the
> future plans are.
> I was starting to get agitated about this but when i thought about it the
> 'method' is a text file now. Where are these comments going to go? Either
> they are added as a field to the JSON in the file header (not preferable to
> me) or they are maintained in some sort of separate structure. Like another
> directory of text files. Nice - but more complexity.
> 
> So, what are Comments good for? Obviously comments in code are crucial but
> these are a) more decorative and b) require a separate, specific action to
> access. The most useful thing for me is that they are the help tips for
> methods in components. You can't search on them, you can't easily update or
> export them en masse. I don't think their value is worth the effort to
> replicate in Project mode. I do think there is a need for improving the
> documentation in a Project, but the old Comments aren't it.
> 
> Additionally, recent versions of v18 have a tendency to loose the block
> comments. It seems like they simply aren't shown, not actually removed. I
> reverted to an earlier version of v18 (244065) until they fix it.
> 
> https://forums.4d.com/Post/EN/33167019/1/33167020
> 
> Product name 4D - 4D Server [  Previous topic  |  Next topic  ]
> Build 246179
> Platform MacOSX
> Full Name Kirk BROOKS
> Bug number ACI0100382 (In Progress)
> Severity UI/Usability
> Bitness 64-bit
> Submited 12/29/2019 - 16:32
> CONTEXT:
> Systems or/and 4D versions or/and hardware where the bug happens:
> - 4D single user
> -
> Systems or/and 4D versions or/and hardware where the bug doesn't happen:
> -
> -
> 
> SUMMARY:
> This build, and some recent previous ones, do not display block comments.
> This applies to block comments created in a previous version, 244065 for
> instance, as well as block comments entered in 246179.
> This seems to be a display problem. The space the comments occupy is shown
> but it's blank in 246179. The comments are there, however, Opening the same
> database in 244065 and looking at the same method I see them.
> 
> STEPS TO REPRODUCE THE BUG:
> 1. open a method
> 2. create a block comment and type something. Comments are visible until
> the method is closed.
> 3. close and re-open the method
> 
> ACTUAL RESULT: comments are not visible
> 
> EXPECTED RESULT: comments are visible
> 
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===
> 
> What can be said, can be said clearly,
> and what you can’t say, you should shut up about
> 
> *Wittgenstein and the Computer *
> **
> 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)
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: Object notation replacement for use of Self in a script

2020-05-05 Thread James Crate via 4D_Tech
You are correct and I have used it, I just forgot even though I was looking at 
the documentation while writing that email. 

Jim Crate

> On May 5, 2020, at 3:02 PM, Jeremy Roussak via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Doesn’t the option until/while syntax fit the bill for early exit? I agree an 
> automatically-maintained index would be nice, though.
> 
> Jeremy
> 
>> On 5 May 2020, at 19:13, James Crate via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> In 4D, when enumerating collections or entity selections, about half the 
>> time I want an index for progress calculation, and other times I have to use 
>> the indexed for loop because I want to early exit. 
>> 
>> For other languages, providing the index on enumeration varies by language 
>> and enumeration construct, but most have an enumeration construct that 
>> provides an index. Almost all support break.
>> 
>> So 4D’s implementation could be considered more redundant, less 
>> feature-complete. If an index were provided instead of start/end, and you 
>> could set that index to .length to exit the loop, we’d pretty much never 
>> have to use an indexed loop for a collection or entity selection.
>> 
>> Jim Crate
> 
> **
> 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)
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: Object notation replacement for use of Self in a script

2020-05-05 Thread James Crate via 4D_Tech
On May 2, 2020, at 1:10 AM, Aparajita Fishman via 4D_Tech 
<4d_tech@lists.4d.com> wrote:
> 
>> "Don’t be so quick to complain; you finally got ‘for each’ 10 years after
>> the rest of the world (including Active4D).”
>> Good point. So…you’re thinking that the feature set is complete?
> 
> Absolutely. In fact it is more complete than most implementations, you can 
> specify and begin and end index for ordered collections.

Since both collection and entity selections support .slice(), I’ve wondered why 
the begin/end index parameters exist on For each. 

>> it’s funny that we have such a handy looping construct yet I have write code 
>> to init and update my own index.
> 
> If you need an index in a ‘for each’ loop, you should actually be using an 
> indexed ‘for’ loop. That’s the point of having ‘for each’ separate from 
> ‘for’: 90% of the time you don’t need the index and ‘for each’ is more 
> concise, but when you need an index a for loop increments it for you.

In 4D, when enumerating collections or entity selections, about half the time I 
want an index for progress calculation, and other times I have to use the 
indexed for loop because I want to early exit. 

For other languages, providing the index on enumeration varies by language and 
enumeration construct, but most have an enumeration construct that provides an 
index. Almost all support break.

So 4D’s implementation could be considered more redundant, less 
feature-complete. If an index were provided instead of start/end, and you could 
set that index to .length to exit the loop, we’d pretty much never have to use 
an indexed loop for a collection or entity selection.

Jim Crate

**
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: Distinct Collection

2020-05-01 Thread James Crate via 4D_Tech
On Apr 29, 2020, at 2:21 PM, Paul Dennis via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> I have a collection created from arrays via mysql. This contains duplicated
> elements. I'm trying to do the equivalent of distinct values but the
> collection.distinct command does not do the distinction on a single
> attribute. 

I forgot to show what I’d do. Querying every distinct ID is likely to be slow 
if there are many rows. This could be simplified a bit.


ARRAY TO 
COLLECTION($companycol;$CompanyUUID;"UUID";$alContactMySqlID;"MySQLUserID";$asName;"Name";$asAddress;"AddressLine1";$asCity;"Town";$asPostcode;"PostCode”)

// MySQLItemID is not in the ARRAY TO COLLECTION?

// Sort the collection
$companycol:=$companycol.orderBy(“MySQLItemID”)

$uniqueCol:=New collection
$lastID:=-1
For each ($element;$companycol)
 If ($lastID#$element.MySQLItemID)
   $lastID:=$element.MySQLItemID
   $uniqueCol.push($element)
 End if
End for each



Jim Crate

**
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: Distinct Collection

2020-05-01 Thread James Crate via 4D_Tech
On Apr 29, 2020, at 2:21 PM, Paul Dennis via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> I have a collection created from arrays via mysql. This contains duplicated
> elements. I'm trying to do the equivalent of distinct values but the
> collection.distinct command does not do the distinction on a single
> attribute. 
> 
> This is really slow and doesn't seem to work.
> 
> ARRAY TO
> COLLECTION($companycol;$CompanyUUID;"UUID";$alContactMySqlID;"MySQLUserID";$asName;"Name";$asAddress;"AddressLine1";$asCity;"Town";$asPostcode;"PostCode")
> 
> $col:=$companycol.distinct("MySQLItemID")
> 
> For each ($element;$col)
>   
>   $col2:=$companycol.query("MySQLItemID = :1";$element)
This line finds *all* items in $companycol matching the ID, and 

>   $col3.combine($col2)
this line adds *all* those found elements to $col3. So at the end, $col3 should 
be the same as $companycol. What you probably want is:

$col3.push($col2[0])

This will just add the first found element, not all the duplicates that were 
also found by .query(). You shouldn’t have to check whether you found any items 
since you’re querying on IDs you’ve extracted from the collection.

> End for each 

> $col.clear()
> $col2.clear()
> $companycol:=$col3
> $col3.clear()

You shouldn’t need to clear the collections either, unless you are going to use 
them again for something else. As local variables, they’ll be cleared when the 
method ends.

Jim Crate

**
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: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread James Crate via 4D_Tech
On Apr 30, 2020, at 9:36 PM, Douglas von Roeder via 4D_Tech 
<4d_tech@lists.4d.com> wrote:
> 
> Another WTF is that you can’t iterate from the end of a collection to the
> start. You can reorder the collection and then run a For each loop but
> that’s a complete kludge.

For each ($item;$collection.reverse())
  // do some stuff
End for each

This is pretty much the same way you enumerate in reverse order in the other 
languages I use.

Jim Crate

**
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: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread James Crate via 4D_Tech
On May 1, 2020, at 3:44 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> I have not had any great joy attempting to use pop-ups with object
> references. Haven't tried in v18 so maybe it's improved.

In V17, popups work with form object expressions. If you set the expression to 
“Form.payment_type”, then when it displays, it selects the appropriate value in 
the popup, and choosing an item populates Form.payment_type” with the value. If 
you have a static set of options you just enter them in the object properties 
and you’re done. If you need a dynamic list it’s also pretty easy to use New 
list and OBJECT SET LIST BY REFERENCE.  Much nicer than using popups with 
arrays.


> But with respect to changing the names of a few form objects why is that a
> deal? The form objects can be named anything - doesn't matter what the
> field names are.

I know form objects can be named anything. That was entirely my point; if you 
use form object names to reference the value, I.e. 

> Here is an example. I created a form with one in input and the object method 
> below. The form object name is "some.property.path" and the expression is 
> Form.some.property.path.

Then you probably can’t use form object names to help manage groups of form 
objects.

Jim Crate

**
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: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread James Crate via 4D_Tech
On May 1, 2020, at 2:23 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> On Fri, May 1, 2020 at 11:14 AM James Crate via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> The problem with this approach, as others have mentioned, is that you can
>> no longer use object name prefixes to show/hide/enable/etc groups of form
>> objects.
>> 
> 
> Why do you say that?

John was talking about using the form expression as the form object name. 

> Here is an example. I created a form with one in input and the object method 
> below. The form object name is "some.property.path" and the expression is 
> Form.some.property.path.

Suppose you have a section on the form with labels/fields for payment info. You 
have a popup with payment type, and fields for credit card, ACH (bank name/acct 
number), check, cash. When you choose a payment type, you want to show the 
labels/fields for that payment type, and hide any other payment labels/fields. 
If you thought far enough ahead to name all your payment fields correctly, 
maybe you can make it work. But if your fields aren’t already prefixed properly 
so you can do this with wildcards, then you have a lot more messing around to 
do. 

Jim Crate

**
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: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread James Crate via 4D_Tech
On May 1, 2020, at 10:07 AM, John DeSoi via 4D_Tech <4d_tech@lists.4d.com> 
wrote:

> Here is an idea which seems to work, but needs more evaluation. What if you 
> named the form object with the property path in the form data? Even if 
> periods are not allowed (they seem to be), another character could be used. I 
> think the maximum length of an object name is 255 characters which should be 
> plenty.

The problem with this approach, as others have mentioned, is that you can no 
longer use object name prefixes to show/hide/enable/etc groups of form objects.

On Apr 30, 2020, at 7:53 PM, Peter Hay via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> What we really need is a way to access a Form Object's "Variable or
> Expression".  There's a Command named "Object Get Data Source" which was
> added in v14, but it only returns a Pointer if  "Variable or Expression" is
> a Variable.  If it's an Expression it returns Nil.

Yes, and it’s likely it will be added eventually. I mean we got a built-in 
string split command in v17, so it’s never too late!

For the foreseeable future, there is no way to get a pointer to an object 
attribute and you can’t work with the form object value directly. 

In Laurent’s 2020 Summit presentation on classes (Entity extensions), he showed 
setting up a “virtual attribute” with custom getter/setter methods. I assume 
you will be able to set up custom getter/setter methods for datastore 
attributes as well, so when you are able to use that functionality (v18R?), you 
will be able to specify that logic in the Entity class extension and not the 
form. 

Realistically, if you want to be “all-in” on ORDA, you’ll want to use the 4D 
v18R? release that supports classes, DataClass and Entity extensions as soon as 
it’s available. Currently you spend much of your time working around the lack 
of those things.

Jim Crate

**
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: Long running reports to disk intermittently disrupted and fail

2020-04-15 Thread James Crate via 4D_Tech
On Apr 15, 2020, at 4:35 PM, John J Foster via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> I do believe that creating it locally and moving to the network drive can be 
> more efficient. I’m not sure how much speed different there would be.
> 
>> using TEXT TO BLOB with the offset parameter
> 
> I’m investigating this command and seeing if I can understand how to use it.

If your machine is on an SSD, there will probably be little difference between 
writing each row with SEND PACKET or buffering using a BLOB. If you want to 
buffer using a blob, the general strategy is like this:

// Calculate rough target size of blob plus a little extra. If 2.3M rows was 
830MB, you are at roughly 2700 rows per MB, so maybe calculate 1MB per 2500 rows
$blobSize:=(number of records / 2500)*(1024*1024)
SET BLOB SIZE($buffer;$blobSize)
$offset:=0
For ($i;1;number of records)
  // build line into $line
  // make sure we have enough space in the blob
  If (Blob size($buffer)<($offset+Length($line))
$blobSize:=$blobSize+(Length($line)*2000)// increase by enough that we 
don’t have to do it often
SET BLOB SIZE($buffer;$blobSize)
  End if
  TEXT TO BLOB($line;$buffer;UTF8 text without length;$offset)
End for
// Truncate blob to correct length
SET BLOB SIZE($buffer;$offset) // blobs are zero-indexed


Jim Crate

**
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: Long running reports to disk intermittently disrupted and fail

2020-04-15 Thread James Crate via 4D_Tech
On Apr 15, 2020, at 2:20 PM, John J Foster via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> 4D v17.2 64bit Windows
> Windows 10 Pro
> 
> We have some reports that are run in a batch overnight. Have to because they 
> take that long to run all of them. Anyway, since we’ve upgraded from Windows 
> 7 to Windows 10 there have been I’m guessing timeouts on some of these larger 
> reports.
> 
> The report is running along and then we get the error: "executing the method 
> “EXP_CumulativeClaims” at the lilne number 63. The .txt document cannot be 
> written. File not found.”
> [snip]
> 
> The text file report size - when it works - is large:
> 
> Reserve file: 831,801kb
> Claims file: 26,959kb
> [snip]
> 
> Would it be helpful and speedier to redesign the reports so they are not 
> sending out each row but maybe save each row to a text variable, say 100 or 
> 1000 rows and then send packet?
> 
> We are open to all ideas.

In the time it takes to troubleshoot this, you could probably rewrite the 
report to be much faster and more reliable. 

I would start by writing the file to a local temp file, and then copying that 
file to the network drive when finished. This reduces the impact of network 
issues both for completing the operation and the network share, and makes it 
much more likely you only get a completed version on the network share for 
external consumption.

The fastest way to build the output is probably with a pre-sized blob, and 
using TEXT TO BLOB with the offset parameter. Pushing elements into a 
collection and then using collection.join() is also pretty fast, but again 
you’d have to test to see how large a text variable can actually be, and 
whether the limit was large enough both interpreted and compiled. If you don’t 
have enough RAM for a 1GB blob, smaller blobs may work with SEND PACKET.

Jim Crate

**
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: Remote working with 4D networks - what are people using ?

2020-03-19 Thread James Crate via 4D_Tech
On Mar 19, 2020, at 11:13 AM, Herr Alexander Heintz via 4D_Tech 
<4d_tech@lists.4d.com> wrote:
> 
> AFAIK the MacOS cannot be changed to allow multiple concurrent user sessions 
> on one Computer, the OS simply lacks the necessary tools to do it.
> When you switch users on a Mac, you need to first switch off the user you are 
> currently logged in to.

When I screen share to Macs and another user is logged in, I am always given 
the option to share that user’s screen or log in as myself. Logging in as 
myself creates a virtual instance and allows me to use that machine without 
disturbing anyone who maybe be sitting at the machine or screen sharing. It has 
been this way since at least macOS 10.10. 

Jim Crate

**
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: Another Signing/Notarization Question

2020-03-07 Thread James Crate via 4D_Tech
On Mar 6, 2020, at 5:24 PM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> Thanks to Miyako and Rob Laveaux updating some plugins I use, and other help, 
> I now have all but one of my applications notarizing again since the recent 
> Apple changes. The problem with the last application is that some years ago I 
> started placing a small blob file (compressed XML, not an executable) just 
> inside the Contents folder during a build. Of course, the recent rules don’t 
> like files being inside the Contents folder.
> 
> I’m loathe to move this file somewhere else. Technically it is possible, but 
> several applications rely on it so they would all have to be upgraded at the 
> same time. And it affects the auto-update process itself which will cause 
> issues for users trying to upgrade to the latest version.

Will the other apps work if you create an alias in the Contents folder and move 
the file to the Resources folder? I’m not sure how 4D’s commands work with 
aliases, or whether aliases need to be signed.

> So I’m wondering if there is a way to sign this file during the signing 
> process. I’ve tried several variations of signing the file, but haven’t had 
> any luck. I’m hoping someone knows of a way to sign a file like this so I 
> don’t have to go down the difficult road of moving the file to another place.

My impression based on nothing more than all sample signing code I’ve seen has 
done it this way, is that all subdirectory items must be signed before the app 
bundle. So if you have to force sign the file, you likely have to resign the 
app. But, you probably wouldn’t have to re-sign all other sub-items like 
plugins and other bundles. So after the app is built, you could run a script 
that signs that file and the app again.  So maybe something like:


#!/bin/bash
cd "${BASH_SOURCE%/*}" || exit
devID="Developer ID Application: James Crate (CLJ9SRZQY3)"
appPath=“./MyApp.app”

if [[ -d $appPath ]]
then
  codesign --force --deep --verbose --sign "$devID" 
"${appPath}/Contents/SomeFile.blob"
  
  # the base app
  entPath="./sign_app.entitlements"
  codesign --force --deep --verbose --options=runtime --entitlements ${entPath} 
--sign "$devID" "${appPath}”

  # check code-signing
  echo "checking signing"
  spctl -av "$appPath"
  codesign --verify -v "$appPath”

fi

If you already are running a script to zip and upload for notarization, you 
could just incorporate the signing into that script. There is an entitlements 
file buried somewhere in the 4D app bundle so you could just directly reference 
that file if you use LEP to run each command from 4D if you have a project 
method that builds the app, or copy it to where you have your app built for 
easier referencing in a script.

Jim

**
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: Can't use Zint plugin since upgrading my Mac

2020-03-02 Thread James Crate via 4D_Tech

> On Feb 28, 2020, at 8:35 AM, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I just got a new MacBook Pro running Catalina (10.15.3). When I start up my
> 4D app I get a message that "*“ZINT.bundle” is damaged and can’t be opened.
> You should move it to the Bin"*
> I click Cancel and the app launches.
> I go into the Plugins folder, right-click on the Zint app, and choose Open.
> This is supposed to add it to the allowable exceptions, but it doesn't. It
> just launches 4D.

Here’s what worked for me, but with different plugins:

Open System Preferences, Security & Privacy settings, General tab:
Launch 4D, open the database, click cancel for the complaints about the 
plugin(s).
Go to System Preferences, in the lower half under the “Allow apps downloaded 
from” bit, there should be a warning about a plugin. Click Allow (or whatever 
the button is to allow the plugin to operate). 
Quit 4D.
Repeat for each plugin that requires this.

Jim Crate

**
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: New Notarization Issues

2020-02-12 Thread James Crate via 4D_Tech
On Feb 12, 2020, at 11:35 AM, Timothy Penner via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> James et all, 
> 
> Please disregard my response from yesterday regarding removing the 
> WebViewerCEF.bundle as this was bad advice on my part!
> 
> I have been informed that 4D is using the web area in more and more parts 
> internally, and with the offscreen web area allowing to execute JavaScript 
> this might increase.
> 
> The bottom line is that as of today 4D is not designed to work in a modular 
> base, where a customer can remove unwanted parts without impacting the total 
> application.
> 
> Sorry for the misguidance!

It’s useful to know what that component is for, since it doubles the size of 
the app. The system-based web areas I have in the app functioned with it 
removed, so I thought it might be an old legacy item. 

Jim

**
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: New Notarization Issues

2020-02-12 Thread James Crate via 4D_Tech
On Feb 11, 2020, at 11:00 PM, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> I am not 100% sure, but it might be because plugins that support v17 (up to 
> R6) or earlier
> have their manifest.json file under Contents, where the code sign CLI might 
> fail to find it.
> 
> v18 plugins have moved the location to Contents/Resources,
> but then, the plugin is no longer compatible with v17.

I don’t think this is a problem. The v17.3 HF3 build of 4D Internet Commands 
has the manifest.json file under Contents/Resources, as does the v18 4D IC 
plugin. Both work on V17.3 HF3. The XLS plugin has manifest.json under Contents 
(old-style), and there are no notarization errors for this plugin once it is 
properly signed.

I haven’t tested v18 yet to see whether the current XLS plugin (with 
manifest.json in Contents) works, but that seems like something not worth 
making a breaking change.

Jim Crate

**
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: New Notarization Issues

2020-02-11 Thread James Crate via 4D_Tech
On Feb 11, 2020, at 6:28 PM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> 
wrote:

> issues": [
>{
>  "severity": "error",
>  "code": null,
>  "path": "FFE5A08083D54FDE8D0FBAB1A1E06060.zip/Herdly 
> Team.app/Contents/Plugins/4D InternetCommands.bundle/Contents/MacOS/4D 
> InternetCommands",
>  "message": "The binary uses an SDK older than the 10.9 SDK.",
>  "docUrl": null,
>  "architecture": "i386"
>},
>{
>  "severity": "error",
>  "code": null,
>  "path": "FFE5A08083D54FDE8D0FBAB1A1E06060.zip/Herdly 
> Team.app/Contents/Plugins/cURL FTP.bundle/Contents/MacOS/cURL FTP",
>  "message": "The signature of the binary is invalid.",
>  "docUrl": null,
>  "architecture": "x86_64"
>}
>  ]
> 
> 
> I’m not surprised at the Internet Commands one and was hoping I could use the 
> one from v18 which should overcome that. Haven’t tested that it works yet, 
> but it sounds like Jim already did that if I understood correctly. I’m less 
> sure what to do about the cURL FTP plugin. I know Miyako has it ready for 
> notarization and I assumed 4D’s shell script would take care of plugins 
> correctly, but maybe there is something I have to do manually with it.

I didn’t verify that the v18 4DIC is on a newer SDK, I replaced a copy of the 
plugin but the one from inside the 4D.app was being copied, so I ended up with 
the same error because it was the same v17 4DIC. The PostgreSQL plugin from 
Pluggers.nl is also on an old SDK, since it won’t notarize either I didn’t try 
again.

I don’t see any reason the SignApp.sh script would skip the cURL plugin, since 
it ends with .bundle it should be processed. You might want to add an echo in 
the SignFile() function to print a list of all files it signs. Does the plugin 
include a curl binary? Maybe it’s not in a location codesign expects to find 
binaries and the error is misleading?

Jim Crate

**
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: New Notarization Issues

2020-02-11 Thread James Crate via 4D_Tech
On Feb 11, 2020, at 2:58 PM, Timothy Penner via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> Regarding this:
>> However, after building I remove the “Contents/Native 
>> Components/WebViewerCEF.bundle”, which is an apparently unused 275MB 
>> package, so if I wanted to use the built-in signing, I’d have to accept the 
>> extra 275MB on my app size.
> 
> True, if you modify the application package AFTER signing then the signature 
> becomes invalid.
> 
> However, you could modify the source package PRIOR to running the build 
> application command, by removing the “Contents/Native 
> Components/WebViewerCEF.bundle" file from the 4D Volume Desktop.app and 4D 
> Server.app packages...  In this way, when the BUILD APPLICATION command 
> merges the applications together the WebViewerCEF.bundle is already removed 
> before the built-in signing operation takes place.

I thought about that. If I have to mess around with the code signing script 
again I’ll probably switch to just doing that. I’m already running the BUILD 
APPLICATION command with a custom project xml file which I update with the 
version, so I could pretty easily update that to use a customized 4D Volume 
Desktop.app.

Jim Crate

**
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: New Notarization Issues

2020-02-11 Thread James Crate via 4D_Tech
On Feb 11, 2020, at 10:58 AM, James Crate via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> With 4D v17.3 HF3, I have errors like this:
> 
>{
>  "severity": "error",
>  "code": null,
>  "path": "Travel-1.0.7.app.zip/Travel.app/Contents/MacOS/Travel",
>  "message": "The executable does not have the hardened runtime enabled.",
>  "docUrl": null,
>  "architecture": "x86_64"
>},

So the built-in signing (I had to manually edit the BuildApp.xml file) does 
sign the other items, and uses the signing option to turn on hardened runtime. 

However, after building I remove the “Contents/Native 
Components/WebViewerCEF.bundle”, which is an apparently unused 275MB package, 
so if I wanted to use the built-in signing, I’d have to accept the extra 275MB 
on my app size.

However, for those that use a script to sign and want to keep doing so for 
workflow reasons, you can sign the individual components and then the base app, 
including turning on hardened runtime and adding the necessary entitlements. 
What used to be a single line to codesign the app now looks like this:

  # set up $IFS for find to handle spaces
  OIFS="$IFS"
  IFS=$'\n'
  
  # sign items in directories codesign --deep doesn't handle
  entPath="./sign_plugins.entitlements"
  extraDirs=("Plugins" "SASL Plugins" "Native Components")
  for extraDir in ${extraDirs[@]}; do
for item in $(find "${appPath}/Contents/${extraDir}" \( -iname "*.bundle" 
-o -iname "*.plugin" \)); do
  echo "signing \"${item}\""
  codesign --force --deep --verbose --options=runtime --entitlements 
${entPath} --sign "$devID" "${item}"
done
  done
  IFS="$OIFS" # restore $IFS
  
  # php and the Updater app
  codesign --force --deep --verbose --options=runtime --entitlements ${entPath} 
--sign "$devID" "${appPath}/Contents/Resources/php/Mac/php-fcgi-4d"
  codesign --force --deep --verbose --options=runtime --entitlements ${entPath} 
--sign "$devID" "${appPath}/Contents/Resources/Updater/Updater.app"
  
  # and the base app
  entPath="./sign_Travel.entitlements"
  codesign --force --deep --verbose --options=runtime --entitlements ${entPath} 
--sign "$devID" "${appPath}”

A sample entitlements file with all entitlements enabled, like 4D uses:


http://www.apple.com/DTDs/PropertyList-1.0.dtd;>


com.apple.security.automation.apple-events

com.apple.security.cs.allow-dyld-environment-variables

com.apple.security.cs.allow-jit

com.apple.security.cs.allow-unsigned-executable-memory

com.apple.security.cs.debugger

com.apple.security.cs.disable-executable-page-protection

com.apple.security.cs.disable-library-validation

com.apple.security.device.audio-input

com.apple.security.device.camera

com.apple.security.personal-information.addressbook

com.apple.security.personal-information.calendars

com.apple.security.personal-information.location

com.apple.security.personal-information.photos-library




My plugins.entitlements just removes the personal info and device keys. It’s 
probably ok to use the same entitlements file for everything though.

Jim Crate


**
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: New Notarization Issues

2020-02-11 Thread James Crate via 4D_Tech
With 4D v17.3 HF3, I have errors like this:

{
  "severity": "error",
  "code": null,
  "path": "Travel-1.0.7.app.zip/Travel.app/Contents/MacOS/Travel",
  "message": "The executable does not have the hardened runtime enabled.",
  "docUrl": null,
  "architecture": "x86_64"
},

It might no longer be possible to notarize 4D apps until 4D enables the 
hardened runtime for the 4D Runtime app as well as the 4D plugins. 

I also had:

{
  "severity": "error",
  "code": null,
  "path": "Travel-1.0.7.app.zip/Travel.app/Contents/Plugins/4D 
InternetCommands.bundle/Contents/MacOS/4D InternetCommands",
  "message": "The binary uses an SDK older than the 10.9 SDK.",
  "docUrl": null,
  "architecture": "i386"
},

I don’t believe this app even uses 4D InternetCommands so I can probably just 
remove that, unless the internal HTTP client commands like HTTP Get actually 
call 4D InternetCommands.

As for the invalid signature bits, Apple recommends this command to help 
diagnose notarization issues:

codesign -vvv --deep --strict $appPath

It spits out a list of things which are correctly signed, and says the 
signature is valid. However, those are not the things listed in the 
notarization log as having incorrect signatures. So codesign —deep is not 
digging through all the subdirectories, just Contents/MacOS and 
Contents/Frameworks. I’m going to test whether running codesign —deep on other 
subdirectories containing binaries solves the signature issues.

Jim Crate


> On Feb 10, 2020, at 4:19 PM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi Everyone,
> 
> A couple months ago I finally got my applications to notarize correctly. I’m 
> in 4D v17.3 HF3, but using the PHP libraries from v18. As you probably know, 
> Apple made changes last week and my notarization code has stopped working. 
> Here is one example of the errors I’m getting back now:
> 
>{
>  "severity": "error",
>  "code": null,
>  "path": "B3A9E8C4BFA342E4B27E1E54538DEABA.zip/Herdly 
> Team.app/Contents/Native 
> Components/CodeEditor.bundle/Contents/MacOS/CodeEditor",
>  "message": "The signature of the binary is invalid.",
>  "docUrl": null,
>  "architecture": "x86_64"
>},
> 
> I have a log that spits out what is happening during signing. The relevant 
> part is this:
> 
>> codesign --verbose --timestamp --deep  --sign Developer\ ID\ Application:\ 
>> Cannon\ Smith\ \(Y5RAH3A6C3\) /Users/Cannon/Library/Application\ 
>> Support/D9BE268668A4451A8FF411ADC94400CF/Standalone\ Build/Final\ 
>> Application/Herdly\ Team.app/Contents/Native\ Components/CodeEditor.bundle
> 
> StdError: /Users/Cannon/Library/Application 
> Support/D9BE268668A4451A8FF411ADC94400CF/Standalone Build/Final 
> Application/Herdly Team.app/Contents/Native Components/CodeEditor.bundle: 
> signed bundle with Mach-O thin (x86_64) [com.4d.component.CodeEditor]
> 
> 
> Further, both "codesign —verify --verbose” and "codesign -vvv —deep —strict” 
> indicate that the app is signed correctly, but notarization returns errors 
> like above.
> 
> Does anyone know what I might be missing? This is very frustrating. :-(
> 
> Thanks.
> 
> --
> Cannon Smith
> Synergy Farm Solutions Inc.
> 
> 
> 
> **
> 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
**

Re: What is equivalent to SELF when a form object's "variable or expression" is an object attribute?

2020-02-05 Thread James Crate via 4D_Tech
It’s not so much that the pointer is not needed, but that it isn’t available so 
we have to figure out other ways to work around that fact when pointers would 
be more useful and allow you to write less brittle code.

Having to specify almost the same text for the name as for the expression, or 
reference the expression from the object script is brittle, and there’s no 
compiler help to make sure you got it all correct. 

What would be nice is the ability to have a pointer to the form control, and 
the ability to get/set the value using that reference (including updating the 
value in the bound expression). Sure, we can get by without it, just as we were 
able to get by without a built-in Form object and direct object property 
binding.

Jim Crate


> On Feb 5, 2020, at 3:43 AM, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hello,
> 
> Object get pointer(Object current)->
> 
> is synonymous to Self,
> 
> and likewise it will point to nothing if the current object is not bound to a 
> variable.
> 
> I think this is a strong sign that in object based design,
> pointers are very rarely needed, if at all,
> and that this kind of generic code (implicit dependency on data source)
> is probably a bad idea.
> 
> you can have some generic code to construct an object path, of course,
> but I think the variable factor should be a parameter or a value derived from 
> local code.

**
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: What is equivalent to SELF when a form object's "variable or expression" is an object attribute?

2020-02-04 Thread James Crate via 4D_Tech
This was annoying the first time I ran into it, but overall hasn’t really 
caused any serious problems for generic programming. If you name the object 
with the expression, you can use something like:

Form[Object Get name(Object current)]:=x

If you need to set properties on a form object (control) like 
color/disabled/etc, you can use the object name as well. The only problem is 
you may not be able to effectively use an object name prefix to set properties 
on a group of controls. 

I agree it would be nice if references to form controls and access to their 
values had been thought through a little better, but I doubt it’s likely to 
change now. 

Jim Crate


> On Feb 3, 2020, at 10:35 PM, Chris Belanger via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> What a weird ’subject’ for this question. Sorry. Seems quite confusing.
> 
> 
> 
> Say that the “variable or expression” for a on-screen object is 
> Form.LB.Browser.en_edit.FirstName
> This is entirely reasonable, as 4D’s ORDA has taught us to use such 
> ‘expressions’ for the fields
> 
> BUT in the script for this, there is no way to use Self (as there would be if 
> it was a 4D variable) because it is an ATTRIBUTE of an object.
> 
> This is stupid.
> It makes it impossible to write a script as simple as:
> 
> Self->:= Uppercase(Self->)
> 
> Because Self returns a nil pointer.
> 
> So how on earth do we retrieve and set the value under these circumstances? 
> [GENERICALLY; I do not want to use the object’s “expression” in the script]
> 
> There is no such 4D method as   OBJECT Get Value( ) OBJECT SET VALUE( )
> If there were, we could write:
> 
> OBJECT SET VALUE(*; OBJECT Get Name; Uppercase( OBJECT Get Value(Object Get 
> Name) ) )  // really cumbersome, but is hypothetical because there is no 
> ‘OBJECT GET / SET VALUE’ command.
> 
> 
> **
> 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
**

Re: Using ORDA - getting ONE entity from MANY Table

2020-01-29 Thread James Crate via 4D_Tech
In the debugger, look at your “emp” entity. It will show you the fields *and* 
relations. Just use the name it shows for the relation, I.e. 

$text:=$emp.Text

and then access fields on $text like any other entity, or you can access the 
related one field directly.

$description:=$emp.Text.description

Just keep in mind, if you rename a field or relation, you must restart the 
database before you can use those renamed fields or relations.

Jim Crate


On Jan 28, 2020, at 4:25 AM, UKVetDerm via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Hi ORDA users
> 
> I am starting to explore ORDA and with many false steps I have reduced some 
> code to just a few lines which is great. However, I am struggling to extract 
> a field from a related one table when working principally in the many table.
> 
> 
> In the following selection – I cannot find the code to extract the field 
> value from a related one table (Events is the many table) – I am building a 
> calendar view with hmCal.
> 
> I have named my relation and looked at the various examples and cheat sheets 
> and just can’t get to grips with this.
> 
> 
> 
> 4D there would be a good place for a 4D ORDA manual like when SQL was 
> introduced for those of us that are not full time at this!
> 
> 
> 
> I am sure I am missing something very obvious so any suggestions would be 
> gratefully received!
> 
> 
> 
> Thanks
> 
> 
> 
> Steve
> 
> UKVD
> 
> 
> 
> --
> 
> 
> 
> C_OBJECT(emp)
> 
> 
> 
> For each (emp;ds.Events.query("StartDate > :1 & StartDate < :2 & Calendar = 
> :3";vMondaydate;vMondayDate2;True)
> 
> $text:= a related one value!
> 
> $err:=hmCal_Add Appointment 
> (calarea;emp.AppointmentNumber;$text;emp.MainContact 
> emp.AllDay;emp.StartDate;emp.StartTime;emp.FinishDate;emp.FinishTime;0)
> 
>Blah blah …
> 
> End for each
> 
> 
> 
> 
> 
> **
> 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
**

Re: [Warning] Settings properties values on object field by object notation

2017-11-02 Thread James Crate via 4D_Tech
On Oct 31, 2017, at 10:32 PM, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
wrote:

> but that's not how references work.
> 
> for example, imagine a method that does this:
> 
> // myMethod
> C_OBJECT($0)
> $0:=[myTable]myField
> 
> it is possible to do something like this:
> 
> myMethod.prop:="abc"
> 
> there is literally no way of knowing that an object is a field, just by 
> parsing the code.

4D doesn't have tell that the object is a field just by parsing the code. When 
doing the assignment, the reference must be followed to the actual object. 
There’s no reason the object internals can’t track whether an object is a 
sub-object of a field, and mark the field dirty when the object is changed. 

Jim Crate

**
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: [Warning] Settings properties values on object field by object notation

2017-11-02 Thread James Crate via 4D_Tech
On Oct 31, 2017, at 9:17 PM, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
wrote:

> but objects are references, so it is possible to modify the field without 
> "touching" it.
> the object notation is one way to do that.
> but it is also possible using classic coding,
> whereby you obtain a reference to a sub object (OB Get),
> and modify that sub object.
> again, the "parent" object is not modified directly,
> so it is not updated with SAVE RECORD.

I just want to add my vote (for the nothing it counts) that it is preposterous 
that data in a field can be changed and not saved when calling SAVE RECORD. The 
the only function of SAVE RECORD is to save the data that has been changed, and 
how it was changed should be completely irrelevant. 

Maybe a better way to say this is “there should be no possible way to modify a 
field without ‘touching’ it”.


> to explicitly indicate that the object has been modified, just use the line
> 
> [myTable]myObjectField:=[myTable]myObjectField
> and you have total control of when to save the field,

[myTable]myObjectField.somekey:=“A new value”  

That looks pretty explicit to me.

$obj:=OB Get([myTable]myObjectField;”Communications”)
OB SET($obj;”Reminder3”;Current Date)

SAVE RECORD([myTable])

Since 4D prior to v16r4 does not support dot notation, an object field 
sub-object may have been modified that way. Does that also not save the changed 
data? According to the recent discussion on this topic, it must not save 
properly. 

The fact that there could even be any confusion on whether changed data would 
be saved is a problem.


> to me this sounds like a better deal than a blanket "save always" system (the 
> real sloppy design choice, in my opinion)

The only reason us 4D programmers would need to implement a blanket “save 
always” system like the SAVE RECORD wrapper Peter Bozek mentioned is because 4D 
is not doing the right thing and saving the changed data. The only other option 
is to make sure we do not use object fields because they are broken.


Jim Crate

**
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: v13 - Renaming a Directory via code.

2017-10-24 Thread James Crate via 4D_Tech
On Oct 20, 2017, at 5:40 PM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> On Oct 20, 2017, at 4:30 PM, Chip Scheide <4d_o...@pghrepository.org> wrote:
> 
>>> $command_t:="mv "+GetPOSIXfilePath ($folderPath_t)+" 
>> had trouble here -
>> apparently 4D's (v13) Convert path system to POSIX command - fails to 
>> do what it is advertised to do.
>> Fortunately I had a routine already written to do this.
> 
> That’s exactly why I wrote my own. I use the 4D Convert path system to POSIX 
> command but then Replace String for all spaces to “\ “. That seems to make it 
> work. 

Rather than escaping spaces (and all other characters that may cause problems 
when used in a command), you could just escape double-quotes, and enclose the 
path name in double-quotes when building the command for LEP. 

I haven’t tested the 4D Convert path system to POSIX command to see if it 
escapes double-quotes, I would just tell the users not to use quotes in their 
file/folder names.

Jim Crate

**
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: Server Process "Frozen"-ish

2017-09-10 Thread James Crate via 4D_Tech
On Sep 8, 2017, at 5:05 PM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> I’ve seen something odd since upgrading our customers to v16.1 a few months 
> ago. This is on 64-bit server, both platforms. There are a few background 
> processes that continually run on the servers, waking up every few seconds to 
> see if there is work to be done. This has worked without problem for a decade 
> now, but starting with v16.1 we occasionally have a process the just sort of 
> quits.
> 
> By occasionally, I mean maybe once in 2-3 months per server. Little enough 
> that I didn’t pay much attention at first—just relaunched the server. But 
> cumulatively (across all servers) it has happened probably 20-30 times in the 
> last few months.
> 
> By the process sort of quitting, I mean that the tasks it is supposed to take 
> care of just stop getting taken care of. The activity monitor shows the 
> process is still there and nothing I have noticed seems out of the ordinary. 
> It’s like the code just quit executing in that process.

This was happening in a system I upgraded to v16, relatively often. I never 
really narrowed down the cause, but after going through the code that executed, 
some rewriting, and explicitly handling locked records (i.e. making sure a 
record was loaded read-write before modifying and saving), the problem went 
away.

Jim Crate

**
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: Listbox Printing

2017-08-02 Thread James Crate via 4D_Tech
I had forgotten about Print Object. However, this is a listbox embedded in a 
form with lots of other fields/variables, it doesn’t look like Print Object can 
work in combination with Print Form. 

I did figure out how to fake it. There will normally be 4-8 rows, the space can 
accommodate 12 rows, and when there were fewer than 12 the listbox shrank, 
leaving a big gap on the page. I just made the arrays have 12 elements, and I 
get the right length. The downside is that I can’t use display formats, and I 
have to manage totals myself instead of using the listbox footer calculations 
which were so convenient. At least it’s still better than the way it was, which 
was 5+ objects per row for 12 rows to manually create a table that fills a 
space.

If listboxes are actually intended to be printed, there should be an option to 
print fixed size, and they should receive some kind of form event. This one 
does not receive On Load when printing and has no options for printing events.

Jim Crate

> On Aug 2, 2017, at 8:27 PM, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> have you looked into "Print object"?
> 
> http://doc.4d.com/4Dv16/4D/16/Print-object.301-3035768.en.html
> 
>> 2017/08/03 3:18、James Crate via 4D_Tech <4d_tech@lists.4d.com> のメール:
>> 
>> I am printing a listbox on a form which just has a detail section (i.e. 
>> Print Form). The listbox is printing, but variable sized according to the 
>> arrays, and I’d like fixed size with empty rows. There isn’t much 
>> documentation on printing listboxes, there’s no “Print variable frame” 
>> checkbox like text areas, and they don’t even receive the normal printing 
>> events. Is there a way to accomplish this?
> 
> 
> 
> 
> **
> 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
**

Listbox Printing

2017-08-02 Thread James Crate via 4D_Tech
I am printing a listbox on a form which just has a detail section (i.e. Print 
Form). The listbox is printing, but variable sized according to the arrays, and 
I’d like fixed size with empty rows. There isn’t much documentation on printing 
listboxes, there’s no “Print variable frame” checkbox like text areas, and they 
don’t even receive the normal printing events. Is there a way to accomplish 
this?

Jim Crate

**
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: Fastest way to get text into a BLOB?

2017-08-01 Thread James Crate via 4D_Tech
On Aug 1, 2017, at 4:55 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> Great idea - I was planning on trying out files after going with the
> plug-in. I hadn't thought of your idea of parallelizing the task via files,
> that's genius. Unfortunately, I think that these will be cooperative
> threads as both plug-ins and LEP aren't accessible from a pre-emptive
> thread. But if feels like something should be possible. What about setting
> up several files and then just making command-lien calls to \copy? At that
> point, the client work is handled by the PG CLI. Hope that made sense….

If you’re using pre-emptive workers in 4D to generate the data into files, you 
could also generate a shell script that would run psql like this:

my_command > output.log 2>&1 &

and then LEP that shell script. That will run the command detached to a 
background process, so LEP should return instantly. All output from my_command 
will go to output.log. I haven’t tested this; background processes will die 
when the parent process dies, so if 4D does something funny with LEP it might 
not work.

You would use psql \copy from the command line like this:

psql -c "\copy tbname from '/tmp/the_file.csv' delimiter '|' csv"

See https://stackoverflow.com/a/42726226/980575 for more info.


Jim Crate

**
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: Fastest way to get text into a BLOB?

2017-08-01 Thread James Crate via 4D_Tech
On Aug 1, 2017, at 3:42 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> I'm starting with standard rows with UUIDs, strings, longs, reals, and
> perhaps text. I need to go for maximum speed...most of the work on tuning
> is on the Postgres side. Their high-speed entry command is called COPY IN
> and Rob's plug-in supports it with a special command that takes the data as
> a BLOB. In this case, I don't have any big types, binary formats, or JSON
> to move. Since you bring up wire formats, I'm just thinking - 4D natively
> stores all text as UTF16 and my range of values all fit comfortably in
> Latin1. Character encodings is one of those things that I just have never
> take the time to get my head around. Does UTF16 take more space to store
> Latin1 data? It seems like it needn't, and yet when I put text into BBEdit,
> it takes 2x space as UTF16 than as UTF8.

Is the server on the same LAN as the client? If not, you may want to consider 
chunking your COPY data in case of network failure. Also, in this case, wire 
speed is likely to be the bottleneck. It may also be faster to build a UTF8 
file and use LEP/psql to copy the data. 

If this is a one-shot data transfer, as opposed to a scenario where a 4D app 
generates the data that will be regularly transferred to the Postgresql 
database, then the simplest/quickest way to generate data files that can be 
copied to the Postgresql server is probably the right answer.

I haven’t seen if anyone has tested yet whether expanding a blob becomes 
significantly slower as the blob expands into the gigabytes range, vs 
pre-sizing the blob.

> Note: COPY is the go-to bulk load optimization in Postgres, but multi-value
> inserts are also supposed to be a big help. I'm working through it now and
> can post some summary findings, if people are interested.

COPY is supposed to be many times faster than even multi-row inserts, this 
StackOverflow answer has a short explanation:

https://stackoverflow.com/a/32045034/980575

Jim Crate

**
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: Packages-building an installer

2017-07-11 Thread James Crate via 4D_Tech
On Jul 11, 2017, at 7:12 AM, Nigel Greenlee via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> I wondered if anyone else has used ‘Packages’ for creating an installer(maybe 
> you can suggest a similar product). I am creating a simple installer for an 
> in-house application-i will rather give the users a link to an installer than 
> a .zip as they have a habit of installing stuff on the desktop.(this is on 
> OSX only)
> 
> I know this is slightly ‘off topic'
> 
> I am however having two problems:-
> 
> The first is with permissions. If i zip the .4dbase up and send it to a 
> machine the installed app runs fine. However when i create an installer 
> package(with user persmissions set to Owner Root and user Admin(i also tried 
> user Wheel) The installed application does not have the correct permissions 
> and wants to open read only. I wondered if anyone has a suggestion to 
> overcome that.

In Packages, in the Payload tab, you can specify the permissions you would like 
the files to have, including user and group. Keep in mind that only users with 
administrator privileges are in the “wheel” group, while all user accounts 
should be in the “staff” group. You can also just make the datafile writable by 
everyone.

Jim Crate

**
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 v16 Table/Field numbers

2017-07-03 Thread James Crate via 4D_Tech
Since noticing the 4D function "Is field number valid”, making it easy to 
detect deleted fields, I thought field numbers would not be reused. It turns 
out this is not the case. A bit of testing reveals that 4D does not even clear 
the data when deleting a field, and still references data by field number, 
which means after deleting a field, a newly created field is “initialized" with 
the old data!

And here I thought 4D was making some progress toward sensibility. The only 
thing they needed to do to make deleting fields work for any definition of 
“properly” is create new fields with a new freaking number. How do you ever get 
to “hey, let’s reuse field numbers, so new fields can have unexpected data like 
no other database engine ever”. If the idea was to allow the developer to 
recreate an accidentally deleted field, that rare case should be a separate 
option, not the default.

Jim Crate

**
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 v16.1 HF1 HIDE PROCESS problem

2017-06-25 Thread James Crate via 4D_Tech
On Jun 24, 2017, at 3:28 PM, James Crate via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> 4D v16.1 HF1 32-bit on macOS 10.11 & 10.12, interpreted and compiled
> 
> Calling HIDE PROCESS also stops that process from running. However, the 
> process status does not show as paused; calling RESUME PROCESS also has no 
> effect. Calling SHOW PROCESS will show the process and resume it on the next 
> line of code after HIDE PROCESS. Using the "Bring to Front” or “Show" buttons 
> in Runtime Explorer will also resume it.
> 
> I cannot reproduce this in a test database, and I don’t see any relevant 
> compatibility options. Anyone have any ideas where to start figuring this out?

So, I noticed that HIDE PROCESS worked normally in a different process. So I 
moved the HIDE PROCESS command to later in the process startup code and it 
worked normally in the first instance too.

One thing that definitely changed is that a process being hidden and opening a 
window used to enter process state 6 "Hidden modal dialog”, but in v16 goes to 
process state 2 "Waiting for user event”.

Jim Crate

**
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 v16.1 HF1 HIDE PROCESS problem

2017-06-24 Thread James Crate via 4D_Tech
4D v16.1 HF1 32-bit on macOS 10.11 & 10.12, interpreted and compiled

Calling HIDE PROCESS also stops that process from running. However, the process 
status does not show as paused; calling RESUME PROCESS also has no effect. 
Calling SHOW PROCESS will show the process and resume it on the next line of 
code after HIDE PROCESS. Using the "Bring to Front” or “Show" buttons in 
Runtime Explorer will also resume it.

I cannot reproduce this in a test database, and I don’t see any relevant 
compatibility options. Anyone have any ideas where to start figuring this out?

Jim Crate

**
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: Web serving on OS X Server

2017-06-09 Thread James Crate via 4D_Tech
The easy way is to set up a webapp plist, and then just turn on that webapp for 
the appropriate domain (website).

Here’s a sample plist. You should be able to mostly use the httpd.conf options 
you use behind Apache normally.


http://www.apple.com/DTDs/PropertyList-1.0.dtd;>



includeFiles


/Library/WebServer/example.com/my_app/config/server_webapp.httpd.conf

name
com.example.my_app
displayName
My WebApp
installationIndicatorFilePath

/Library/WebServer/example.com/my_app/config/server_webapp.httpd.conf
sslPolicy
0








Re: Migrating OS X server to Windows Server

2017-05-17 Thread James Crate via 4D_Tech
On May 17, 2017, at 9:12 AM, Paul Lovejoy via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> We are hitting the limits of our old xServe hardware which is currently 
> running large v12 databases. We are planning a major upgrade to 4D v15 but we 
> are running into difficulties with the stability of these old xServes with OS 
> X 10.10 or more recent, which is required for v15. We are currently 
> attempting to run v12 on OS X 10.10.5 and the results are disastrous, so we 
> have to go back to older OS versions.
> 
> Since Apple has no longer upgraded its server hardware for over 7 years, this 
> is obviously a lost cause. So we will be looking to move to Windows.
> 
> Has anyone done such a move recently? Does 4D have a policy for side-grades 
> from Mac to Win for server licenses?

MacOS 10.11.x has been stable on my client’s 2009 Xserves. However, 4D v12 is 
likely not compatible with macOS 10.10.x. Also 4D v13 will crash frequently on 
client machines with 10.11.x. 

You can put a PCIe SSD card in Xserves; since it’s only PCIe 2.0 the bandwidth 
is limited to around 8Gb/s, but that’s still more than 6Gb/s SAS. While other 
database engines run well on spinning hard drives, 4D should only be run on an 
SSD. I am so happy the days of 3-5 minute sequential table searches on a single 
field in a 100K row table are behind me…

Jim Crate

**
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: Is it possible to do a search in the file system from 4D

2017-05-16 Thread James Crate via 4D_Tech
There is likely a bit of overhead in LEP, plus the overhead of launching 
processes, which is going to add up when used in a loop like that. 

For this particular case, your fastest option is probably to build a C_OBJECT 
with the filenames as keys and the file paths as values, and in your loop 
you’ll just access the object. Since object key access is case-sensitive (I 
think?), if your file systems are case insensitive you’ll probably want to 
normalize case. Since C_OBJECT has some internal indexing, it should be pretty 
fast when used this way.  A big plus would be not having to figure out separate 
find commands for Mac/Windows.

Jim Crate


> On May 16, 2017, at 4:09 PM, John Baughman via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Are you all repeating the LEP in a loop? I am calling SysDoc_Find like this…
> 
> vNewFolderPath:=Select folder("Select the the parent folder that contains all 
> documents... ";1)
> ALL RECORDS([Document])
> $size:=Records in selection([Document])
> For ($i;1;$size)
>   GOTO SELECTED RECORD([Document];$i)
>   $documentToFind:=[Document]File_Name
>   $pathToDocumentFound:=SysDoc_Find ($documentToFind;vNewFolderPath)
> 
> End for 
> 
> Do not know how to do a loop like this in the command line. what does it look 
> like?
> 
> John 
> 
>> On May 16, 2017, at 9:45 AM, Lee Hinde via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> I’d second that. I just tried it in the command line on a folder with 5,144 
>> (nested) files and with almost 1,400 results the response was near instant.
>> 
>> So, I tried this in 15.4 and Mac 10.12.5.
>> 
>> Basically stripping the convert path stuff because I was passing in the full 
>> path and those commands messed it up.  Also, unquoted the file name.
>> 
>> But then point is, it was instant.
>> 
>> 
>> //Method: SysDoc_Find
>> C_TEXT($searchFor;$1;$searchIn;$2;$pathFound;$0)
>> $searchFor:=$1
>> $searchIn:=$2
>> 
>> //$searchIn:=Convert path system to POSIX($searchIn)
>> $_txt_OSASCRIPT:="mdfind -onlyin "+$searchIn+" -name "+$searchFor
>> $_t_InputStream:=""
>> $_t_OutputStream:=""
>> LAUNCH EXTERNAL PROCESS($_txt_OSASCRIPT;$_t_InputStream;$pathFound)
>> 
>> //If ($pathFound#"")
>> //$pathFound:=Replace string(Convert path POSIX to 
>> system($pathFound);"\n";””)
>> 
>> //  //Note: This is the code I ran for my tests. It is not complete as LEP 
>> is actually returning a list of paths to all the documents found with the 
>> same name.
>> //  //For my test I knew that there would only be one path found so I 
>> eliminated anything unnecessary
>> //  //My SysDoc_Find method actually converts pathFound to a process array, 
>> and returns the first element in the array. The caller can then either use 
>> the returned path or the array.
>> //  //Also, be aware that $pathFound ends with a \n. So the last element of 
>> the array may need to be deleted. My text to array method returns an empty 
>> last element.
>> 
>> //End if 
>> $0:=$pathFound
>> 
>>> On May 16, 2017, at 12:32 PM, Jeffrey Kain via 4D_Tech 
>>> <4d_tech@lists.4d.com> wrote:
>>> 
>>> Which version of 4D are you using? Some versions have a bug in LEP that 
>>> causes them to use 100% of the CPU when they are waiting for the result, 
>>> thus drastically slowing everything down.
>>> 
>>> If you repeat it from the command line instead from inside 4D, what happens?
>>> 
>>> --
>>> Jeffrey Kain
>>> jeffrey.k...@gmail.com
>>> 
 On May 16, 2017, at 3:26 PM, John Baughman via 4D_Tech 
 <4d_tech@lists.4d.com> wrote:
 
 Interestingly this is way slower than crawling through the directories. 
 Using my SearchFolderContents_Jut method which I posted in my original 
 message it takes about 35 seconds to find 526 documents in a folder where 
 the documents are at most nested 3 folders deep. Using LEP to search the 
 same 526 documents takes almost 3 minutes!
>>> 
>>> **
>>> 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:  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: How to detect EOL character in text file

2017-05-13 Thread James Crate via 4D_Tech
On May 13, 2017, at 8:53 AM, Peter Mew via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Replace text($text;lf;cr)
> Replace text($text;crlf;cr)
> Position($text;cr)
> -pm

This won’t detect the line endings, which is what was asked, it will change 
them to CR. However, to properly normalize line endings you need to replace 
CRLF first.

Jim Crate

**
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: Experience with FTSY Sync Code//Speed up Sync Code

2017-04-26 Thread James Crate via 4D_Tech
On Apr 26, 2017, at 5:12 PM, Douglas von Roeder via 4D_Tech 
<4d_tech@lists.4d.com> wrote:

> There are many, repetitive method calls. For example, each time the code
> converts a byte range to a longint, it calls a function that returns the
> byte order. As much as I never met a subroutine I didn't like, perhaps the
> sheer number of them is impacting performance.

As I mentioned, this shouldn’t matter if the code runs compiled.  It will 
definitely make a difference interpreted. 

If you’re running compiled, it’s likely the speed issue is related to running 
4D on a spinning hard drive. An SSD covers up a multitude of sins, and is cheap 
enough that now there is no sensible reason to not use one. An 128GB SSD, big 
enough for most normal 4D databases, probably costs less than an hour of your 
time, and will likely fix not only this problem, but others as well.

For example, a process which deletes a bunch of data from a 4GB datafile so it 
could be used in the standalone version used by field reps used to take 45 
minutes on a MacBookPro with 7200rpm drive. After installing an SSD, that 
process was about 5 minutes. On a newer MBP with PCIe SSD, it takes 90 seconds.

FWIW, I wrote a few methods to work with Cannon’s OBJ module to pack selections 
of records for multiple tables to a C_OBJECT along with their table 
specifications, and unpack into the same fields (by number, with type 
conversion if necessary). It doesn’t follow relations or handle subtables. For 
unpacking you get a count of records for a table and unpack individually by 
index. Very few method calls, runs fast both interpreted and compiled. Maybe 
I’ll push that up to my Github account tonight.

Jim Crate

**
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: Experience with FTSY Sync Code//Speed up Sync Code

2017-04-25 Thread James Crate via 4D_Tech
On Apr 24, 2017, at 11:20 PM, Douglas von Roeder via 4D_Tech 
<4d_tech@lists.4d.com> wrote:
> 
> Updating indexes takes some time but being able to update only 3 - 4
> records per second has got to have some other cause. If you've had positive
> experience with that approach, perhaps I need to look for some
> other factor.

If you can easily modify the code, you could try commenting the SAVE RECORD 
command(s), and replace any queries for an existing record with REDUCE 
SELECTION($tablePtr->;0). That should be quick and easy and will show the speed 
of the unpacking only.  Alternatively, you could test importing into an empty 
database, which should remove the impact of queries and index updates.

If there are many method calls and much pointer dereferencing, 4D will be very 
slow interpreted but much faster compiled.

Jim Crate

**
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: Components: How do you reuse utility code?

2017-04-22 Thread James Crate via 4D_Tech
>> IMO that is one of the biggest reasons there is no significant code-sharing 
>> or component community in 4D, as compared to almost any other language. 
>> There would need to be a “standard library” component that other components 
>> could depend on, or they all have to reinvent every wheel.
> 
> The “standard library’ you allude to already exists. It’s called the 4D 
> language. The bulk of the world's 3GL “standard libraries” are trying to be 
> the 4D language and they never get anywhere near the level of consistency, 
> version continuity or platform support that 4D does. (Otherwise I’d be using 
> them !). 

Luckily, the bulk of the designers of the world’s 3GL standard libraries have 
never heard of 4D, so they can’t try to be 4D.

As far as consistency, maybe we’re talking about different things. To beat the 
dead horse of splitting a string to an array: 

STR_Parse_to_Array(->$array;$string;$delimiter) // mine
STR_Split($string;->$array;$delimiter)  // mine if I 
were creating it today
STR_Split_to_Array(??)  // 
someone else’s version?
manual string parsing   // 
Cannon’s OBJ module, any STR_?? method would likely collide

So for example, the code I wrote some years ago to do HTTP GET with digest 
authentication uses utility routines for basic things that I had to write 
myself. That code can’t be easily shared because then someone would need to 
also need to either edit the code to use their utility routines, or run the 
risk of duplicate method names with different parameter lists. 

By contrast, anyone developing a component in Objective-C will use:

NSArray *listItems = [list componentsSeparatedByString:@", “];

The same goes for almost every ARR_*, BLOB_*, and STR_* method, in almost every 
4D project ever written. If you look at code in one of those languages, you 
don’t have to look at each developer’s implementation of splitting a string, or 
removing duplicates from an array, etc. If you integrate code written by 
someone else into a project you don’t have to resolve all those conflicts, 
because they’re using the same standard functions you do.


> In that regard, the primary role of 4D components (in my experience) apart 
> from re-useability is quality control.
> 
> A single developer needs to reproduce the same code over again for many 
> applications. A component-based approach requires them to distill out and 
> de-couple business logic so that it is explicitly addressed in areas that it 
> is only implicitly addressed in a host-only project.

However, each single developer needs to implement many of the same things.  For 
example, in this (snipped) list, if you were writing apps in Xcode, you 
wouldn’t need to spend any time writing almost any of these yourself.

> UTILITIES
> • path functions (level navigation, multi-platform, joining, splitting)
NSString, NSURL, NSFileManager

> • version control
Integrated into Xcode and many IDEs. Version control is completely separate 
from any other language I have worked with, probably because every other 
environment starts with being accessible to whichever version control system 
you prefer.

> • property bags (text, blob, object)
> • object management
Full object-oriented support in Objective-C and Swift

> • string functions  (this is where your string ‘trim/splt’ would go)
NSString has most of the common stuff.

> • binary libraries (byte arithmetic, object opacity, colour addition, 
> saturation, brightness etc)
CIImage, CGImage, etc.

> • Window handling
> • user interface (forms, drawers, flaps, swaps, visibility
NSWindow, NSWindowController, an extensive set of built-in controls, data 
binding, etc.

> • inter process communications
NSNotification, NSNotificationCenter

> • BLOB routines
NSData, conversions to/from NSString, etc.

> • error handling
NSError, try/catch, full call stack all built in.


So not only does each developer *not* have to implement major parts of the 
language, when you look at somebody else’s code, most often they will be using 
the same framework you do. You don’t have to figure out how someone implemented 
window handling, they used included NSWindow methods for almost everything. If 
they want to get a file extension, they used filePath.pathExtension whether 
filePath is an NSString or an NSURL.  And those are just the simple examples. 
If in some part of your code you’re manipulating an array of objects, first you 
have to understand how that particular 4D developer implemented that particular 
property bag, and what the methods that implement the behaviors of that 
property bag might be called. In Objective-C, it’s probably an array of 
MyClass, and MyClass.h contains the public interface for that class so you can 
see at a glance pretty much everything you need to know about what data those 
objects contain and how they behave. 

To get back to components, if you have a 

Re: Components: How do you reuse utility code?

2017-04-21 Thread James Crate via 4D_Tech
On Apr 21, 2017, at 12:41 PM, Peter Jakobsson via 4D_Tech 
<4d_tech@lists.4d.com> wrote:
> 
> On 21 Apr 2017, at 02:44, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
>> I think we sometimes forget that 4D is not a 3GL programming language like C 
>> or C++. 4D is a 4GL language. You don’t get all the feature, benefits and 
>> capabilities of a 3GL language in a 4GL language. Remember why we all use 4D 
>> instead of using C++. You can get so much more done with 4D in less time and 
>> with less programming effort than doing it in C++.
> 
> In general, I find 4D’s component model immensely powerful - still far more 
> productive than its 3GL equivalents and there isn’t a lot I would change 
> about it.

Depends on what you consider 3GL vs 4GL, I suppose. 4D isn’t really much of a 
4GL, it’s more of a (very) stripped-down 3GL with an integrated database and 
IDE being the only 4GL features. 

Although, there isn’t really much consensus about what makes a 3GL vs 4GL. By 
the strictest definition, a 4GL is domain-specific, so regular expressions and 
SQL could be considered 4GLs, and C, ruby, and python would be 3GLs. 
Objective-C would normally (rightfully) be considered a 3GL, but since it is 
primarily used within the confines of the Xcode IDE with the trappings of 
Foundation and AppKit, it could be considered as 4GL as 4D. 

Also, using the term “productive” is kind of amusing when primarily what people 
would put into a component are the missing parts of the framework (i.e. string 
trim/split, blob searching, array operations, making C_OBJECT nicer to use).  
By comparison, the “components” (gems) I use in Ruby/Rails apps are for 
productive things like generating/expanding zip files, creating CSV files, 
creating PDFs, interacting with external programs/services (LDAP, ImageMagick, 
etc). My Mac/iOS apps so far have been small and focused, but the few 
“components” I’ve used have had laser-like focus onto a specific problem 
domain, which they can do because they do not have to implement basic language 
features.

It’s difficult to imagine having 30 small independent components in a 4D 
system, and in reality it would be unworkable because then each component would 
need to include it’s own method to split a string to an array, or descend into 
the problems of dependent components.  IMO that is one of the biggest reasons 
there is no significant code-sharing or component community in 4D, as compared 
to almost any other language. There would need to be a “standard library” 
component that other components could depend on, or they all have to reinvent 
every wheel.

The worst part is that it didn’t really have to be this way. New commands have 
been added to the language over the years, so the language lacking basic 
features isn’t necessarily because they don’t have “a language guy” or can no 
longer modify the compiler. It’s not that it is too difficult to figure out 
what a basic language framework needs; a function to split a string to an array 
exists in the standard library for every language I have used in the last 20 
years except 4D, Applescript and C/C++ (although most doing C++ would use 
Boost, which includes this). 

Also, with the speed of modern computers, interpreted code can run pretty fast, 
and if they spent some effort to make the interpreter better in the cases where 
it is slow, they may not even really need the compiler. Plenty of code runs 
every day in javascript, ruby and python and is fast enough.


> 1: Tight Coupling
> (Where a component references another component’s method explicitly). 
> Advantages: compiler is made aware of all calls, compiles as reliably as if 
> all methods were host native calls.
> 
> 2: Loose Coupling
> (Where EXECUTE METHOD is used). Advantages: components can be ‘unplugged’ 
> without any compiler complaints.

These are both tight coupling. This is compile-time vs runtime binding. 

An example of loose coupling would be one component publishing a notification 
that it did something, and another component listing for that notification to 
do something in response.  Obviously, sending a notification hoping some 
library will split your string into an array is not the right way to do things. 
Sending a notification that a file has been generated can allow another 
component to email that file to somebody, and a different component could show 
the file to the user, and the component that generated the file and published 
the notification doesn’t even need to know or care if anyone was listening.

Jim Crate

**
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: Components: How do you reuse utility code?

2017-04-20 Thread James Crate via 4D_Tech
On Apr 20, 2017, at 9:42 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
wrote:

> And again, I'm not asking for 4D to do a completely new language. No
> thanks, we have a zillion modern languages to choose from. I'm asking for a
> sensible evolution of the language:
> 
> * Data structures that were in Pascal back when 4D was a baby.
> * Exception handling like any sensible language.
> 
> Those two alone would help improve quality by huge, huge amounts.

A few more less important things that are in almost every modern language that 
would make coding nicer for everyone, and could be added without affecting 
legacy code:

string interpolation (handling expressions, not just variables)
modern language constructs like foreach (including foreach on a selection of 
records)
early return, break/continue in loops
named parameters
expanding on things like string functions (why do we all have to write our own 
trim/split/etc methods?)

None of these things would be particularly hard. These things aren’t in the 
language simply because 4D doesn’t care. If they did care, some of these things 
could have been added instead of querying on object fields that most people 
will eventually wish they didn’t use in the first place.

Considering that even the gigantic flaming mess that is PHP managed to strap on 
object oriented functionality without affecting masses of legacy code, it could 
probably be worked into 4D without any real problems as well.

Jim Crate

**
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: Automated tasks on 4D Server

2017-04-18 Thread James Crate via 4D_Tech

> On Apr 17, 2017, at 8:16 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> On Tue, Apr 18, 2017 at 4:44 AM, James Crate via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Every time I add some automatic process on the server, I wonder whether
>> there is either
>> 
>> a. some built-in functionality for this that I have completely missed
>> 
> 
> Nope. No cron or cron table. For the world's simplest implementation (and
> nothing you haven't probably already written yourself in the past):

A long time ago at Deep Sky I had written one. Given SGW’s love of the resource 
fork, that was obviously the “database” it used.  Hopefully none of that code 
is still being used anywhere...

I agree it’s not very difficult to write a job scheduler, but it’s tedious, and 
only a couple minutes to set up a process to run periodically. In this case the 
new jobs I am adding all need to run once/day, so writing a full-fledged 
scheduler will have to wait for another day.

> Given your background, it would probably take you a couple of hours to
> knock something out with the basics. But, yeah, date math testing is a
> nightmare. At least me, but I've got bird taxonomies filling up the parts
> of my brain where date math should be.

4D date/time math is annoying because you have to calculate with the date and 
time separately. 

I’m a bit spoiled with being able to just use cron to invoke jobs in Ruby/Rails 
systems. Cron wouldn’t be a great choice for a 4D system because 4D is not 
managed from the command line so it would be a pretty “invisible” part of the 
system. However, it does make me idly curious about how difficult it would be 
to tell a 4D Server to "do things” from the command line. I haven’t thought of 
anything clever, though. It could be done with a process listening on a local 
socket, and some external script that knows how to communicate with it, but 
that also feels tedious and inelegant to implement, and I don’t want it bad 
enough for that. Just thinking about all the send/receive packet and 4D string 
parsing...

Jim

**
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
**

Automated tasks on 4D Server

2017-04-17 Thread James Crate via 4D_Tech
Every time I add some automatic process on the server, I wonder whether there 
is either 

a. some built-in functionality for this that I have completely missed
or
b. a component that can be easily integrated to add this functionality

It’s easy enough to just start a process that does what is necessary, but to do 
it simply requires a different process for each kind of schedule (i.e. every 5 
minutes, once per day), and isn’t very elegant. Building/testing my own code to 
do this sensibly doesn’t make sense for just this one system.

Jim Crate

**
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: v13 and OS X 10.12

2017-04-13 Thread James Crate via 4D_Tech
On Apr 13, 2017, at 12:15 PM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> What I need is some information on real world functionality of v13 on 10.12.
> At the moment I have no components, and no plugins other then come with 
> 4D (i.e. 4D pop, SVG etc), and most of these could be removed.  

Starting with macOS 10.11.x, 4D v13 crashes frequently when switching apps 
(including print preview). 4D v13 was stable through 10.10.x. 

Jim Crate

**
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: Off topic, sending binary files

2017-04-10 Thread James Crate via 4D_Tech
On Apr 9, 2017, at 7:09 AM, Peter Mew via 4D_Tech <4d_tech@lists.4d.com> wrote:
> I want to send a small  Mac binary file to a friend.
> [snip]
> The binary is a command line program called scanimage, which allows me to 
> interface with a flatbed scanner from 4D using LEP, and works very well.

If you are sending a standalone (runtime) app, can you just include it in the 
Resources folder? It may keep the executable bit if it is contained within the 
app package. 

If you need an installer, I am still using Packages, it has been updated to be 
compatible with Sierra.

http://s.sudre.free.fr/Software/Packages/about.html

Jim Crate

**
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: CALL FORM: Some notes on a command that's easy to misunderstand

2017-03-20 Thread James Crate via 4D_Tech
On Mar 16, 2017, at 10:28 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
>  That's not what 4D's "messages" are, they're commands. In fact, the
> best names for the new commands are probably these:
> 
> EXECUTE METHOD IN WINDOW
> EXECUTE METHOD IN WORKER

I was looking forward to finally having something better than CALL PROCESS 
available, but it is disappointing to see the level of coupling required to 
utilize the new commands. Something more similar to Cocoa’s NotificationCenter 
or javascript custom events would have been far more preferable.

If you use a string literal for the method name, does the compiler check that 
the method exists? It would be nice if the tokenized method name could be used; 
parenthesis could be required to also allow using the return value of a method 
as the parameter value. (This would be nice for any command that takes a method 
name, like New Process.)

Since using these will require code to be in project methods instead of 
object/form methods (I hate the invisibility of object methods, but also hate 
the pollution of the single namespace with thousands of tiny code snippets 
relevant to a single item), is there any general recommendation on project 
method organization? I have not been able to get project method folders to work 
myself. I’m also not sure if it’s even desirable to have project method 
folders, considering that there is only a single global namespace maybe it is 
better to have the hundreds to thousands of project methods in a single list?  

Is there some sort of “quick open” functionality for project methods that I 
haven’t found yet? Especially with all methods sharing the same list, if I’ve 
opened a form method type-ahead is useless until I’ve closed the form methods 
“folder”. Perhaps something like the 4DPop Commands list, but for opening 
project methods?

Jim Crate

**
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: Survey on 4D’s strategy for implementing Preemptive Processing / worker processes

2017-02-22 Thread James Crate via 4D_Tech
It’s not very sophisticated. 4D pushes data to PostgreSQL, or retrieves data 
from PostgreSQL, based on either user-triggered actions or periodic task 
execution. At no point does the Rails/PostgreSQL system access 4D.  The fact 
that 4D uses SQL to access the PostgreSQL database has specific disadvantages, 
such as updates involving schema changes needing to have coordinated release. 

Jim Crate

> On Feb 22, 2017, at 1:17 AM, Robert ListMail via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Jim, that sound sophisticated. :). So, when Rails is handling a web request 
> in what ways can Rails get to 4D data? Does all data need to be in 
> PostgresSQL database Rails knows about?
> 
> Thanks,
> 
> Robert
> 
> Sent from my iPhone
> 
>> On Feb 21, 2017, at 9:33 AM, James Crate via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> I am, both using 4D to directly access the PostgreSQL database with Rob 
>> Laveaux’s plugin and using LEP+curl to access APIs I’ve built. Going 
>> forward, I am moving away from direct database access to exclusively using 
>> APIs. Rails is used for all web access, with no web serving built in 4D at 
>> all.
>> 
>> Jim Crate
> 
> **
> 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: Survey on 4D’s strategy for implementing Preemptive Processing / worker processes

2017-02-21 Thread James Crate via 4D_Tech
>> On Nov 3, 2016, at 8:11 PM, James Crate  wrote:
>> 
>> Ruby/Rails apps - processing large numbers of files; performing slow fuzzy 
>> search on slices of data; 

> On Feb 20, 2017, at 7:13 PM, Robert ListMail via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Jim, are you using Ruby/Rails with 4D in any way…?

I am, both using 4D to directly access the PostgreSQL database with Rob 
Laveaux’s plugin and using LEP+curl to access APIs I’ve built. Going forward, I 
am moving away from direct database access to exclusively using APIs. Rails is 
used for all web access, with no web serving built in 4D at all.

Jim Crate

**
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
**