mergeconflict216 James: [00:00:00] Frank, Frank, Frank, Frank Kruger. Today, we talk about the one thing that is infinite, that we have never talked about in 225,000 episodes of merge conflict. It's the one thing that can be generated infinitely. Over and over again, it is one of the most important things in programming that we don't talk about any, yet we use and abuse this beautiful data structure. Frank, do you know what I'm talking about? I Frank: [00:00:38] was going to go with fractals. I was so excited for a fractal. Yeah. But then you said we use them and I never actually use fractals. So my next guest is. I innumerable James: [00:00:50] no. Today, Frank, we are talking about the Gwynedd. Frank: [00:00:57] Oh gosh. Okay. I know where this is coming from. I saw your tweet earlier today, today. I don't know, time doesn't exist. Why am I even using that metric? Uh, you were complaining that you needed yourself some random numbers with some random hyphens placed between them, perhaps. Like, I don't even remember how many are there, like 30 of them, 32 of them either way. Uh, you needed to go in and you are complaining that like, you can't get a good, like it's been baked into visual studio forever. Go with generation. James: [00:01:28] What's up, man. Yes, I wanted, and I need at my disposal, Frank Kruger, 128 bits of pure randomness, deliciousness, Frank, do you know what is inside of a grid? Do you know? Do you know, Frank: [00:01:39] actually I know a lot about goods and in fact, it's not purely random, some parts of it aren't random at all. Uh, but it really just goes by your definition of them, but I don't want to steal your thunder. So please continue. Pretend I know nothing about the go ahead. James: [00:01:54] It's very correct. And I'm glad that you are correct because they are not random. The fact that they are global unique, but they are not. If you basically take a substring of them, they are not. And also, yes, you are correct. This parts of them are not random either. It's very interesting. Now I needed this Frank, um, I, what I wanted, here's what I really want is I tweeted to the people and I said, I want, I want a grid. I want a grid on demand service I need at any anytime, Frank, no matter where I'm at, I don't care where I'm at right now. Am I on the desktop? Am I in a browser? Am I, um, inside a teams? Am I inside of Zencaster? I want a grid. I say, give me a grid. I get a grid and I can paste it with Frank. I literally just went over here. Got to go in. I just posted you a grid. That's what I want to do. I want grids. On demand as a service grids, as a service gas, I want gas. Frank: [00:02:53] Okay. How could I possibly respond to that? What's give you gas, James, let's get you from gas. That's really sounds like a Scott Hanselman, but wasn't he all about the goods at one point where he was like, here's a good someone, someone else was about the goods before you. I'm just saying you're not, you're not being hipster enough for me, but. Let me also say before I get started, I have like a little bit of PTSD with, to it. So moving on. James: [00:03:18] Okay. So, so the reason I needed this is, uh, I mean, I love grids. I think they're fantastical, but I am managing lens, a new live stream initiatives that we're doing, uh, with my team with Galloway and Fritz and Jamie we're, we're all doing these. Um, more streaming on visual studio and dinette properties on Twitch and YouTube. And most of the shows are managed via YouTube playlists and magic, but we're also having sort of a, kind of like a. Keep it simple, Jason file for some specific shows and I need a unique identifier. And I said, well, what's better than a Gwinnett as a unique identifier. So how I update these shows and you may have done this before, when you're doing like messing around with mock data or, you know, in code is you often like start to have some Jason or some code and you have an ID and then you say, give me a grid. And if I was inside of visual studio or vs code or some other editor, Yes, Frank, it coulda went to tools and said, give me a grid. But I was inside of a get hub editing file. Like, you know, you're in get hub. You're like edit file and I'm adding an entry and I want to be like, give me the grid. Give me my bread and I didn't have that. So I asked the internet and every one's a Joe to use visual studio like you did, because you were being cranky. You're being Qatari. And I'm like a Frank I'm I'm stubborn today. I don't like it anyways. Frank: [00:04:43] So, so you want OSTP level integration here? Um, Aye. You don't see these too often windows, I guess maybe like you can integrate into shell, but that's not even where you want it. Yeah. We want to be integrated into all text boxes. So you got to integrate into the, I M I N E system. I'm not even sure if you can integrate into all the boxes. Fortunately, I think it's a little bit easier to do things like, um, gosh, what's the. I'm trying to think. There's a snippet thing that a lot of Mac users use where, you know, you just, if you're always typing in your email address, you know, you can type email, hit tab and have tab completion. So I've seen apps like that, which try to do O S level. So I'm curious, um, a, what did the internet recommended that were there any OSTP level things or be, were, was it all still like if you're not like Chrome or Safari. Could you get it to work? James: [00:05:41] Yeah. So a lot of people, a lot of people extensions, there are a lot of different extensions out for edge and Chrome and things like that. Uh, they do different things. There's one that's really fascinating and I'll make a links to everything in the show notes as well. But there's one that's really fascinating. You can do like control shift five or something and it'll, you know, It'll look for that key combo and then put it in your clipboard, which is kind of nice. But then I said, I don't know if I want someone watching my keyboard. That seems crappy. I don't like that. Frank: [00:06:15] Well, okay. So the good news is, uh, Calca actually has a mode on Mac where you can register global key bindings. So anytime someone hits this global key binding, my app gets activated. I get to execute some code. So it's not like I'm monitoring your keyboard. It's just. You know, it's a thing. The part that I don't know on the Mac side is whether I could, um, check what the active window is, find the active editor and, and, you know, do an insert text kind of command to it. I'm not sure, never tried that kind of stuff. So I'm curious. James: [00:06:50] Yeah. And then I, you know, and I thought that was like a pretty cool idea of, of having keyboard shortcuts and whatnot, but I think the browser would have to be open or you'd have to allow Chrome extensions to run in the back. I'm like, I don't want that shenanigans. Frank: [00:07:04] Oh, that was still a browser extension. That's still weird. James: [00:07:07] Yeah. Still a browser extension, which I just didn't, it didn't sit well with me, you know? But the other ones that I'm using right now, I'm using one that is called, I think it's called copy of squid. Yeah, it's called and it's just a button that you click and it just puts it in your clipboard. So it's in the browser still. So it's always there. Now. I did get the traditional, uh, open visual studio, open vs code. I also got a lot of scripts. A lot of people gave me PowerShell scripts and Python scripts, and they said, just run this script and you'll get a go ahead. I want to run a script. I want to right. Click. Insert Gwen and I, I don't have it. I literally don't have it. The, the number, yeah. One recommendation was let's add this feature to power tools for windows, which is a sort of global toolbox of awesomeness, um, that, that, that kind of runs on your computer. Like they have stuff that like resizes images and stuff, and I'm assuming there's probably similar tools on Mac that would do that, but that's sort of like always running app. Frank: [00:08:12] Not to sidetrack, but I love power tools when I was a windows user. I would always do that, that kind of immediately back in the day. It's the one that would give you all the weird options that were in the OSTP, but not exposed in other UI layers. So that's kind of what we used it for in the past nowadays, it's just a bunch of crazy, nice tools. Um, Yeah, it's funny. It's so you're saying today, right now, James Monta Magno on windows. This is on windows. Uh, you can't get an OS level version of this. James: [00:08:44] I, I don't think so. Uh, I mean, there's a few people that there's a few people that like sent me some random, most people said, use code, use PowerShell. You know, I'm, I'm looking, I'm going through it there. Frank: [00:09:04] Katie I'm calling them script. Katie. James: [00:09:06] Yeah. Andrew NASDAQ says here's a tool that I wrote called dev comrade and it does a bunch of other stuff, but then also has like, right-click gimme a grid. So that's, that's one thing I'll post that in the show. That's why not me? Uh, I don't. Thing. I see very much. And I apologize. Cause you know, the Twitter to Twitter threading is really weird now. So yeah, this might be the closest, but. I'm not convinced, you know what I mean? That, that, that there's weight on demand that I want. Frank: [00:09:39] I have seen the most viruses apps takeover, the default menus in windows. You know, maybe today security has gotten better on windows, but I've seen apps insert themselves all over the place. And the very worst case you could have an app set there, insert itself into the wind proc. Of every running process of every running thread and every running process and do it yourself. Um, but I also think that the, um, input system in windows is very configurable. It's a good input system. And I feel like, uh, and who actually understands windows could right. This kind of in their sleep, because they would just know the right API to expose, to get a proper language insertion menu here. Cause that's basically what you're talking about here. You have this foreign language called goods and you want to integrate them into your operating system James: [00:10:31] that is accurate. And ideally you would probably have them a little bit because what I used to do by the way is if you just Google right now, a grid generator, I'm just going to do it like the free Frank: [00:10:42] right.org. I love it. I use those kinds of things all the time. James: [00:10:46] I just use random not, or you can put a L uh, what I did know is you can just put a list of things and then say randomize it, and it'll randomize it for you. You do this for my team meetings because yeah. Team meetings. Uh, w if you have a large team and they'll say you're doing a standup every day, it's really unfair to make the person that's name starts with an, a always go first, every single time. So I do fun things. I do like the city where you're, where you live, or, you know, um, how long you've been with. The company or whatever, just kind of organize it every week. And then one week I was lazy. I was like, man, there's gotta be a way to like random a list. And then I type that into Google and it's like random.org. And I'm like, of course, Frank: [00:11:26] but of course, James: [00:11:27] you're right. You know, um, grids do crazy things. And additionally, you said in the beginning, there's a bunch of different ways of formatting grids. I think that I was on Twitter and, um, Jonathan pepper said, I think you can control shift P. In vs. Code and search for grid. He said, I think vs proper has one too, but it's a weird calm format. So that was the first comment, which I was always like, Oh man, there's different formats and different things. I mean, I just want to quit. Right. That's what I want. Frank: [00:11:57] Yeah, upper case, lower case with dashes, without dashes with curly braces, without curling braces quoted unquoted, these are all options. The visual studio will actually give you. Um, it's kind of funny though. Um, they have a dialog box plus the insert command, and I'm not sure if the instructor and. Does the formatting from the box, you know, you know, I always do this game in code actually, when I'm programming, um, I create a good and I want to print it out and I always have to decide which format I'm going to use. And I almost always use. And which I have no idea what it stands for, but it means just show me the numbers and letters. Not even any dashes, I just want it plain old numbers, but at the same time, every time I have to go to docs.microsoft.com, go look up what all the different format codes are for goods, and then print them out that way. Are you a lowercase person or uppercase person? James: [00:12:58] All lowercase person. Frank: [00:13:00] Yeah. I think it's just more stylish. I think. James: [00:13:03] Yeah, I like it. You know, Frank: [00:13:05] I, I first came into contact with goods, with calm programming, any of old programmers out there with me know about comm programming on windows, where every class, every interface had and. All the factory methods, you know, all these things needed to be identified by GU it's. It was kind of neat because you could technically change the names of things and it wouldn't break anything. But at the same time you were just putting goods over here at code. And it was just so ugly. James: [00:13:36] They're not, they're not, uh, elegant form, but they are of importance. And, and what's, what's fascinating. I think about grid usage over the years is that. They're just like a standard in every language too. Like everyone knows. I don't know if everybody knows what a grade is, but we'll talk about in the second half of this podcast, but I feel as though people developers, no matter if you're C sharp Java, JavaScript, whatever, like Gwinnett is like Aguirre, like people know the Gwyn. And I think that, you know, fascinating about the grid. Is that when I tweeted this out, someone said, Oh my goodness, you, you want to view on a grid waster, right? Like, why are you wasting all these precious squids we're going to run out of, uh, and, uh, send me down this beautiful, beautiful blog post by, um, um, Raymond Chan. Yeah. Who Frank: [00:14:30] classic classic blog posts, classic blogger, classic blog post. Awesome. James: [00:14:36] Yeah. And I really want to talk about this because this really dives into why I care about grids, what they're good for, what they're not good for. And additionally, just to really. Um, put the nail on the coffin here. Ilan, uh, leptin are good. Funny, all Lipton blazer plays, uh, mobile components, uh, and just awesome person in general wrote a cool article about the, all of them, the goods being used. I want to talk to you about that and about their, their randomness, but let's first. Thank our amazing sponsor this week. Reagan. Yes, that is right. Our good friends over at Reagan have helped thousands of customer centric, software teams detect, diagnose, and resolve performance issues faster and more efficiently, who doesn't want to do that. And now listen, for a limited time, if you switch your applications, web mobile, whatever you build in to Reagan, they will give you up to $20,000. And for usage credit, probably some terms and conditions apply, but it's never been a better time to make the switch. You can save thousands and empower your teams with the visibility and insights that they need to deliver a flawless customer experience. Where do you go to learn more? I'm so glad that everyone that is listening asked are like, Oh my goodness. I want that right now. Ray gun.com/switch. It's not for a Nintendo switch. It's for you to apply for up to a $20,000 free credit for Reagan that's reagan.com/switch. We'll put it in the show notes below. Check it out. Love Reagan. Thanks Reagan for sponsoring this week's Frank: [00:16:11] thanks, Reagan. And I love how you thought probably conditions with bias. Cause like. 20 grand, you know, James: [00:16:17] probably Frank: [00:16:17] not. It's not a dollar. James: [00:16:19] Yeah. There's something in there. I'm sure it's in the bottom. Here it is terms and eligibility limits. I'm offered promotional, blah, blah, blah, blah, blah, blah, blah, blah, blah. Yeah, it's in there. You're good to go. Frank: [00:16:29] Can you do that fast reading thing? I can't do that. Fast reading thing. James: [00:16:32] Promotionally applies to customers. Meeting with eligibility, applies to the new customers, which are in the Regan monitoring tools. Build that out. That's about as fast as I can go. Frank: [00:16:39] That was pretty good. I liked that. That was very good. James: [00:16:42] Other times are additional apply. Please refer to Reagan terms. Hi. Cool. Uh, thanks for Frank: [00:16:47] good. So let's, um, let's talk about them because I said that they're not a hundred percent random, but I'm going to say every language has them because at some level or another, we all just need a string of random numbers to identify something. At some point, we don't want to use its name. We don't want to use its hash, which is, you know, something cool. Like get, get uses hashes instead of, um, you, you IDs, but. If you change the data that changes the hash. So, uh, goods are great for yeah. Entity systems where you have mutation where the object is changing over time. But no matter what you change about the object, it has uniqueness, it has identity. So that's what we have. These forests, you need some random things. So it makes absolutely sense that all programming languages have have some concept of this and databases. Uh, the question is always, how do they generate them, James? So, this is a great article. James: [00:17:41] It is a very good article. In fact, there are four parts specifically to a squid. Um, and this, this will be the short term. I mean, I never knew this before I, but by the way 30, how old am I? Frank: [00:17:53] 34. Don't ask me. I don't know. Yeah. Young man. James: [00:17:59] 86. Yeah. 34, 34 years of my human existence. I never knew. What was integrated? I just, I had no idea. Like, why would you care? I guess, like what's an HTTP header. Nobody cares, except for, Frank: [00:18:12] you know, I'm a weirdo one day someone said to me, you need to generate a, go ahead. And at first I'm just like, I'm going to generate 128 bits worth of random data and turn them into hexadecimal. No big deal. Yeah. And then I don't know what I read. It could have been this article. This article was posted in 2008, so it's quite possible. I read this, but I almost feel like I read Wikipedia. Yeah. First. And that explains it. Or maybe like even the C3 Wiki, like the old computer science Wiki. Right. And that explained, uh, the good algorithm, but now, sorry, I'm interrupting myself news break. Uh, it turns out there is kind of a web standard here. So perhaps I even read, um, This web draft here. James: [00:18:55] I do. I do believe that yeah, there is an internet draft of it, and then that could be it. And it seems as the, most of the places follow similar things. I mean, I feel like when you generate a grid, it's relatively similar, but there are different algorithms. Um, but. You know, the one that Raymond talks about at least as the internet, the internet draft, which is what is this, how are these drafts even from this is from Paul J leech, from Microsoft and rich SOLs from cert search to co there's a very long, Frank: [00:19:32] by the way, Microsoft, James: [00:19:33] by the way, this is like, it's all a huge long doc. And then there's like a assembly code at the bottom. Is that something or C code C plus C code? Oh, I'm Frank: [00:19:43] not looking at it. Let me take a look, but you know, what's funny is, um, Apple calls on you. You IDs not GUI DS. And I wonder, um, Oh, this spec James: [00:19:53] says, Frank: [00:19:54] the spec says also known as, so hopefully they're equivalent, but you're really making me curious. I really do know the Microsoft side better than the Apple side, but wow. This past spec goes back to 1998. So this was definitely early internet James: [00:20:08] days. Yeah. Yeah, well, I mean, most places, if you look for grid, they'll say grid or you UID. Um, if you go to the Wikipedia says you, you ID the term grid. Global unique identifier is also used typically in software by Microsoft specific. Frank: [00:20:28] Oh, it's a Microsoft thing. Okay. Got it. Yep. Yeah. So, uh, this is C code James, not assembly, so we could easily pour all this to C sharp, but we have no need to cause we have the good class for all that kind of stuff. Um, but you said it's made up of four parts. What are the four parts James: [00:20:47] number one 60 bits, not bytes because it has 16 bytes total Kalos remember that Frank: [00:20:57] one six bites? Yeah, one 28. Yeah. James: [00:21:01] One 28 bits, 16 bytes. And the reason Raymond wrote this article is because a customer so that they needed to generate an eight byte unique value. So what they were going to do is take the liquid by the way. Good. I say quid potatoes, potatoes, fascinating, fascinating in January new, get new J Boston, get a coffee. Um, so. They were saying that they were going to throw away the second half and he was like, Oh no, that's a terrible idea. Because the first 60 bits B I T S which is half of it is a timestamp. Frank: [00:21:42] Yeah. And this is clever. This is clever. Um, I think the issue here, this is incorrect, probably rare, but we all use pseudorandom number generators. So there is a theoretical possibility that at a moment in time, two of these could start with the same seed. And generate the same number or worse. Maybe there's an open source library out there that seeds it's random number generator with a constant other people use that library. All of a sudden everyone's running in lock step with each other with a random number generator. So this is smart. It's not a hundred percent random number. It's got this huge timestamp and it would, you never really. Realize, because I think they mess around with it a little bit because you don't see goods just incrementing, you know, I don't generate one. And then it's the number one at generate again. It's the number two. We don't see that. So it seems odd that it actually has that timestamp element. James: [00:22:36] Yeah, it's pretty. In 10. Yeah. I mean, they definitely are Madison and Nixon and stuff stop off. Right. So that's the first yeah. Cause yeah, they're they're bits, right? It's not just like, you know, date, time to string. Right. It's not what they're saying. That's not what they're doing by the way. So there's that the next 48 bits are interesting. These are, uh, computer identifiers. Now, now that's really fascinating because how, how Raymond breaks us down and he may just be quoting the internet drop, but he says the next four bids are always zero, zero. Zero one which identify that this squid was generated by algorithm one. So that's kinda cool cause there's a bunch of different algorithms. So you might have zero zeros or two or whatever. He said the version field is necessary to ensure that two grid, generation algorithms do not accidentally generate the same grid. That is actually really cool. Just in general. They can like guarantee as long as the grid algorithm is doing the right thing that, Hey. Even if your algorithm produces the same stuff, it'll be different because it's zero zero zero two zero zero. Because so there could be thousands of algorithms. And it says that the algorithms are designed so that a particular algorithm doesn't generate the same grade twice, but without a version field would be no way to ensure that some other algorithm would generate the same quid by some systematic collision. Crazy. Frank: [00:24:05] Yeah, it seems weird to throw a constant in, to say, we're going to make things more random by throwing a constant. I like the idea here that it's, if everyone follows this algorithm, then this is a signal that we're all gonna be safe because we're all following this one algorithm. Of course you can. Ruin all of this. I've seen hardware vendors do this and it drives me insane. Um, they don't have your cool ad in James, so they'll generate a good and then copy and paste it and then just increment like a number inside of it. And it's a miracle we're safe from any of that kind of stuff. All of these are very small probabilities obviously, but. Aren't there like 8 trillion iPhones out there at this point, like coalitions are gonna start happening. Like at some point in time it might take 200 years, but it's might happen. James: [00:25:00] Yeah. You know, and I, and I, and I say like in here, like, so, so there are these, these fixed algorithm bits, and then there's 48 bits. That is that our computer identifiers, those are usually the network card. And, um, if, if the computer doesn't have a network card, then it uses a random number generator. Um, It says it uses is it sets the top bed and then use a random generator to generate the 47 says no, um, no valid network card will have a top bit set in his address. So the possibility that the grid generated from the key of Peter with a network card will accidentally only with a grid generator from, with one is, you know, rare. And there's some other bits in there. Like one is like there's bits that are emergency. Unique unique of fire bits. And those are like the algorithm fine tuning Jeneane Aghans right. Cause you're thinking there's a bunch of things, six things, right? Like one is a network card. One is the timestamp and then like these fine tuning, magical bits and pieces and yeah. Side of it that can make it happen. And like there's always randomly like, uh, two fixed bits that are always zero one. Just like, no, man, this was always there. You know, you can't not do it. So there are a bunch of pieces in there, but it's very fascinating and you're right. Like. They, he says in here that there was one blog, where was it at? There was one blog that I was looking at that was like how many it could be, but isn't it like. Yeah. What does he say? 200. Yeah, 200 and some odd years or whatever is how long it would take to find a duplicate. Frank: [00:26:30] Go ahead to actually get a collision. Okay. Uh, Oh, I found that part. He's saying a hundred nanoseconds per tick. So if you can generate them at a hundred nanosecond rate, then it would take 200 years, which. That sounds hard, but you know, multiplied by a million devices and, you know, it breaks down a few orders of magnitude there. Uh, but it's, it's all still really clever. I'm curious about the network card part. I wonder how many, uh, good algorithms out there just use random numbers for the computer identifier part? Uh, because I know when you're doing things like with doctors hosted on multiple things, In, you know, they're just using the ethernet address or something like that. But yeah, it's a random number coming from somewhere. I'm just curious, you know, if I generated a U U ID in the browser, I hope it's not going to use my ethernet address. Cause that would be a way to spy on my browser. So hopefully within the browser, they just use a random number there. James: [00:27:30] Yeah. That, that is. Yeah, fascinating. Like I'm assuming that the browser does not have access to that stuff in general, but like if you were using the windows, uh, what is there is a squid gen, which I think is a windows tool for generating quids. Um, I don't know if that be just the Frank: [00:27:47] standard. Yeah. There's there's old level operating system when 32 API for it. And then there's definitely.net, which I'm sure has been reviewed a billion times over that. Um, those, those last 14 bits, I guess those are just kind of like some random numbers, you know, just throw in some random numbers, but it is curious how he keeps phrasing it as, um, I don't know, fine tuning. As he kept said, saying, I don't think I have the cryptography degree. It would take to fully understand why, um, why they only left 14 bits for that. Like, you know, if I was inventing this format, I totally get the logic of the timestamp. Even the ethernet card, do a little hash on those or something like that, but only leaving 14 bits of actual. Fall on randomness, like from, from a pseudo random number generator. I guess what I'm loving about this FAQ is they obviously don't trust pseudo, random generators. Like they just don't period. James: [00:28:50] Yeah. You can't, I don't know if you can necessarily, you know, you know, when you go to random.org, we were talking about random.org earlier, and sometimes you have a stuff in a list or you're like, give me a random number in your mind. You just feel as though number 28. Keeps getting picked over and over again. That's why Frank: [00:29:09] I always think they gave it to someone else. I'm like, did you get someone else's random number? Who else has this rent? Is this my rent? I want to guarantee that this is my random number. Yeah. James: [00:29:21] You know, in the, you know, the fascinating thing about a grid is if I generate a grid right now, I'm going to do it right now. Okay. Here we go. People live on the podcast. Frank: [00:29:29] I'm so excited for this James: [00:29:31] kind of admin. I just did it. There's a good demo style now it's right there. It's Frank: [00:29:36] it doesn't look too random to me. I don't know. James: [00:29:39] Maybe that's why people like a grid because it looks random, right? It looks like it is not necessary, but someone's like, don't. Don't throw away all those grids. And then I would argue, Frank, I don't press that button now that never be used. It's a, it's a grid in which no one can ever use it Frank: [00:29:57] ever. Have you been, uh, converting these to binary so you can check whether they're, this is the version, one of the algorithm. It could be, these could be version two. Cool. It's like we don't want to be mixing our goods. James: [00:30:09] That's very true. Frank: [00:30:10] That's very true. James: [00:30:11] I, you know, I have no idea cause I, you know, when I look at a grid, I don't I'm, you know, I read Raymond's. You know, infer information on it. I don't necessarily see the things right. You can explain to me, cause he's talking about the time codes and these and these bits, but how do they turn into these magical. Letters and numbers and hyphens. Frank, do you under, I got, I don't understand how that works. Frank: [00:30:34] Well, the hyphens are just grouping by bytes and by words and D words. And that's just for clarity. So you can read these things more clearly. Actual computation is James. I don't know because I'm just scrolling through the calculation here. The sample source code they give for it. And trying to read it as fast as I can to answer your questions, but it all looks really basic. Honestly, I don't see any, uh, too many magical tricks here. It looks like they get a timestamp. They encode it to bits. They try to get a identifier for the machine. They encode that into bits and print. The stupid thing out is a hexadecimal, uh, thing, throwing some random dashes and. There you go, Oh, they have their own random number generator built into it. Pretty nice. That's pretty nice. I was actually, I'm just implementing a random number generator to, you know, what I needed was, um, predictable, random numbers in that. James: [00:31:34] Does this make any sense, Frank? Frank: [00:31:35] I know it does. It does because they're pseudo random numbers. They're not random numbers, but what I needed to do was generate input for a neural network. And in this case, the input was just going to be random, but I wanted to be able to recreate it. So the trick you do for that is you seed it every time you pick kind of a random number yourself, call that the seed and that can generate the other random numbers. So real nice, simple system. The problem is that only works. If you have a stable, pseudo, random number generator, and oddly enough, the random number generator in.net is not guaranteed to be stable. Mm, uh, they have all the rights in the world. I don't think they ever do. I don't think it's ever changed, but they have all the rights in the world from version to version to change the exact algorithm that is used to generate random numbers. So I found myself in an odd position where I was actually putting a pseudo, random number generator into my own code and not using the one provided in.net, just because I wanted to guarantee that no matter which version of.net I was running on, that I would get the same sequence of random numbers. Fascinating. James: [00:32:43] Yeah. I always thought the random was based on time stamps, I guess. Frank: [00:32:49] Right. They initialize it. Um, so it automatically seeds itself. So if you run one program and call random. Run the program twice. You're going to get two different numbers because the library is smart enough to randomly see itself. Um, but then you can get into an argument and how random is feed, you know, endless, endless rabbit hole of randomness. James: [00:33:11] Oh, that's why you, and then with C sharp, the random, I'm pretty sure you're sup you're supposed to new it up. Like outside, you shouldn't create new ones in like a tight loop, because then they would all be seated with very similar data or whatever. Right. And then it would kind of mess up Frank: [00:33:28] the thing. Right. Technically, um, the, the library should be Bulletproof against that. It's just not a good idea. I think the quality of the randomness would decrease in that case, but the library is actually safe. It has, um, an auto incrementing threads, safe, automatic seed. Number, you know, implementation detail, but it's there. So it's not just the timestamp. It's forcing an increment every time it's gets used. So it's guaranteed to be unique. Um, but these things are designed to be reused. So a hundred percent you're right. And how you should use it, create it once or whatever, once per thread, you know, however your code works and call it as much as you can before you recreate it. James: [00:34:09] Got it. Got it, Emma. Yeah, that always is kind of like HTTP client, right? Like, um, I'm going to ask, who can I ask rich, maybe email. Can I get I random factory? It should be client factory. And like, it just guarantees me around the correct random. Frank: [00:34:30] So there are kind of is there is the system.security dot cryptography namespace, and that has higher quality, random number generators in it. Um, I don't remember which ones are like.net standard. And which ones are.net and which ones are, you know, um, what's the other one tight knit car? Um, I don't remember exactly the cross platform, this of them all, but I know for a fact that there is something just called, like. System security, cryptography, random generator, something like that. And that'll give you a nice and very high quality, random number generator. It was actually, there was a fun thing going around where people were making fun of the builtin, random functions and programming languages. And you can see it actually very easily. If you use it to generate an image. Uh, humans are very good at visual recognition. So if there is any pattern at all to your randomness, we can see it in an image. And so you just print out a bunch of random images and you can see the quality of, uh, quality of the implementation. I James: [00:35:39] like that. That's funny. Yeah, that makes sense. Uh, honestly, Because Frank: [00:35:44] humans are awesome. We feel it. James: [00:35:46] We can see it. Yeah. Oh man. That's funny. I think, I think, I don't think I can talk any more about Gomez. I think we've exhausted grids. I think the last squid is exhausted. Frank: [00:35:56] That's impossible. We still haven't talked about whether I should, uh, encode them as text or binary and SQL Lite. So we'll save that for another episode, I guess. James: [00:36:04] Oh, well that make it. Different. Frank: [00:36:08] Nope. It turns out performance wise. There's really no difference in SQL Lite. I should say your database, you know, I, you know, built into SQL. There is a good data type, but there is not a good data type SQL Lite. So you have the option taxed or binary. Technically binary takes up less space. Um, but in practical considerations, um, there's not really much difference between a text and coding and a binary encoding. James: [00:36:38] I ran into the same issues with my settings plugin, by the way, because I was like, Oh, you know what? I should add quid duh, because who doesn't want to save and store grid. So I would take in the grade class. And I, and, and none of the platforms under the hood, right? They don't, they don't understand historian grids. They're like, whatever, they're, they're simple data types. And even though grid is complex data type, but the representation of the grid as a simple data type is this ring or buying. And I went with a string because, uh, at least the, it has like a tri Parson it, right. So, but I imagine did CDAI C-sharp, is there a way, is there a constructor. Frank: [00:37:20] Oh, yeah. Um, well there's good adopt pars and there might be a constructor. And the good news is the parser is very forgiving, but I still try to standardize, especially using them as primary keys to like lowercase, no dashes or maybe dashes, but you know, you really have to decide because. Ideally, you can set your correlation mode and everything for queries, but sometimes, sometimes I'm just worried. And so I try to standardize uppercase, lowercase, all that kind of stuff. James: [00:37:50] Yeah. You can parse via a read only span of char. Care chair, her care chart. Frank: [00:37:59] I say, I say car I'm terrible. That's a James: [00:38:02] character, right? Frank: [00:38:03] So it is a car actor. James: [00:38:05] Char you can try parse a string and you can try parts exact, you can try right bites, which takes in a span of bite. Yeah, how do I, where's the constructors at I'm just looking at documentation. Ooh. Yes. You can construct a grid by a bite away. Oh my gosh. A byte array you can pass on. And this is my favorite. This is my favorite constructor who know there's multiple favorite constructors. I made a grid with the, here are the, here are the parameters. Frank: [00:38:33] You're so excited. I can't get to it. Come on. What do you got James: [00:38:38] in 32? Yeah. So it's a weird Frank: [00:38:41] one. James: [00:38:41] It's. It's Frank: [00:38:43] in better feed. James: [00:38:45] So it is a, which is the first bites. And then it's, and then it's a, then it's a short, short bite bite bite by bite bite, bite bite, Frank: [00:38:55] the most useless constructor ever. Great. Thanks James: [00:38:57] everyone. Frank: [00:38:59] That's my favorite representation as five James: [00:39:02] parameters. Yeah. And then they also have, by the way, another one that are. Onsite in 30 twos and unsigned. Yeah. You and you shared you short bite, bite, bite by bite. But my other favorite one to enhance that one is actually, you can take. In short, short byte array and gives you just want to, instead of passing eight bites, you can put them in a bite. Or if you desire, Frank: [00:39:26] this is one of those meetings where like, but what if this hypothetical person was insane and wanted to construct it this way? Like there are two formats there's text and there's binary. What's up with these what's up. What's breaking it down into integers. That's so weird. That's great. James: [00:39:42] That's great. Yeah, you can, you can. It's it's fascinating too, that there is a, I understand a tripod is, cause you don't know, but there's also a parse, but you can also initialize a quid by passing it, the string and that string, maybe tri-party tries more things. I'm not positive. Frank: [00:40:00] I think the problem is it's, um, exceptions versus no exceptions. Like I use the tripod when failures happen, I'm expecting failures to happen. You use the, the exceptions when that's truly exceptional, you know, there was also the parse exact cause I was gonna say, I've always found the parsing functions to be very flexible. They'll just kind of eat up what they need to eat up. But the parts exact is where you're being anal retentive. And you want to make sure it's a very specific format. James: [00:40:27] Makes sense of you are specifically storing it in one way you could, Frank: [00:40:31] do you want to guarantee that you're not going to corrupt the database with some other format or something? James: [00:40:36] Why have other, why have hyphens in there if you don't need them? Those hyphens are taking up space. Frank: [00:40:40] You know, you really don't. So like, okay, one last topic, stupid goods. Um, I hate it when it's URLs, you know, URLs with goods, I think are just so asp.net. That's what it's like any tech that really did that. What you see more common these days are, um, shorter UID. So people use 64 bit ones, which are obviously very pathetic and prone to collision, but. At least it makes for cute or shorter URLs. And the other trick you could kind of do for that is if you're ever doing lookup by it, instead of doing exact search, do a starts with search so that you can do that same trick we do with a Shaw hashes and get where if you want to. Pays something you don't need the full shot hash hexadecimal. You can just do the first four or five, whatever it takes to make it unique. And I always recommend that if someone's trying to make nice URLs for their website, that absolutely requires a good to, uh, maybe be a little flexible with what you input. James: [00:41:46] Yeah. Think about what the, you know, think about what the end user is seeing. It's a, it's a good point. Um, there are some. Uh, some apps that I use that generate URLs and, you know, things like, you know, invite links and they're just crazy long. And they're putting just dangerous ways, which is like, you know, encoding information. You're like, so I can't, I can't, you know, there's a reason that, um, Like Amazon links, Frank: [00:42:12] like what are, what are those parameters mean? There should be a website out there, like decode my Amazon link. Explain it to me. That's true. James: [00:42:19] Yeah. You know, even though our Zen caster link, it's, it's very much like Zencaster slash username slash show name, and it's like, and that's what it is. It's very clear now, but I will say if you put a grid. It's like the zoom issue, right? Zoom, you can just randomly guess at six characters nonstop. It's very randomly gas liquids nonstop. Frank: [00:42:42] Yeah. Yeah. But they have a very strong security argument on their side, especially I, I definitely did the, I didn't do 64, but you know, what I was doing was. A alpha numeric. So that would be, um, 36 raise to the eighth power logarithm to, to tell you how many bits, but I just preferred it over that encoding over the straight hexadecimal encoding used the entire alphabet, that kind of stuff. So there's ways to squeeze, uh, goods down into slightly friendlier formats too. So you get all the power of many, many bits, but maybe a friendlier URL. James: [00:43:22] Yeah. Even Raymond in his blog post talks about, uh, uh, a better way of, of doing shorter grids doing an eight, eight, eight by grid instead of a 16 byte, uh, grid. So definitely take a look at that. It's kind of cool. He's like, here's how you would actually do it. So like don't, don't take the grid, but here's how you could take the algorithm and mesh it around, so, Oh Frank: [00:43:44] yeah. That's clever. That's great. Yeah. Especially if you're doing a text primary key, it doesn't matter. Make up your own IDs. James: [00:43:52] Yeah. Do that. All right. Grids, we did Frank: [00:43:55] them. That's a weird topic, James, but I guess that's like a one for the bucket life bucket list. We did go once we talked about goo it's on the show, James: [00:44:05] the grids that's correct. And in fact, let us know how you pronounce squids. Is it quids or goods? I'm pretty sure Frank's wrong. So, um, let us know in the, in the show notes, you can write comments. I'll read those next a week. On the pod or give us a little tweet at merge conflict FM or at James wants a Magnum. I proclaim him. You can just go to merge conflict of him. There's all of the links there. You can find all the things for all of us all the time. No matter where we're at, I was gonna do it for this week's emerge conflict. We have successfully created gas grids as a service, a G a S. That's right. That's the name of this episode? You'll see. I've cleverly named it in fireside. It's fantastic. Oh, Frank, Frank Franklin. Right. So next time Jay's Monza Magnum. Frank: [00:44:47] I'm Frank crooner. Thanks for listening.