Re: Can an attribute be removed from an object?

2019-08-23 Thread Douglas von Roeder via 4D_Tech
OB Remove



On Fri, Aug 23, 2019 at 8:57 PM Chris Belanger via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I want to be able to remove attributes from an object. (Not just nullify
> them).
>
> Example:
>
> $en_Rec is an ‘entity’ [Record]
> obj is an OBJECT field for this record
> $en_Rec.obj refers to that field
>
> Now some attributes are defined/set for this object
> $en_Rec.obj.name:=“this”
> $en_Rec.obj.userDisplay:=true
> $en_Rec.obj.userEnter:=true
>
> Later I want to change object field (OBJ)
> I add two attributes:
> $en_Rec.obj.privDisplay:=“All"
> $en_Rec.obj.privEnter:=“Designer"
>
> this is to make the display / entry privilege more specific than a simple
> boolean
>
> but I want to delete the two attributes from this object now:
> $en_Rec.obj.userDisplay:=null
> $en_Rec.obj.userEnter:=null
>
> 
>
> Is this the way to remove attributes from an object?  (i.e. setting the
> value to null?) Seems that the attribute stays, but is now ‘null’.
>
>
> Thanks
> **
> 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
> **

-- 
--
Douglas von Roeder
949-910-4084
**
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
**

Can an attribute be removed from an object?

2019-08-23 Thread Chris Belanger via 4D_Tech
I want to be able to remove attributes from an object. (Not just nullify them).

Example:

$en_Rec is an ‘entity’ [Record]
obj is an OBJECT field for this record
$en_Rec.obj refers to that field

Now some attributes are defined/set for this object
$en_Rec.obj.name:=“this”
$en_Rec.obj.userDisplay:=true
$en_Rec.obj.userEnter:=true

Later I want to change object field (OBJ) 
I add two attributes:
$en_Rec.obj.privDisplay:=“All"
$en_Rec.obj.privEnter:=“Designer"

this is to make the display / entry privilege more specific than a simple 
boolean

but I want to delete the two attributes from this object now:
$en_Rec.obj.userDisplay:=null
$en_Rec.obj.userEnter:=null



Is this the way to remove attributes from an object?  (i.e. setting the value 
to null?) Seems that the attribute stays, but is now ‘null’.


Thanks
**
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: Regex expert needed??

2019-08-23 Thread Keith Culotta via 4D_Tech
This behaves better, in that it works for the whole of both strings.  It could 
still be optimized.  The array that gets returned has all (afaict) the matches.


$str1:="This is my dog"
$str2:="My dog does not have fleas"
  //$str2:="My dog does not have fleas" 

  //$str1:="The quick brown fox jumps over the lazy dog"
  //$str2:="The quick black fox leaps over the laziest dog"

  //$str1:="The quick brownbrown fox jumps over the lazy dog"
  //$str2:="fox leaps over the laziest dog The quick brownbrown"

ARRAY TEXT($aMatch;0)
getCommon2 ($str1;$str2;->$aMatch)

SORT ARRAY($aMatch;<)



  // 
  // Method: getCommon2
  // - 
  // INPUT1: Text
  // INPUT2: Text
  // INPUT3: Pointer - to text array
  // OUTPUT: 
  // 


$str1:=$1
$str2:=$2
$unique:=True
$sepChar:=Char(9)

If (Length($str1)>Length($str2))
$longer:=$str1
$shorter:=$str2
Else 
$longer:=$str2
$shorter:=$str1
End if 

$shortLen:=Length($shorter)
$padStr:=$sepChar*$shortLen
$shorter:=$shorter
$longer:=$padStr+$longer

$longLen:=Length($longer)
$maxLen:=$shortLen*2+$longLen

$loop:=1

ARRAY TEXT($aMatch;0)

Repeat 
Case of 
: ($loop<=$shortLen)  // starting
$pos1:=$shortLen
$pos2:=$shortLen+$loop
: ($loop>=$shortLen) & (($shortLen+$loop)<=$longLen)
$pos1:=$loop
$pos2:=$shortLen+$loop
Else 
$pos1:=$loop
$pos2:=$longLen
End case 

$shorter:=$sepChar+$shorter  // push str1 onto str2
$str3:=$sepChar*($pos2)  // longer than needed?

For ($i;$pos1;$pos2)
For ($j;$pos1;$i)
If ($shorter[[$j]]=$longer[[$j]])
$str3[[$j]]:=$shorter[[$j]]
End if 
End for 
ARRAY TEXT($aTemp;0)
Parse_TextToArray ($str3;->$aTemp;$sepChar;$unique)  // as if 
GET TEXT KEYWORDS let you pick the separator
End for 

$size:=Size of array($aTemp)
For ($m;1;$size)
If (Find in array($aMatch;$aTemp{$m})=-1)
APPEND TO ARRAY($aMatch;$aTemp{$m})
End if 
End for 

$loop:=$loop+1
Until ($pos1>$longLen)

COPY ARRAY($aMatch;$3->)

Keith - CDI

> On Aug 22, 2019, at 3:12 PM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Given 2 strings, 
> I want to find, and return, the longest substring which is the same in 
> both, regardless where in either string the longest substring starts.
> 
> ex: 
> 1- This is my dog
> 2- My dog does not have fleas
> longest common string is 'my dog'
> 
> how to go about this, efficiently?
> I am assuming that there is regex black magic that would do this.
>  

**
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: Regex expert needed??

2019-08-23 Thread Keith Culotta via 4D_Tech
I realize you said "efficiently", but if you ever miss that old Bubble Sort 
feeling...

$str1:="This is my dog"
$str2:="My dog does not have fleas"

$str1:="The quick brown fox jumps over the lazy dog"
$str2:="The quick black fox leaps over the laziest dog"

ARRAY TEXT($aMatch;0)
getCommon ($str1;$str2;->$aMatch)

SORT ARRAY($aMatch;<)


  // 
  // Method: getCommon - needs some optimization
  // - 
  // INPUT1: Text
  // INPUT2: Text
  // INPUT3: Pointer - to text array
  // OUTPUT: 
  // 
$str1:=$1
$str2:=$2

If (Length($str1)>Length($str2))
$longer:=$str1
$shorter:=$str2
Else 
$longer:=$str2
$shorter:=$str1
End if 

$shortLen:=Length($shorter)
$longLen:=Length($longer)
$maxLen:=$shortLen*2+$longLen
$loop:=1
$buildText:=""

Repeat 
ARRAY TEXT($aMatch;0)
For ($i;1;$loop)
$str1:=Substring($shorter;$shortLen-$i)
$str2:=Substring($longer;1;$loop+1)

For ($j;1;Length($str1))
If ($str1[[$j]]=$str2[[$j]])
$buildText:=$buildText+$str1[[$j]]
Else 
APPEND TO ARRAY($aMatch;$buildText)
$buildText:=" "
End if 
End for 

End for 
$loop:=$loop+1
Until ($loop>$maxLen)
 
COPY ARRAY($aMatch;$3->)


Keith - CDI

> On Aug 22, 2019, at 3:12 PM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Given 2 strings, 
> I want to find, and return, the longest substring which is the same in 
> both, regardless where in either string the longest substring starts.
> 
> ex: 
> 1- This is my dog
> 2- My dog does not have fleas
> longest common string is 'my dog'
> 
> how to go about this, efficiently?
> I am assuming that there is regex black magic that would do this.
>  

**
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: Regex expert needed??

2019-08-23 Thread Chip Scheide via 4D_Tech

well...
if there is a double space in one and not the other then the longest duplicated 
string would be ' dog'.
So that answer would be correct.

Also, over all, I would be interested in character duplication rather then word 
duplication.

Thanks
for all the input!!

Chip

> That’s rather what I thought, in which case it won’t work for Chip’
> s original query.
> 
>> On 22 Aug 2019, at 21:12, Chip Scheide via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> Given 2 strings, 
>> I want to find, and return, the longest substring which is the same in 
>> both, regardless where in either string the longest substring starts.
>> 
>> ex: 
>> 1- This is my dog
>> 2- My dog does not have fleas
>> longest common string is 'my dog’
> 
> 1 - This is my  dog// note double space after 
> “my” 
> 2 - My dog does not have fleas
> 
> longest common string is “ dog “ (and in Chip’s example, it’s 
> actually “my dog “).
> 
> Jeremy
> 
>> On 23 Aug 2019, at 13:46, Keisuke Miyako via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> GET TEXT KEYWORDS breaks strings the same way as when you 
>> double-click a word in a text editor.
>> 
>> spaces, tabs, etc. are boundaries,
>> commas periods and apostrophes depend on the context.
>> 
>> e.g. (one word)
>> 1,000,000 (one word)
>> Macy's (one word)
>> 
>> http://userguide.icu-project.org/boundaryanalysis
>> 
>> 2019/08/23 21:39、Jeremy Roussak via 4D_Tech 
>> <4d_tech@lists.4d.com>のメール:
>> What about double spaces?
> **
> 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
> **

Hell is other people 
 Jean-Paul Sartre
**
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: Regex expert needed??

2019-08-23 Thread Jeremy Roussak via 4D_Tech
That’s rather what I thought, in which case it won’t work for Chip’s original 
query.

> On 22 Aug 2019, at 21:12, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Given 2 strings, 
> I want to find, and return, the longest substring which is the same in 
> both, regardless where in either string the longest substring starts.
> 
> ex: 
> 1- This is my dog
> 2- My dog does not have fleas
> longest common string is 'my dog’

1 - This is my  dog// note double space after “my” 
2 - My dog does not have fleas

longest common string is “ dog “ (and in Chip’s example, it’s actually “my dog 
“).

Jeremy

> On 23 Aug 2019, at 13:46, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> GET TEXT KEYWORDS breaks strings the same way as when you double-click a word 
> in a text editor.
> 
> spaces, tabs, etc. are boundaries,
> commas periods and apostrophes depend on the context.
> 
> e.g. (one word)
> 1,000,000 (one word)
> Macy's (one word)
> 
> http://userguide.icu-project.org/boundaryanalysis
> 
> 2019/08/23 21:39、Jeremy Roussak via 4D_Tech 
> <4d_tech@lists.4d.com>のメール:
> What about double spaces?
**
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: Regex expert needed??

2019-08-23 Thread Keisuke Miyako via 4D_Tech
GET TEXT KEYWORDS breaks strings the same way as when you double-click a word 
in a text editor.

spaces, tabs, etc. are boundaries,
commas periods and apostrophes depend on the context.

e.g. (one word)
1,000,000 (one word)
Macy's (one word)

http://userguide.icu-project.org/boundaryanalysis

2019/08/23 21:39、Jeremy Roussak via 4D_Tech 
<4d_tech@lists.4d.com>のメール:
What about double spaces?



**
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: Regex expert needed??

2019-08-23 Thread Jeremy Roussak via 4D_Tech
What about double spaces?

Jeremy

> On 23 Aug 2019, at 13:28, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Arnaud,
> Good point. If collections aren't available GET TEXT KEYWORDS would be the
> easy solution.
> 
> On Fri, Aug 23, 2019 at 3:20 AM Arnaud de Montard via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> 
>>> Le 23 août 2019 à 06:52, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com>
>> a écrit :
>>> 
>>> And as I think about it you need to deal with the multiple match issue
>>> better:
>> 
>> Hi Kirk,
>> still not well awake and too lazy understand if your algorithm was based
>> on chars or words. If it's the former, I'd suggest the use of GET TEXT
>> KEYWORDS to produce 2 arrays of words to compare. In the resulting array
>> words keep ordered as in the text, it may help if the wanted match is the
>> sequence of words.

**
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: Regex expert needed??

2019-08-23 Thread Kirk Brooks via 4D_Tech
Arnaud,
Good point. If collections aren't available GET TEXT KEYWORDS would be the
easy solution.

On Fri, Aug 23, 2019 at 3:20 AM Arnaud de Montard via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
> > Le 23 août 2019 à 06:52, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com>
> a écrit :
> >
> > And as I think about it you need to deal with the multiple match issue
> > better:
>
> Hi Kirk,
> still not well awake and too lazy understand if your algorithm was based
> on chars or words. If it's the former, I'd suggest the use of GET TEXT
> KEYWORDS to produce 2 arrays of words to compare. In the resulting array
> words keep ordered as in the text, it may help if the wanted match is the
> sequence of words.
>
> --
> Arnaud de Montard
>
>
>
> **
> 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
> **



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

Re: Win32API setup woes

2019-08-23 Thread Chuck Miller via 4D_Tech
What drive are you putting the result. I have found problems when on c 

Regards 

Chuck

Sent from my iPhone

> On Aug 23, 2019, at 7:20 AM, David Garrard via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hello Keisuke and Timothy,
> 
> I have isolated things to a simple new structure "TestDB.4db" that has one 
> method that calls a couple Win32API commands.
> 
> I downloaded the latest Win32API for Github and have placed it in the 
> \Plugins directory next to this structure.  There is no \Win4DX directory for 
> this test setup. 
> 
> On one Windows computer this structure shows up correctly in the 4D Explorer 
> and is enabled - version 8.2.2.  When I execute code with the Win32API 
> commands on this computer all is good. 
> 
> On the other Windows computer this structure shows up in the 4D Explorer, but 
> is marked as Disabled - need to upgrade.
> 
> Both these computers have Microsoft Visual C++ redistributables installed.  
> X86 and 64bit.
> 
> Both are using v16.3 Build 16.217894 32 bit.
> 
> One thing that might be associated is that when I compile the compiled 
> structure is placed in a directory entitled "STR#  10135,18", instead of 
> "Compiled Structure".  I had ignored this since I am seeing the Disabled 
> state of the plugin in the interpreted database, but perhaps there is some 
> string resource issue that might be causing this problem. So if anyone knows 
> how to fix that issue, it may address the disabled plugin issue. 
> 
> Thank you,
> 
> David 
> 
> -Original Message-
> From: Keisuke Miyako [mailto:keisuke.miy...@4d.com] 
> Sent: August 21, 2019 7:58 AM
> To: dgarr...@gmail.com; 4D iNug Technical <4d_tech@lists.4d.com>
> Subject: Re: Win32API setup woes
> 
> license error is the default exception when a plugin call fails. the real 
> cause could be anything.
> 
> first you should check in 4D's explorer that the plugin is loaded. if not, 
> you'd get the licensing error.
> 
> maybe you are missing vc runtimes. maybe the architecture doesn't match. keep 
> in mind that 4dx folders are not supported in 64bit since v12, and all 
> platforms sine v14.
> 
> 
> 
> 
> 株式会社フォーディー・ジャパン
> 宮古 啓介
> テクニカルサービスマネージャー
> 〒150-0043 東京都 渋谷区道玄坂1-10-2-6F
> 
> Phone : 03-4400-1789
> Fax :   03-6427-8449
> Email : keisuke.miy...@4d.com
> Web :   jp.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
> **

**
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: Regex expert needed??

2019-08-23 Thread Keisuke Miyako via 4D_Tech
for reference:

simple diff tool for 4D

https://github.com/miyako/4d-plugin-diff-match-patch




**
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: Win32API setup woes

2019-08-23 Thread David Garrard via 4D_Tech
Hello Keisuke and Timothy,

I have isolated things to a simple new structure "TestDB.4db" that has one 
method that calls a couple Win32API commands.

I downloaded the latest Win32API for Github and have placed it in the \Plugins 
directory next to this structure.  There is no \Win4DX directory for this test 
setup. 

On one Windows computer this structure shows up correctly in the 4D Explorer 
and is enabled - version 8.2.2.  When I execute code with the Win32API commands 
on this computer all is good. 

On the other Windows computer this structure shows up in the 4D Explorer, but 
is marked as Disabled - need to upgrade.

Both these computers have Microsoft Visual C++ redistributables installed.  X86 
and 64bit.

Both are using v16.3 Build 16.217894 32 bit.

One thing that might be associated is that when I compile the compiled 
structure is placed in a directory entitled "STR#  10135,18", instead of 
"Compiled Structure".  I had ignored this since I am seeing the Disabled state 
of the plugin in the interpreted database, but perhaps there is some string 
resource issue that might be causing this problem. So if anyone knows how to 
fix that issue, it may address the disabled plugin issue. 

Thank you,

David 

-Original Message-
From: Keisuke Miyako [mailto:keisuke.miy...@4d.com] 
Sent: August 21, 2019 7:58 AM
To: dgarr...@gmail.com; 4D iNug Technical <4d_tech@lists.4d.com>
Subject: Re: Win32API setup woes

license error is the default exception when a plugin call fails. the real cause 
could be anything.

first you should check in 4D's explorer that the plugin is loaded. if not, 
you'd get the licensing error.

maybe you are missing vc runtimes. maybe the architecture doesn't match. keep 
in mind that 4dx folders are not supported in 64bit since v12, and all 
platforms sine v14.




株式会社フォーディー・ジャパン
宮古 啓介
テクニカルサービスマネージャー
〒150-0043 東京都 渋谷区道玄坂1-10-2-6F

Phone : 03-4400-1789
Fax :   03-6427-8449
Email : keisuke.miy...@4d.com
Web :   jp.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: Regex expert needed??

2019-08-23 Thread Arnaud de Montard via 4D_Tech

> Le 23 août 2019 à 06:52, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> And as I think about it you need to deal with the multiple match issue
> better:

Hi Kirk, 
still not well awake and too lazy understand if your algorithm was based on 
chars or words. If it's the former, I'd suggest the use of GET TEXT KEYWORDS to 
produce 2 arrays of words to compare. In the resulting array words keep ordered 
as in the text, it may help if the wanted match is the sequence of words. 

-- 
Arnaud de Montard 



**
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: [ANN] AJI_Button 1.0

2019-08-23 Thread Daniel Solenthaler via 4D_Tech
Awesome work, very impressive!

GUI is so important!

Thanks!
Daniel


> Am 20.08.2019 um 16:33 schrieb 4d_tech-requ...@lists.4d.com:
> 
> We are proud to announce our new Buttons 4D component : 
> 
>  * * * AJUI_Button * * * 
> 
> 
> AJUI_Button is a modern button generator that offers a lot of flexibility and 
> more freedom to design your interface.
> 
> The component offers several methods to customize and manipulate your buttons 
> using an object with Getters and Setters created using the New Formula 
> feature of 4D V17R3.
> 
> Because it is using a picture variable you don't have the constraints of the 
> 3D Buttons (not focusable, not tabbable)
> 
> We provide an "How Do I" application "AJUI_ButtonLab" which will help you to 
> test and understand what you can do with this component. 
> 
> Buttons are drawn on SVG which creates beautifully rendered buttons on Mac 
> and Windows.
> 
> Give it a try :
> 
> https://ch-fr.4d.com/ajuibutton 
> 
> https://ch-de.4d.com/ajuibutton 
> 
> AND it's free !
> 
> NB : Minimum requirements : 4D v17R5
> 
> 
> Maurice Inzirillo
> -- 
> AJAR S.A.
> 
> https://ch-fr.4d.com 
> twitter: ajar_info
> Tél : +41 (0)323422684
> 

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