1 00:00:01,860 --> 00:00:09,340 So we're going to talk about this creating the unique pattern generator, because first let's see what 2 00:00:09,340 --> 00:00:16,260 you need to create a unique pattern, because in the previous years by Facebook, we have our first 3 00:00:16,260 --> 00:00:18,690 application with the audience. 4 00:00:20,040 --> 00:00:26,230 So you cannot determine whether it contains which office. 5 00:00:26,790 --> 00:00:34,320 So you have settings for 2000 years and which is has been awful in a year, whether it is fifteen hundred 6 00:00:34,320 --> 00:00:41,130 years or seventeen hundred year already, we don't know because every year is similar and we cannot 7 00:00:41,130 --> 00:00:43,380 find the offset for this year. 8 00:00:43,620 --> 00:00:51,020 So to accurately rate the AP with some jump address, you need to exactly find it. 9 00:00:51,030 --> 00:00:53,970 How much of it is going to be all right. 10 00:00:55,140 --> 00:01:04,340 So that's why you create a unique pattern so that not three, not three characters are there is not 11 00:01:04,360 --> 00:01:04,770 Twitter. 12 00:01:05,940 --> 00:01:13,920 So if you say you did it and now three consecutive bites are repeated in the cohosting. 13 00:01:14,190 --> 00:01:21,570 So whenever we put it into this application, these four bytes will not be repeated again in the pattern. 14 00:01:21,630 --> 00:01:25,800 So you can just these four bits will be unique and these four words will be unique. 15 00:01:26,160 --> 00:01:28,920 Say quickly and this will be your hit. 16 00:01:28,920 --> 00:01:35,580 And this radical anextra, those four unique characters defines the offset of a particular EOP. 17 00:01:35,850 --> 00:01:36,120 Yes. 18 00:01:38,460 --> 00:01:44,850 So for that, we need to create the unique pattern so that minimum, at least three consecutive characters 19 00:01:45,750 --> 00:01:47,500 are not repeated in our intention. 20 00:01:48,240 --> 00:01:51,870 So let's go ahead and create our, uh, script in the python. 21 00:01:53,250 --> 00:02:03,040 You can have matters us produce, but it's always good to have a Python script, so that's not random. 22 00:02:03,360 --> 00:02:05,600 So I'll tell you why we are importing this one. 23 00:02:06,810 --> 00:02:09,780 Now, my idea is, let's say creating the list. 24 00:02:11,130 --> 00:02:17,100 And in the script I want to put all the halfwits uppercase of its workers alphabet and numbers. 25 00:02:33,980 --> 00:02:38,740 So I have created the list, which contains uppercase alphabet's letters afterwards and the numbers, 26 00:02:39,050 --> 00:02:45,150 so I don't want to use I want to create a variable pattern and it's a temptation for now. 27 00:02:45,500 --> 00:02:50,820 And what we're going to do is we want to ask the user for that length. 28 00:02:52,400 --> 00:02:54,080 So pattern then. 29 00:02:57,350 --> 00:03:04,310 User will do input as an integer, that's 2000 lenth pattern or to the current pattern, except. 30 00:03:16,150 --> 00:03:17,410 And then. 31 00:03:21,090 --> 00:03:28,740 I know what you're going to want to randomly pick up any number, any element in this list and apply 32 00:03:28,740 --> 00:03:29,850 it to better. 33 00:03:33,770 --> 00:03:43,130 So you do that, so we will keep a for loop and we will do that these minute number of times so far, 34 00:03:43,130 --> 00:03:45,050 right in the range of. 35 00:03:50,300 --> 00:03:53,000 They'll come up Pattenden. 36 00:03:56,390 --> 00:04:05,110 So what I want to do is I want to see a pattern, I want to apolo the random element to this pattern. 37 00:04:05,660 --> 00:04:10,610 So I want to say there is a model called random, not random. 38 00:04:11,110 --> 00:04:23,150 And so this will generate to a random number from the boundaries we have given. 39 00:04:23,300 --> 00:04:27,230 It's a random random puff zero come up at the school. 40 00:04:29,570 --> 00:04:38,470 So if the pattern content is 100, then this function will return a value that is random number between 41 00:04:38,660 --> 00:04:41,390 zero and 100 that is pertinent. 42 00:04:41,870 --> 00:04:45,980 So now what we want to do is this returns the number, right. 43 00:04:46,520 --> 00:04:49,670 We need to set up a list of. 44 00:04:53,620 --> 00:05:01,340 So we are moving over this zero to pattern, and for each iteration, we are picking up a random event 45 00:05:01,360 --> 00:05:03,400 from happening to the pattern 46 00:05:06,430 --> 00:05:11,250 of, OK, now we are going to print this pattern. 47 00:05:14,400 --> 00:05:15,660 So let me run this. 48 00:05:19,320 --> 00:05:24,210 Let me say 50, and as you can see, there is a random pattern. 49 00:05:29,630 --> 00:05:32,410 Sorry, I need to take the tougher right. 50 00:05:35,070 --> 00:05:42,840 Then Taffer minus one, because the three includes you, so no need to get in because it screws you 51 00:05:44,010 --> 00:05:45,780 up problems. 52 00:05:46,170 --> 00:05:46,710 One hundred. 53 00:05:55,860 --> 00:06:04,410 To can concatenating, not integer, so let's say that's connected to a string because it's also selecting 54 00:06:04,430 --> 00:06:08,480 the numbers which are there and which are at the end of this list. 55 00:06:09,240 --> 00:06:12,210 I go ahead and run this first 100. 56 00:06:12,510 --> 00:06:15,340 I want a hundred then better. 57 00:06:15,960 --> 00:06:19,270 And as you can see, it's almost a unique pattern. 58 00:06:19,860 --> 00:06:23,040 There is no there are no elements repeating the pattern. 59 00:06:24,000 --> 00:06:26,620 Three should not R.M., unfortunately. 60 00:06:27,330 --> 00:06:29,400 So this is our record pattern created. 61 00:06:29,550 --> 00:06:34,170 Now, we would also add another functionality to search in the pattern. 62 00:06:36,890 --> 00:06:47,180 Now we will ask the user for the input that sex is equal to, uh, in Peikoff since it's a screen, 63 00:06:47,180 --> 00:06:47,780 when you say. 64 00:06:51,480 --> 00:06:52,800 Interesting to research. 65 00:07:03,080 --> 00:07:12,080 So we will also find the rest of this string using this excellent, let's say this would be excellent 66 00:07:13,010 --> 00:07:15,060 to region of X. 67 00:07:17,120 --> 00:07:24,180 So now in this pattern that I want to find ABC, so just for example. 68 00:07:25,130 --> 00:07:40,190 So now what we're going to do is, uh, for I in range of zero comma Randolph pattern. 69 00:07:44,540 --> 00:07:46,840 Or we can also put the pattern. 70 00:07:47,150 --> 00:07:50,270 So what we're going to do is if the pattern is 71 00:07:53,750 --> 00:08:02,340 elongated, etc., now we will take this for this X, that is the input sheet and we will compare it 72 00:08:02,370 --> 00:08:04,010 with the first four letters. 73 00:08:04,200 --> 00:08:10,070 But the trend is for right now, you can tell for sure if this is matches we than the index of this 74 00:08:10,070 --> 00:08:13,190 one as we move on to the next four elements. 75 00:08:14,240 --> 00:08:21,470 Not next for next, continue to fall first day and next week and next Khedive and etc.. 76 00:08:21,770 --> 00:08:28,700 So to do to do that for a range of gyro cover and pattern. 77 00:08:30,470 --> 00:08:32,000 So for pattern, 78 00:08:36,290 --> 00:08:39,490 we need to say, let's say temperature equals two. 79 00:08:39,950 --> 00:08:43,230 So we need to get the first four elements. 80 00:08:43,790 --> 00:08:58,790 So let's a lot of uh, I used to I press for so allow for it because, you know, and I love I press 81 00:08:58,790 --> 00:09:00,620 for it because the fourth element. 82 00:09:02,150 --> 00:09:02,560 Right. 83 00:09:02,960 --> 00:09:10,030 Are I need to say I love eight plus this Trenta minus Andre. 84 00:09:10,430 --> 00:09:11,090 Excellent. 85 00:09:11,090 --> 00:09:17,620 Because the input piece for me cannot trade four because sometimes the condense five characters, uh, 86 00:09:17,660 --> 00:09:22,670 let's say Xanatos Coldren minus one. 87 00:09:23,840 --> 00:09:29,420 So now this gives the exact matching number of elements with the first one. 88 00:09:30,170 --> 00:09:42,630 So now what I want to do is if M is equal to X then OK, let's say something like this list. 89 00:09:43,160 --> 00:09:45,640 I want to say that I love this index. 90 00:09:50,560 --> 00:09:57,760 Now, what we're going to open, we are going to win this because this is the index, we have four legs 91 00:09:57,760 --> 00:09:58,150 of a. 92 00:10:01,630 --> 00:10:06,040 Now, let's go and bring this in, the nexus. 93 00:10:11,100 --> 00:10:16,560 So that's clear and this I hope you have understood this one where exactly comparing this element with 94 00:10:16,710 --> 00:10:26,190 the element of this one, if it does not match us, we want to go next to four characters and so on. 95 00:10:30,120 --> 00:10:32,760 So the 200 bates'. 96 00:10:35,970 --> 00:10:43,490 Now, what I going to do is I want to find the index are starting for let me copy this one or just take 97 00:10:43,500 --> 00:10:43,890 this one. 98 00:10:44,190 --> 00:10:46,590 It's all have capitally. 99 00:10:48,760 --> 00:10:50,710 And six, we should get. 100 00:10:53,050 --> 00:10:57,130 So we do not get the correct answer, so let me fix where we have to draw. 101 00:11:17,420 --> 00:11:25,700 So I think we are prepared for a range of tough battle for every, oh, four bites, this one. 102 00:11:32,250 --> 00:11:35,120 All right, now let's put the whole program. 103 00:11:37,670 --> 00:11:43,550 So that's underbite, and we want to say are one are eager to get. 104 00:11:45,770 --> 00:11:46,730 Now, if you turn to. 105 00:12:27,140 --> 00:12:36,230 So that's one hundred beats and it's the first one we need to find, the three are that. 106 00:12:39,680 --> 00:12:50,540 So we are going from all the patronage tap into where you are is zero and dump should be very system 107 00:12:51,080 --> 00:12:51,830 ABCDE. 108 00:13:03,130 --> 00:13:04,830 Oh, I'm sorry, I'm sorry, I'm sorry. 109 00:13:08,790 --> 00:13:17,660 So we need to see a pattern of I'm so sorry for this pattern of this one so that we get actual better, 110 00:13:18,660 --> 00:13:19,620 so sorry for this. 111 00:13:19,630 --> 00:13:28,220 So this is how you depict the programs and might zero. 112 00:13:28,470 --> 00:13:30,780 I mean, you should get index zero. 113 00:13:35,260 --> 00:13:37,360 OK, let me run that people Gregan. 114 00:13:52,020 --> 00:13:56,910 So let me step through this, and we have got to illustratively are. 115 00:13:59,410 --> 00:14:02,590 All right, we need to not put down minus one. 116 00:14:03,220 --> 00:14:11,860 So let's go ahead and run this now here the character, I think I hope now that said, character w e 117 00:14:11,860 --> 00:14:13,340 kit, we should get different. 118 00:14:13,810 --> 00:14:14,630 So there you go. 119 00:14:14,860 --> 00:14:15,860 We are going to zero. 120 00:14:15,860 --> 00:14:26,710 And I know we get all the occurrences of this that week because that's why we are hoping from starting 121 00:14:26,710 --> 00:14:27,040 to end. 122 00:14:27,850 --> 00:14:29,190 So let's run this again. 123 00:14:29,780 --> 00:14:37,540 Two hundred votes and let's any let's take any for which this one be benign. 124 00:14:38,380 --> 00:14:45,340 And we'll basically focus on four weeks because this these are the two different registers. 125 00:14:45,340 --> 00:14:45,670 Right. 126 00:14:46,580 --> 00:14:55,780 So the maximum value could be four words, each word consisting of eight Mitsotakis, which so be nine. 127 00:14:55,810 --> 00:14:57,430 We need to find this index. 128 00:14:57,700 --> 00:15:01,980 So it's just 34 whenever you see like 89. 129 00:15:02,020 --> 00:15:05,830 Were you in IPA piece pointing to this thing? 130 00:15:05,830 --> 00:15:14,740 And then you understand that from a thirty five index we can after Petteway garbage values or some other 131 00:15:14,740 --> 00:15:15,340 values. 132 00:15:15,490 --> 00:15:15,860 We can. 133 00:15:15,990 --> 00:15:17,200 Exactly right. 134 00:15:18,340 --> 00:15:19,860 Happy with our value. 135 00:15:20,860 --> 00:15:22,810 So that's how this works. 136 00:15:24,690 --> 00:15:26,140 So I hope you have understood. 137 00:15:26,280 --> 00:15:33,930 So this is a simple pattern in the letter, which does not use complex algorithms for selecting these 138 00:15:33,930 --> 00:15:34,480 elements. 139 00:15:34,740 --> 00:15:37,100 So this is just a simple one. 140 00:15:37,110 --> 00:15:38,300 It is very useful. 141 00:15:38,850 --> 00:15:42,810 And in the next year, you will see how to create the pattern with the metal plate.