This episode premiered live on our YouTube at 12pm PST on Thursday 23rd March 2023. Use the hashtag #PowerPlatformConnects on social media for a chance to have your work featured on the show!Ġ:00 Cold Open 00:24 Show Intro 01:02 Shane Young Interview 22:00 Blogs & Articles 22:20 Integrate FullCalendar.io with Power Pages 23:50 Text Data 25:15 Zero to Hero Power Apps Saga 25:44 Parent Hub Association 26:33 Using Custom Values for OneNote Power Automate References 28:04 Dynamics Power Israel 28:44 Create Beautiful Canvas Apps in Dataverse for Teams 30:36 Outro & BloopersĬheck out the blogs and articles featured in this week’s requested: Feel free to provide feedback on how we can make our community more inclusive and diverse. It's easy to create one: Guid.Episode Six of Power Platform Connections sees David Warner and Hugo Bernier talk to talk to Business Applications MVP Shane Young, alongside the latest news, product updates, and community blogs. I really don't like the idea of being constrained to 15 digits for a unique ID. It also could fail if there are multiple processes running this code (because the lock is local to a process.) So if this code appears in a component that is loaded into a process (like a plug-in, or even a custom control) then it is bogus. My opinion, that would be unacceptably slow. If I had taken 300-400 pictures (as I sometimes do) then this takes 30-40 seconds. The idea was to generate a unique ID for each picture I took off my camera, then to generate the 50 or so IDs for all the pictures I took would take 5 seconds. This may not be so bad depending on the application, but if, for example, So if the intended application is to generate unique ids for objects, you are limited to doing one of these operations every 100ms. Otherwise it could fail when the clocks roll back as we leave daylight savings time and switch to standard time. If a conflict means duplicate entries in a database then check for the existence of the new id before using it.Īt the very least, please use UTC rather than local time. The file system, and if there is, then try again. For example, if a conflict means duplicate file names on disk, then futhermore assert that there is no duplicate by checking With this technique, I strongly suggest that you use the domain of potential conflict to define what your algorithm should be. Thread.Sleep to ensure that you get two distinct times at the tenth of second. Lock to ensure that no two threads run your code at the same time. Running within the scope of a single instance of the program then his code will work (although it will be the least efficient). If there will be more than one instance of the program, and it will be running on different machines (unless they can communicate through a database, a webserver, or something along those lines) then Louis' solution won't work. This code may run in the same process yet on different threads, however, it will surely run in different machines. It seemed to me that the solution that pointed is the most suitable, however, some of the questions raised in this thread may limit this choise: If you can increase the size of what you're storing you could use a GUID. You can turn a GUID into a number easily enough you just need to have 128 bits of data, which your OP apparently states you don't. I was reading carefuly your suggestions, however my requirement is that the resunting value must be numeric, so Guid is excluded. Hi, thank you all in first place for your help. If you can up the number of digits (or just use a GUID) you can effectively GUIDs would be much, much better simply because of their very large range of random numbers. This may or may not be good enough for your purposes. 15 digits (~50 base 2 digits) will have a reasonably low collision rate for 2^25 (~34 million) values ( Reference The probability of collisions is dependent on the range of the numbers generated. You can use a timestamp, but you will need to ensure none are generated with X unit of time of each other, and after Y unit of time you will have run out of all possible values, starting over again and possibly having duplicates.You can either do what you've said you can and keep a repository of all of the existing IDs (or some place to have a shared counter) so that you can just have IDs increasing by one.You say that random doesn't guarantee uniqueness (which is true) and then suggest using a GUID, which is little more than a very big random number. If I were you, I'd obtain an unique value via Guid.NewGuid(), which can easily be converted to decimal. Random doesn't guarantee uniqueness, you can throw dices and have 5s appear two or three Two people may click within the same second and get the same random digit (a 10% chance If I were you, I wouldn't use the () strategy.
0 Comments
Leave a Reply. |