 Okay, so not too long ago, I did a video talking about my rules of programming. One of them is definitely when you have a long list to filter the list, whether it be names or whatever you're searching for. And one of the top comments on there was someone saying, oh, I work for a company with 60,000 employees. All the employee databases, because it's been mergers of different companies, are in different databases, and there's no good option for HTML for filtering that large of a list. Let me address both those issues. First of all, when you have an employee database, the employee database, the basic employee database, should be relatively small. It's your core information. You're going to have things in there like their first name, their last name, date of hire, date of birth, maybe the department they work in, and maybe like a phone number, but that might even be in a whole different database. Everything else for those employees are going to be cross-referenced to other databases. No matter what company you have, even if you merge with a small, small company and they don't have an employee database, they probably have a spreadsheet with that basic information on there of all their employees, because they're going to have their username, their username, their first name, their last name, maybe a user name, their date of hire, at least those core things. And it should be no problem to either export from their database and import it to your database or from a spreadsheet. So that's kind of a non-issue. Yeah, you might have different databases, a different company used for certain things, but your core employee database that you're going to use for forms, if these companies are merged at all and you're actually going to be searching for all these employees in one place, should not be that hard. Again, if you're working with hundreds of, even if you're working with hundreds of millions of people in a list, it should not be that hard to export them unless those lists are being updated real-time and you can't pull that information because it's being updated real-time. But for the most part, you should be able to dump that and then re-upload it into your database fairly quickly. So I don't really see that being an issue. I understand that having a lot of different databases for different things can be hard for companies when they merge to get all together, but your core employee list should be a very simple database and you should be able to pull that list of names and basic information and put it into your main database. So I don't really see that as an issue for what we're talking about, which is pulling people's names for a form when you have all your employees and you're trying to fill out an employee form. Now, as far as that list being large, that can be an issue. So I'm going to show you some examples I made. First, we're just going to use a shell script. We're going to pull a list of not 60,000 names, but 100,000 names that I generated from voter registration. So I took voter reservations that had millions of names in it. I shuffled the first names and last name, linked them up, sort unique them and put them into just a plain text file, which you can access right now on my website. You'll see. And what I did was I'm going to show you real-time. I'm going to write out the code, a one-liner that pulls that list, puts it in the Fuzzy Finder, prompts you to search through it, takes what you use, and then echoes out what you've selected. Very, very simple. I'm going to go through it quick. It's not a full tutorial, just a demonstration, but just show how quick something like Fuzzy Finder, which is a very advanced filtration application that runs on everything. Then we'll look at HTML and we'll look at the option of data list. Data list I talked about in the previous video, which is built-in function element of HTML that all modern web browsers, I believe, now support. And it's a little bit more advanced than just a drop-down select option because it will look for matches in the middle of the string instead of just at the beginning, which is nice, but it's not a full Fuzzy Finder. But yes, in certain situations, that may be slow. I'm going to show you how it runs on a desktop. Then I'm going to show you how it runs on a cheap cell phone and you'll see the difference. On a desktop, it's not an issue. On the cell phone, it works but kind of slow, okay? So in a situation like that, I'm not going to go over today, but it's not that hard if all this stuff is in a database to have as you type, after you get a couple of characters in your text input, to have it start submitting what you're typing to the server and the server filters it out and returns a list of matches. I've done this a number of times and I've done it very efficiently. In fact, if you go to filmsbychrist.com and you go to my main search to search through my videos, it's not the quickest mainly because it's grabbing a bunch of thumbnails from YouTube, but as you're typing, the list of stuff actually filters fairly quickly and I'm not even using a database. I created that a real long time ago or really, really long time ago and it's just a plain text file that is on my website that new videos get dumped into and I'm actually just using grep to sort through them. So as you type, it sends what you're typing to the server and it literally just grabs a text file and returns the results as you're typing. It is not the most efficient actually having a database and filtering through that using whatever server side language you use, PHP is what I normally use to search through databases, could be a lot quicker. 60,000, 100,000 things in a list is not very long at all. So let's dive right in. Again, I'm gonna go through this quickly. They're just demonstrations, examples, but to show you how quickly it is, and again, the HTML here, we're not gonna even write any code, it's just built in elements of HTML that you can make a lot more efficient if you just knew a little bit of JavaScript and a little bit of server side, whatever you use on server side, PHP to search through a database. So let's jump right in, jump right in as we're almost six minutes into the video. One more thing. I'm gonna be using a different mic than I normally use in this video. I feel like my good microphone picks up a lot of background noise so I'm trying a cheap microphone that's in my headset and I haven't adjusted the volume, tested it out yet, so forgive me if the audio is not perfect in this video. So again, I'm gonna go through this really quickly here because this is in a full tutorial, but more of a demonstration. But if you go to filmsbychrist.com, forward slash scripts, forward slash 2022, forward slash names, you'll find this directory. There are two files. One is one and a half megabytes. The other one says three, but really I think it's only two point something. I don't know if it's rounding up here, but I clicked on here. There are 100,000 names in here generated from voter registration. I took a bunch of last names, a bunch of first names, shuffled them up, unique them, and filtered out so there were 100,000. So we have 100,000 names here. Again, it's a 1.4 megabyte file. So if I take this URL and we'll go into our shell first. So I come in here and I'm just gonna use Wget. I'm gonna say dash Q for quiet so we don't see the download information and then capital O dash for output to the shell. I'm gonna paste in that URL and we can hit enter and it lists out the names there for me. And again, if I was to word count this, so I pipe it into WC dash L, you'll see that there are 100,000 names in this list. Now, instead of putting into that, we'll put it into FCF, right? So how quick, it's loaded in no prime. That's downloading it from a web server freshly. It's not cached anywhere right now. And I can say something like Smith John and I got Smith John as an output. Great, we can use that. Let's do it again. We'll do Simpson and Todd, okay? Or Simpson and Earl. Great, fuzzy finder. It's working super fast. 100,000 names, no problem. Let's go ahead, of course, we can put this into a variable called name, like so. And then we can echo out, you selected, whoop, selected dollar sign name. Put a period there. Make it a little bit cleaner. I'll put these curly brackets. Okay, so now I should be able to type in again, Simpson, or at least close, if I typed it wrong. Simpson, Earl, and it says you selected Simpson Earl. Great, of course, in a real script, you want to make sure that they actually selected a name because if I do this and I just type a bunch of gibberish and hit enter, you're gonna say, you selected and there's nothing there. So in a real script, you probably do something like this. You'll say bracket, bracket, bracket, bracket, couple of spaces in here and in quotations, dollar sign name. And then we'll say, okay. And so if true, print that and we'll say pipe, pipe. So if it's false, we'll say you didn't select, select a name, a name, a name. So if I hit enter, if I typed everything right, we should be able to type in, Smith, John, hit enter and it says you selected Smith John. Let's go ahead and add a clear screen so we can get a nice view of this. And now I'll do Simpson, Todd, and it says you selected Simpson, Todd. If I do Simpson, Earl, I selected Simpson, Earl. Of course, what I'm doing here, it's not telling me what am I doing. I'm seeing a list of names. So really what, oh, well also let me demonstrate. If I type in a bunch of gibberish, it should say you didn't select a name. And of course, as I was saying, you want the user to know what they're selecting. So with FCF, you can do dash, dash, prompt, please, because you gotta be polite, select a name. And now it says down here at the bottom, please select name. And when I start typing, of course, Simpson starts narrowing down and down to 30 names already and I can pick whichever one I want. Okay, so that's in the shell. The shell is always super fast. Let's go ahead and look at HTML. Now, I would not necessarily use a plain data list. As I talked about in a previous view, data list is a built-in element into modern web browsers that allows not as fuzzy finding as a fuzzy finder, but it's a little bit smarter than just a dropdown select. But it's not gonna be as quick. Let's see how it loads. Again, it's about a three megabyte file for these 100,000 names with the HTML. On my desktop computer, actually laptop computer, if I click here, it loads it up. It didn't take long, maybe two, three seconds for the whole page to load. And again, I can go Simpson, or let's not combine the names. Smith, John, and it's filtering it pretty good. Let's select another name. I'm just picking the same names because I know they're in the list. Simpson, Todd, there we go. And also let me hit Control-Shift-R. That reloads the page and should clear out any cache. So you can see it still loads pretty quickly. I didn't autofocus that, which I should, which is a rule of mind, but this is just a quick example. And we'll do Simpson, Earl. Okay, that's great. That's on my laptop computer. You know, it's about a $400 used laptop think pad that I bought. What about this? What about on my $50 Motorola phone? So let me turn on my screen here. Let me make this full screen here. Oops, wrong. Full screen. And again, I, oops, I did not customize this to load on a mobile device, but let's see how well this loads on a cheap mobile device. I'll click on that same URL. Again, you can go to this right now. Filmsbychrist.com. Ford says scripts, Ford slash 20, 22, Ford slash names. And you can pick the full name list or the HTML here, see how it loads on your device. And you can see here, it's hanging, it's hanging, it's hanging, it's hanging, it's hanging, it's hanging. It's hanging, it's loading all that HTML. It's probably downloaded everything, but it's gotta process all that into HTML. That's not great. You know, and then I click on here and I can say Smith, John, just like I did on my desktop and it takes a few seconds. So yes, on a mobile device, obviously the built-in HTML is not the best option. What you probably wanna do is have it, so as you type, it submits what you're typing after probably like three characters to your server and then have your server filter out and pass back the information. It's something I've done before. It's a little more complicated because right now with this HTML, we haven't written any code. We've just created HTML, basic plain HTML. And I would want to write the code myself, a little bit server-side stuff to filter through the database because we're not using a database now, we're just using a flat HTML file. So definitely searching through a database will filter that out and then you can use some JavaScript to submit that and filter out. We're not gonna go into details on that, but just showing you how simple it is to create an interface, not that great on mobile device. Once you start getting into those larger numbers and you're trying to filter stuff, you're probably gonna wanna do on the server-side if you have a slower device. As a developer, you gotta figure out the nice balance. You don't necessarily want your server being hit so much if you're having a lot of hits, but with 100,000 employees, odds are they're not all gonna be searching for employee information at the same time. If this is built in, if you're running Facebook or MySpace or something, that's beyond MySQL. You're talking millions or billions of users, whatever, hundreds of millions of users. That's a different scenario, but even if you're in a large company with 60,000 or 100,000 employees, this is doable without too much skill. Yes, what we've done here could be done better. So that's it. I hope you learned something here. Please visit filmsbychrist.com. That's Chris of the K. There's a link in the description. And as always, I hope that you have a great day.