Re: SET UPDATE FOLDER

2017-11-08 Thread Keisuke Miyako via 4D_Tech
have you activated the key "StartElevated" ? http://doc.4d.com/4Dv16R4/4D/16-R4/Server-StartElevated.300-3455800.en.html (I am not sure if it would help, though) > 2017/11/09 16:12、Sujit Shah via 4D_Tech <4d_tech@lists.4d.com> のメール: > Sorry, I mean the original application folder. So if C:\4DAPP

Re: SET UPDATE FOLDER

2017-11-08 Thread Sujit Shah via 4D_Tech
Sorry, I mean the original application folder. So if C:\4DAPP Folder is open in explorer the Update is not able to replace the files in that folder. On Thu, Nov 9, 2017 at 5:54 PM, Keisuke Miyako via 4D_Tech < 4d_tech@lists.4d.com> wrote: > why not create a new folder: > > CREATE FOLDER(Temporary

Re: Counting occurrences of specific characters In a document

2017-11-08 Thread Arnaud de Montard via 4D_Tech
> Le 9 nov. 2017 à 06:10, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> a > écrit : > > Kirk, > One trick for counting the number of characters is : > > $n:=length($text) > $text:=replace string($text;$char;"") > $n:=$n-length($text) > > That will work for your text file. I use this instead:

Re: SET UPDATE FOLDER

2017-11-08 Thread Keisuke Miyako via 4D_Tech
why not create a new folder: CREATE FOLDER(Temporary folder+Generate UUID+Folder separator;*) it's only needed for the swapping process. when automatic update is over, the old app goes to trash. > 2017/11/09 14:23、Sujit Shah via 4D_Tech <4d_tech@lists.4d.com> のメール: > > Automatic Update of the Me

Re: Counting occurrences of specific characters In a document

2017-11-08 Thread Timothy Penner via 4D_Tech
Maybe this will help: http://kb.4d.com/assetid=76822 // UTIL_HowMany C_TEXT($1) // input C_TEXT($2) // count this C_LONGINT($0) If (Count parameters=2) $0:=(Length($1)-(Length(Replace string($1;$2;""/Length($2) Else $0:=0 End if Once the project method is saved as UTIL_HowMany it ca

Re: SET UPDATE FOLDER

2017-11-08 Thread Sujit Shah via 4D_Tech
Also is there a way that 4D can detect if a folder is opened in explorer..? On Thu, Nov 9, 2017 at 4:23 PM, Sujit Shah wrote: > Automatic Update of the Merged 4D Application works well except for 2 > things: > > - If the install folder is open in Explorer you get an Access Denied > error. Worse

SET UPDATE FOLDER

2017-11-08 Thread Sujit Shah via 4D_Tech
Automatic Update of the Merged 4D Application works well except for 2 things: - If the install folder is open in Explorer you get an Access Denied error. Worse still is at times you have to restart the machine till the conflict is removed. - After RESTART 4D and the application quits there is a 3

Re: Counting occurrences of specific characters In a document

2017-11-08 Thread Chip Scheide via 4D_Tech
a cheat.. you will create 2 copies of the data. $Start_size := length(Imported_Text) $Removed:=replace string(Imported_Text;Char(13)) $Removed_Size:=$Start_Size - Length($Removed) $Removed_Size = number of characters (returns) replaced > Thank you Cannon, > > Progress indicator is not the only

Re: Counting occurrences of specific characters In a document

2017-11-08 Thread Keisuke Miyako via 4D_Tech
sounds like you are mainly interested in text data. you could try https://github.com/miyako/4d-plugin-xlsxio which converts XLSX to JSON. for XLS this might work https://github.com/miyako/4d-plugin-free-xl miyako ** 4D Int

Re: Counting occurrences of specific characters In a document

2017-11-08 Thread Kirk Brooks via 4D_Tech
Kirk, One trick for counting the number of characters is : $n:=length($text) $text:=replace string($text;$char;"") $n:=$n-length($text) That will work for your text file. Excel is more complicated. If it's .xls it's basically XML. Miyako made a component for working with them that may work for

Re: LEP - and Batch files

2017-11-08 Thread Chip Scheide via 4D_Tech
no Ill try that too Thanks > Chip, > > have you tried to change the .bat file to eliminate the ‘cmd’ call > and run xcopy directly, so that .bat would read just: > "xcopy 2>> ” > > And then call the .bat directly in your LEP statement? > > Why do you need that “cmd.exe” for? > > julio > ' >

Re: Counting occurrences of specific characters In a document

2017-11-08 Thread rooftop99--- via 4D_Tech
Thank you Cannon, Progress indicator is not the only reason we need to know number of rows in advance. However, your suggestion for using parse position and file size for process bars is intriguing and new to me. I will investigate. Kirk > On Nov 8, 2017, at 7:11 PM, Cannon Smith via 4D_Tech

Re: Counting occurrences of specific characters In a document

2017-11-08 Thread Cannon Smith via 4D_Tech
If the only reason you need to know the number of rows beforehand is to help in showing a progress indicator, you could use the file size and current parse position instead -- Cannon Smith > On Nov 8, 2017, at 6:42 PM, rooftop99--- via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > We are wo

Re: BLOB CONFRONT

2017-11-08 Thread Wayne Stewart via 4D_Tech
Hi, Thanks for all the thoughts. I ran a test where I used four different document types, six different mechanisms, repeated 10 times and then averaged the results. Notes: The √ means that the result came back as equal (just being paranoid). 4D Digest only works on text not blobs (although the do

Re: Symlinks in Windows

2017-11-08 Thread Lee Hinde via 4D_Tech
> On Nov 8, 2017, at 5:14 PM, Justin Carr via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > On 9 Nov 2017, at 10:19 am, Lee Hinde via 4D_Tech <4d_tech@lists.4d.com> > wrote: >> >> On a Mac, when I want apache to front my 4D web server, I create a symlink >> in the Apache document directory to my

Counting occurrences of specific characters In a document

2017-11-08 Thread rooftop99--- via 4D_Tech
Hi All, The need: To know how many rows are in an Excel or Text file. Overview: We are working with large Excel documents which contain upwards of 750K rows and we need to import each row into a 4D application to create records. In advance of the import process I would like to know how may

Re: Symlinks in Windows

2017-11-08 Thread Justin Carr via 4D_Tech
On 9 Nov 2017, at 10:19 am, Lee Hinde via 4D_Tech <4d_tech@lists.4d.com> wrote: > > On a Mac, when I want apache to front my 4D web server, I create a symlink > in the Apache document directory to my web folder in the database directory. > > That way, I only have to install and maintain the web f

Re: LEP - and Batch files

2017-11-08 Thread Julio Carneiro via 4D_Tech
Chip, have you tried to change the .bat file to eliminate the ‘cmd’ call and run xcopy directly, so that .bat would read just: "xcopy 2>> ” And then call the .bat directly in your LEP statement? Why do you need that “cmd.exe” for? julio ' > On Nov 8, 2017, at 10:06 PM, Chip Scheide via 4D_Te

Symlinks in Windows

2017-11-08 Thread Lee Hinde via 4D_Tech
On a Mac, when I want apache to front my 4D web server, I create a symlink in the Apache document directory to my web folder in the database directory. That way, I only have to install and maintain the web folder in one place. (The purpose of using apache is to have 4D only deal with database stu

Re: LEP - and Batch files

2017-11-08 Thread Chip Scheide via 4D_Tech
what is in the batch file is : cmd.exe /C xcopy 2>> All paths are valid. when I execute the batch file from the OS (double click, or command line) it works, and does NOT create an error file. When run from LEP it does nothing, and creates an empty error file. I will have to check, but I am m

Re: Normalization question

2017-11-08 Thread John Baughman via 4D_Tech
Of course. If, however, you go down that rabbit hole with your eyes open… Take for example using Employee_Number as I mentioned. If business rules do not allow deletion or changing of this field once it is created, then I see no problem using it as a relational key. For an Employee Number this u

Hunspell dictionaries installed

2017-11-08 Thread Pat Bensky via 4D_Tech
Using v16r4 I call SPELL GET DICTIONARY LIST and the resulting array of language names contains 21 items, which includes English (United States) 3 times and Portuguese (Brazil) two times (but no Portuguese (Portugal)!), one one "unknown". Looking in the application/Resources/Spellcheck/Hunspell d

Re: Normalization question

2017-11-08 Thread Kirk Brooks via 4D_Tech
Doug, That's a really good resource for ideas for structuring things. I haven't looked at in a long time - it's grown quite a lot. On Wed, Nov 8, 2017 at 12:23 PM, Douglas von Roeder via 4D_Tech < 4d_tech@lists.4d.com> wrote: > This is a link

Re: LEP - and Batch files

2017-11-08 Thread Justin Carr via 4D_Tech
On 9 Nov 2017, at 4:44 am, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> wrote: > > I have tried all of the offered suggestions: > Start ?b > running without a call to cmd > \batchfilename\ > extended this to cover the file paths in the batch file > > none of these result in file copying when

Re: Normalization question

2017-11-08 Thread Chip Scheide via 4D_Tech
meaningful can be in context: - a UUID floating alone in an ocean of text has no meaning. - a UUID in a unique (indexed?) field of a relational database has meaning - it is the some identifier - 'Joe' has no meaning, except in context. You might expect that it is a name, but.. Hey Joe, get me som

Re: Normalization question

2017-11-08 Thread Keith Culotta via 4D_Tech
Something that stood out in a recent thread about the definition of the Relational Model was a statement that said related fields should contain meaningful information. This was a surprise, especially since the use of UUIDs has been such a convenience. I took 'meaningful' to imply 'user defina

Re: Normalization question

2017-11-08 Thread Chip Scheide via 4D_Tech
** NO ** user definable data should be used as relational/unique key value. generate your own internal values for relations, longint, UUIDs, variations on the Batman Logo, anything that the user has no say in what it is nor how it is used. On Wed, 8 Nov 2017 17:38:38 -0500, Chip Scheide via 4D_

Re: Normalization question

2017-11-08 Thread Chip Scheide via 4D_Tech
On Wed, 8 Nov 2017 12:30:14 -1000, John Baughman via 4D_Tech wrote: > Thanks for the replies. > > To reiterate, every project will have, and only have, a principal, > manager, and supervisor who are employees. until this is not the case... :) > Judging from your suggestions and my trial and er

LEP and (unix/Mac) cp -r command

2017-11-08 Thread Chip Scheide via 4D_Tech
anyone doing something like this? $Source_Path:=utl_file_Directory_Mark_Remove ($Source_Path) //trailing directory mark causes issues $External_Command:="cp -r "+utl_file_Path_Convert_to_Posix ($Source_Path) $External_Command:=$External_Command+" "+utl_file_Path_Convert_to_Posix ($Final_Copy_T

Re: Normalization question

2017-11-08 Thread John Baughman via 4D_Tech
Thanks for the replies. To reiterate, every project will have, and only have, a principal, manager, snd supervisor who are employees. Judging from your suggestions and my trial and error testing, It looks to me that respecting normal form, no matter how you create the structure and relations

Re: Normalization question

2017-11-08 Thread Keith Culotta via 4D_Tech
These searches will return a People record for a Many to Many relation. The function could be the Expression of the listbox column, or assign a variable in a traditional output form in Display Detail (maybe display a [People] field?). Relate Many([Project]ID) Query selection([ProjectEmployeeTyp

Re: Normalization question

2017-11-08 Thread Bart Davis via 4D_Tech
John, The automatic relations in 4D are really handy for output layouts and selection to array, but unfortunately are not much help in your database model. What I have done in the past is create as many Clone Tables as needed, like Employee_1 and Employee_2 that only contain the primary key ID

Re: Normalization question

2017-11-08 Thread Alan Chan via 4D_Tech
Table Project Master Employee Master Project member Project master <- Project member -> Employee master Project member table contains Role (integer) 0=regular member; 1=role A; 2=role B; 3=whatever role Alan Chan 4D iNug Technical <4d_tech@lists.4d.com> writes: >Given a Project table and an Em

Re: Normalization question

2017-11-08 Thread Chip Scheide via 4D_Tech
Sorry, hit send by accident... In my view: - this gives you the ability to define the Employee 'entity' as needed, this could be one table ([employee]), or many tables ([employee] <- [address], <-[phones], <-[Signficicant_others], <-[etc etc etc] {<- [] all reference employee)}. - The same for

Re: Normalization question

2017-11-08 Thread Keith Culotta via 4D_Tech
It does make it more difficult to display the Person in the output form. I had to create a function like getPersonInfo(ProjectID;PositionType) that pulled the name and phone of the project person in that position. It didn't create a noticeable slowdown in the list display. "getPersonInfo" and

RE: Normalization question

2017-11-08 Thread Dennis, Neil via 4D_Tech
My number three choice that would work in an output form would be this: > [Employees]ID <——— [Projects]PrincipleEmployeeID ><——— [Projects]ProjectMangeEmplyeerID ><——— [Projects]SupervisorEmployeeID Your list form would consist of two or three var

Re: Normalization question

2017-11-08 Thread Chip Scheide via 4D_Tech
[employeee] <-- [Employee_Role] --> [project] Project_ID Employee_ID Role_ID > [Project_Roles] (or [Employee_Roles]) On Wed, 8 Nov 2017 10:06:22 -1000, John Baughman via 4D_Tech wrote: > Given a Pr

Re: Normalization question

2017-11-08 Thread John Baughman via 4D_Tech
I use that structure all the time where where 2 tables both have one to many relationships with each other, but correct me if I am wrong but I don’t think that is what I am looking for as it creates a many selection in the employeetype table which doesn’t help in an output form. Also thinking ah

Re: Normalization question

2017-11-08 Thread Douglas von Roeder via 4D_Tech
John: This is a link to a treasure trove of data models. I checked a couple of the models in the "employees" section and the generic model might provide some ideas.

Re: Normalization question

2017-11-08 Thread Keith Culotta via 4D_Tech
[Project]<--[ProjectEmployeeType]--> [Employee] ? Keith - CDI > On Nov 8, 2017, at 2:06 PM, John Baughman via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > Given a Project table and an Employee table where Employees can be Project > Principles, Project Managers, and Project Supervisors, w

Normalization question

2017-11-08 Thread John Baughman via 4D_Tech
Given a Project table and an Employee table where Employees can be Project Principles, Project Managers, and Project Supervisors, what would be the proper way to create a normalized table structure in 4D. In the end an assigned employee’s information, like name for example, would automatically b

Re: LEP - and Batch files

2017-11-08 Thread Chip Scheide via 4D_Tech
I have tried all of the offered suggestions: Start ?b running without a call to cmd \batchfilename\ extended this to cover the file paths in the batch file none of these result in file copying when started with LEP. HOWEVER the batch file contains a redirect of stderr to a disk file, when run t

Re: LEP - and Batch files

2017-11-08 Thread Chip Scheide via 4D_Tech
for the mac - the paths get translated in POSIX On Wed, 8 Nov 2017 18:49:31 +0100, Peter Bozek via 4D_Tech wrote: > On Wed, Nov 8, 2017 at 6:12 PM, Chuck Miller via 4D_Tech < > 4d_tech@lists.4d.com> wrote: > >> You may have to escape the spaces in the path name >> > > I am not sure if this does

Re: LEP - and Batch files

2017-11-08 Thread Peter Bozek via 4D_Tech
On Wed, Nov 8, 2017 at 6:12 PM, Chuck Miller via 4D_Tech < 4d_tech@lists.4d.com> wrote: > You may have to escape the spaces in the path name > I am not sure if this does not work on Mac only. -- Peter Bozek ** 4D Internet User

Re: LEP - and Batch files

2017-11-08 Thread Chuck Miller via 4D_Tech
You may have to escape the spaces in the path name Regards Chuck Chuck Miller Voice: (617) 739-0306 Informed Solutions, Inc. Fax: (617) 232-1064 mailto:cjmillerinformed-solutions.com Brook

Re: BLOB CONFRONT

2017-11-08 Thread Peter Bozek via 4D_Tech
On Wed, Nov 8, 2017 at 2:50 PM, Arnaud de Montard via 4D_Tech < 4d_tech@lists.4d.com> wrote: > > > I've just tried, something like this: > > BASE64 ENCODE($1_x;$1_t) > BASE64 ENCODE($2_x;$2_t) > $equal_b:=(Position($1_t;$2_t;*)=1) > > $equal_b:=($1_t = $2_t) should be faster (will end at fir

Re: BLOB CONFRONT

2017-11-08 Thread Arnaud de Montard via 4D_Tech
> Le 8 nov. 2017 à 13:02, John DeSoi via 4D_Tech <4d_tech@lists.4d.com> a écrit > : > > You should add a case to compare the size before using the digest method. There is ;-) > Another option not mentioned is comparing the BASE64 encoding. No idea how > that might compare with generating a

Re: LEP - and Batch files

2017-11-08 Thread Chip Scheide via 4D_Tech
I will try that too :) and yes it the path name does contain spaces > > > On Tue, Nov 7, 2017 at 11:45 PM, Chip Scheide via 4D_Tech > <4d_tech@lists.4d.com> wrote: >> >> SET ENVIRONMENT >> VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"true") // wait for it >> to finish >> LAUNCH EXTERNAL P

Re: BLOB CONFRONT

2017-11-08 Thread John DeSoi via 4D_Tech
You should add a case to compare the size before using the digest method. Another option not mentioned is comparing the BASE64 encoding. No idea how that might compare with generating a digest. John DeSoi, Ph.D. > On Nov 8, 2017, at 12:47 AM, Wayne Stewart via 4D_Tech <4d_tech@lists.4d.com>

Re: BLOB CONFRONT

2017-11-08 Thread Arnaud de Montard via 4D_Tech
> Le 8 nov. 2017 à 11:39, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> a > écrit : > > maybe you could add some heuristics based on the kind of data; > compress before hash if the data is text (4D Write, HTML, PDF, etc), I'm not convinced about compressing pdf: sometimes it works but many

Re: BLOB CONFRONT

2017-11-08 Thread Keisuke Miyako via 4D_Tech
maybe you could add some heuristics based on the kind of data; compress before hash if the data is text (4D Write, HTML, PDF, etc), or slice and progressively hash if the data is predominantly large or tends to start with a standard header section. > 2017/11/08 17:11、Wayne Stewart via 4D_Tech <4d

Re: BLOB CONFRONT

2017-11-08 Thread arnaud--- via 4D_Tech
> Le 8 nov. 2017 à 10:38, Arnaud de Montard via 4D_Tech <4d_tech@lists.4d.com> > a écrit : > > [...] > But I was surprised to find: > • sha1 always faster than md5 > • sha2 result very close to md5 Not so surprising, after all:

Re: BLOB CONFRONT

2017-11-08 Thread Arnaud de Montard via 4D_Tech
> Le 8 nov. 2017 à 07:47, Wayne Stewart via 4D_Tech <4d_tech@lists.4d.com> a > écrit : > > Hi, > > Any more thoughts on this? This is what I do currently: > > $oldBLOB_x:=Old($CurrentField_ptr->) > > Case of > : (BLOB size($oldBLOB_x)=0) & (BLOB size($CurrentField_ptr->)=0) > : (Generate d

Re: LEP - and Batch files

2017-11-08 Thread Peter Bozek via 4D_Tech
On Tue, Nov 7, 2017 at 11:45 PM, Chip Scheide via 4D_Tech < 4d_tech@lists.4d.com> wrote: > > SET ENVIRONMENT > VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"true") // wait for it > to finish > LAUNCH EXTERNAL PROCESS("cmd.exe /K > "+$Batch_File_Path;$LEP_Input;$LEP_Output;$LEP_Error) > > -- $B

Re: BLOB CONFRONT

2017-11-08 Thread Wayne Stewart via 4D_Tech
Keisuke, I won't know in advance. It could be anything but most likely stored documents (pdfs etc) Regards, Wayne [image: --] Wayne Stewart [image: http://]about.me/waynestewart On 8 November 2017 at 19:04, Keisuke Miyako via 4D_Tech < 4d_tech@lists.4d.com> w

Re: BLOB CONFRONT

2017-11-08 Thread Keisuke Miyako via 4D_Tech
what is inside the BLOB? > 2017/11/08 15:47、Wayne Stewart via 4D_Tech <4d_tech@lists.4d.com> のメール: > Is there a more efficient mechanism? ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: htt