​Re: UUID vs Longint primary key

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

​Re: UUID vs Longint primary key

4D Tech mailing list
On Mon, Aug 7, 2017 at 11:51 AM, <

<[hidden email]>

[hidden email]> wrote:

>
> ​[snip]
>
> On the other hand, you do model the data after business relations, but the
> keys that tie that relation data need/should never be seen in a well
> designed system. If a user readable key is needed by business, then there
> should be another data piece that the user can read (like an MRN, medical
> record number, or an abbreviation that is unique and human readable) But
> these should never be used to link together data in a structure in primary
> key foreign key relation.
> ​ [snip]​
>
>
>
+1 My point exactly, only stated much better.​


----------------------------
Steve Simpson
**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ​Re: UUID vs Longint primary key

4D Tech mailing list
It might be my memory, but I do not think that is how it worked in the beginning I was working on relational model dbs before SQL was a language

Rdb at DEC for example.

That was one of the ket differences between model types how you created and maintained the relations. I do not believe that there was even a thought of primary keys

Regards

Chuck
------------------------------------------------------------------------------------------------
 Chuck Miller Voice: (617) 739-0306
 Informed Solutions, Inc. Fax: (617) 232-1064      
mailto:miller.cjay<AT SIGN>gmail.com <http://gmail.com/>
 Brookline, MA 02446 USA Registered 4D Developer                
       Providers of 4D and Sybase connectivity
          http://www.informed-solutions.com 
------------------------------------------------------------------------------------------------


> On Aug 7, 2017, at 12:14 PM, steve simpson via 4D_Tech <[hidden email]> wrote:
>
>>
>>
>> On the other hand, you do model the data after business relations, but the
>> keys that tie that relation data need/should never be seen in a well
>> designed system. If a user readable key is needed by business, then there
>> should be another data piece that the user can read (like an MRN, medical
>> record number, or an abbreviation that is unique and human readable) But
>> these should never be used to link together data in a structure in primary
>> key foreign key relation.
>> ​ [snip]​
>>
>>
>>
> +1 My point exactly, only stated much better.​

**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ​Re: UUID vs Longint primary key

4D Tech mailing list
In reply to this post by 4D Tech mailing list
Since it sounds like pretty much everyone uses UUIDs for links (me too,
although I may not have an actual arrow drawn), maybe se can turn this
thread in a different direction? Given that random synthetic keys do
nothing to avoid duplicate rows - and may actually make duplicate rows more
likely - what do people do to avoid duplicates. To be clear what I mean by
a duplicate:

1  Keller  123
2  Keller 123
3  Keler 123

Rows 1 and 2 are duplicates, row 3 is not. It might be messy/bad data, it
might not - but there's no way for the engine to know that. 1 and 2 are
duplicates, despite having unique made up numbers for a key. So, the
question is: How do you deal with that problem? Here are some solutions
I've used and/or seen:

* Cover your ears and say "neyh, neyk, neyh I CAN'T HEAR YOUR!" It's not a
great technique, but it is simple and cheap to implement.

* Ignore the possibility of duplicate rows unless/until it obviously bites
you. Depending on data, this might be good enough. In same cases, it's just
not acceptable. (Screwing up 100 log Web lines out of 1,000,000?
Meaningless. Screwing up 100 transactions in your accounts? Yeah, not
allowed.)

* Carefully program your system to detect and prevent duplicate rows:
-- at point of entry (client-side/UI, etc.)
-- at the engine level (triggers, indexes)

* Do after-the-fact audits. Either on demand or on a schedule.

That's pretty much the world of techniques I've seen.

Any thoughts?
**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Using c_object for passing parameters

4D Tech mailing list
I started using the c_object just recently and am finding more and more places to adapt it’s use. I thought my latest revelation was interesting, at least to me. I was creating a process that involves several levels of user interaction. In other words the user is presented with a list with options that create a different list with options that create a different list, etc. All when completed returning back to the previous list.

I like to use local variables as much as possible and I soon found myself creating too many local variables like $button, $button2, $button3, etc. I was also stepping on local variables  too often when I forgot to create a unique variable for the list being displayed. At first blush I was going to just push each list off to it’s own method. I hate doing this as too many methods in a unique process just gets too messy.

Then it dawned on me to use c_object for the parameters and keep all the lists in the same method. To me and my simple mind I thought this was pretty cool, perhaps someone else might find the thought process interesting or even useful so I have pasted a code snippet below….

John

--------------------------------------------
//Initial call from another method…
C_OBJECT($oParams)
$oParams:=New object("action";"DoProcedures";"date";$aDate{Size of array($aDate)}) //plus other paams...
AptLenghtMigrate_Procedures ($oParams)

------------------------------------------
// *** Method: AptLenghtMigrate_Procedures ***
C_OBJECT($oParams)
ARRAY LONGINT($aProcedureSeq;0)  //need this because the array will be put in a c_object later
ARRAY LONGINT($aProcedureMIgrationLength;0)  //need this because the array will be put in a c_object later

$oParams:=$1
$action:=$oParams.action
$startDate:=Date($oParams.date)

Case of
   : ($action="DoProcedures")
        ALL RECORDS([Procedure])
        SELECTION TO ARRAY([Procedure]_Procedure_Sequence;$aProcedureSeq;[Procedure]Migration_Procedure_Length;$aProcedureMIgrationLength) //plus more arrays…

        Repeat
            //Display the procedures to the user and provide options
           Case of
                 : ($button=4) //user selected option 4 to list appointments scheduled after $startDate
                        OB SET ARRAY($oParams;"procedure_sequences";$aProcedureSeq)
                        OB SET ARRAY($oParams;"procedure_m_lengths";$aProcedureMIgrationLength)
                        $oParams.action:="ListAppointments"
                        AptLenghtMigrate_Procedures ($oParams)
              End case
         Until ($Button=1)

  : ($action="ListAppointments")
        QUERY([Appointment];[Appointment]Appointment_Date>=$startDate)
        SELECTION TO ARRAY([Appointment]Appointment_Date;$aAppointmentDate;[Appointment]_Chair_Sequence;$aChairSequence)  //plus more arrays...

        Repeat
             //Display the scheduled appointments to the user and provide options

             If ($Button=1) //user selected option 1 to list appointments scheduled on a selected date and chair with procedure lengths
                   $oParams.chair_date:=$aAppointmentDate{$line}
                   $oParams.chair_sequence:=$aChairSequence{$line}
                  $oParams.action:="ListChairAppointments"
                  AptLenghtMigrate_Procedures ($oParams)

             End if

          Until ($done)

   : ($action="ListChairAppointments")
          OB GET ARRAY($oParams;"procedure_sequences";$aProcedureSeq)
          OB GET ARRAY($oParams;"procedure_m_lengths";$aProcedureMIgrationLength)
          //will use the 2 arrays created in the initial call to get migration lengths for each scheduled procedure

          QUERY([Appointment];[Appointment]Appointment_Date=Date($oParams.chair_date);*)
          QUERY([Appointment]; & ;[Appointment]_Chair_Sequence=$oParams.chair_sequence)
          SELECTION TO ARRAY(….

          Repeat
               //Display the chair appointments to the user and provide options
               Case of
                      : ($Button=3)  //etc...
               End case
          Until ($Done)

    :($action=“etc….")
               //etc…

    :($action=“etc….")
               //etc…

End case



John Baughman
Kailua, Hawaii
(808) 262-0328
[hidden email]





**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Anybody using the TimePicker widget - TimePicker SET STEP

4D Tech mailing list
I have been using this for a very long time and always with a 45 min step. Now I need to set it to a 10 min step Y calling..

        TimePicker SET STEP ($ObjectName;?00:10:00?)

Nothing happens. It stays at 45 mins.

Any ideas?

John


       
John Baughman
Kailua, Hawaii
(808) 262-0328
[hidden email]





**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Anybody using the TimePicker widget - TimePicker SET STEP

4D Tech mailing list
OK. I figured it out. The sample code in the picker method calls TimePicker SET STEP in the On Load form event. That does not work. Apparently it has to be called after the form is loaded. So I set a timer and am call all the setup commands in the On Timer event. Works now.

Also if you are passing a default value, be sure to assign it to the picker after you have set the step or it will be handled with the default step and might get rounded to fit the step.

BTW, I had a typo in my original message. 45 mins is not a valid step for the picker. It should have red 15 mins.

John


> On Aug 9, 2017, at 3:14 PM, John Baughman via 4D_Tech <[hidden email]> wrote:
>
> I have been using this for a very long time and always with a 45 min step. Now I need to set it to a 10 min step Y calling..
>
> TimePicker SET STEP ($ObjectName;?00:10:00?)
>
> Nothing happens. It stays at 45 mins.
>
> Any ideas?
>
> John
>
>
>
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> [hidden email]
>
>
>
>
>
> **********************************************************************
> 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:[hidden email]
> **********************************************************************

John Baughman
Kailua, Hawaii
(808) 262-0328
[hidden email]





**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Anybody using the TimePicker widget - TimePicker SET STEP

4D Tech mailing list
it works on ON LOAD, but the widget's variable must be declared with C_TIME,
or set to create a form local (no variable name, type=time in property list.)

and the widget must be used on page 0 or 1.

> 2017/08/10 16:13、John Baughman via 4D_Tech <[hidden email]> のメール:
> The sample code in the picker method calls TimePicker SET STEP in the On Load form event. That does not work.




**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Anybody using the TimePicker widget - TimePicker SET STEP

4D Tech mailing list
 "form local" = new (and much better) name for a dynamic variable?


--
Douglas von Roeder
949-336-2902

On Thu, Aug 10, 2017 at 2:17 PM, Keisuke Miyako via 4D_Tech <
[hidden email]> wrote:

> it works on ON LOAD, but the widget's variable must be declared with
> C_TIME,
> or set to create a form local (no variable name, type=time in property
> list.)
>
> and the widget must be used on page 0 or 1.
>
> > 2017/08/10 16:13、John Baughman via 4D_Tech <[hidden email]> のメール:
> > The sample code in the picker method calls TimePicker SET STEP in the On
> Load form event. That does not work.
>
>
>
>
> **********************************************************************
> 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:[hidden email]
> **********************************************************************
>
**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Anybody using the TimePicker widget - TimePicker SET STEP

4D Tech mailing list
In reply to this post by 4D Tech mailing list

> On Aug 10, 2017, at 11:17 AM, Keisuke Miyako via 4D_Tech <[hidden email]> wrote:
>
> and the widget must be used on page 0 or 1.

Ah Ha! That was the problem. My widget is on page 2. In any event works in an on timer event.

John



John Baughman
Kailua, Hawaii
(808) 262-0328
[hidden email]





**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Anybody using the TimePicker widget - TimePicker SET STEP

4D Tech mailing list
Is the page one requirement documented anywhere. Looked and could not find it.

If not, perhaps it should be.

John


> On Aug 10, 2017, at 12:01 PM, John Baughman <[hidden email]> wrote:
>
>
>> On Aug 10, 2017, at 11:17 AM, Keisuke Miyako via 4D_Tech <[hidden email] <mailto:[hidden email]>> wrote:
>>
>> and the widget must be used on page 0 or 1.
>
> Ah Ha! That was the problem. My widget is on page 2. In any event works in an on timer event.
>
> John
>
>
>
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> [hidden email] <mailto:[hidden email]>
>
>
>
>
>

John Baughman
Kailua, Hawaii
(808) 262-0328
[hidden email]





**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Anybody using the TimePicker widget - TimePicker SET STEP

4D Tech mailing list
Hi John,

I found this as the first hit when I searched kb.4d.com for the term widget:
Tech Tip: TimePicker widget can only be modified if placed on page 0 or 1 of the form
http://kb.4d.com/assetid=77479

Hit #3 in the list was this:
Tech Tip: Using widgets on page 2+
http://kb.4d.com/assetid=76861

-Tim




**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

livedoc 4D v16 R5??

4D Tech mailing list
In reply to this post by 4D Tech mailing list
Just on the livedoc site and noticed a new tab… 4D v16 R5

Nothing in the tab, but the next tab over is 4D v16 R4 BETA. Hmmmm what's up with that? Probably just a transient thing and likely a mistake, but interesting.

John


John Baughman
Kailua, Hawaii
(808) 262-0328
[hidden email] <mailto:[hidden email]>
**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Batch file and 4DLink file on windows 2008 server

4D Tech mailing list
In reply to this post by 4D Tech mailing list
I have a batch file for 4D server working to start 4D Server when the machine starts up.

I am trying to create a batch file for 4D client, but cannot get the client to open the remote database. This is for a client on the same machine as the server. The batch file looks like this…

START "" "C:\Program Files (x86)\4D\4D v16.1\4D\4D.exe" "C:\Users\Administrator\AppData\Roaming\4D\Favorites v16\Remote\QDGDocs.4Dlink”

The client opens but does not connect to the server. I copied the path to the 4DLink file so I am certain that it is correct, and this is the only 4DLink file on the computer besudes the one for the server. The 4DLInk file looks like this…

<?xml version="1.0" encoding="UTF-8"?><database_shortcut is_remote="true" server_database_name="QMCDocs" server_path="168.213.234.121”/>

What am I missing?

John


John Baughman
Kailua, Hawaii
[hidden email] <mailto:[hidden email]>





**********************************************************************
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:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Batch file and 4DLink file on windows 2008 server

4D Tech mailing list
John,

I use this in a batch file successfully all the time.  Your code looked good to me.  Perhaps you could try moving the .link file to another location like the root of the C: drive and see if that makes a difference.

start "" "C:\Program Files\4D\4D v13.5 HF1\4D\4D.exe" "C:\mydblinkfile.4DLink"

Thanks
Justin Will
**********************************************************************
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:[hidden email]
**********************************************************************
Loading...