1 00:00:00,780 --> 00:00:02,150 Hello. 2 00:00:02,160 --> 00:00:08,910 Today's lesson is on Keegan templates. 3 00:00:08,910 --> 00:00:15,910 As you recall in an earlier lesson we have done safety again. 4 00:00:16,260 --> 00:00:24,510 And also we talked about a little bit on Eastern occasion and I did mention that in order to create 5 00:00:25,110 --> 00:00:33,600 an external keychain you need to first learn the assembly language programming so to have you create 6 00:00:33,960 --> 00:00:35,640 an external occasion. 7 00:00:35,760 --> 00:00:41,530 I have created a template it is called Occasion template 8 00:00:49,940 --> 00:00:52,310 so go and download this file. 9 00:00:52,470 --> 00:01:02,010 0 8 keychain template is it from the resource section and put it in your face in projects folder thereafter 10 00:01:02,650 --> 00:01:03,190 and zip it. 11 00:01:08,960 --> 00:01:11,380 And then you may delete the zip file 12 00:01:14,470 --> 00:01:23,370 then open a new 0 8 keychain template folder any reading it he will find a new file called keychain 13 00:01:23,410 --> 00:01:26,200 template here's him. 14 00:01:26,530 --> 00:01:33,470 So this is the basic template that you can use to write your own key again. 15 00:01:33,670 --> 00:01:34,460 So let's open it 16 00:01:38,620 --> 00:01:50,980 and you have all the basic parts of the kitchen that is first compile and run it so clean and run compile 17 00:01:55,250 --> 00:02:01,020 and then copy this stuff you are going to go to this folder 18 00:02:04,110 --> 00:02:17,110 opening command from ICD space and right click based upon the presenter and time desire to check the 19 00:02:17,170 --> 00:02:26,260 contents of this territory and you should have a file Keegan template see if you have a computer. 20 00:02:26,500 --> 00:02:27,450 Now let's run this 21 00:02:30,700 --> 00:02:42,010 time key Preston Preston again PRESENTER Here we ask you for a first name but you can type anything. 22 00:02:42,010 --> 00:02:45,400 ABC the ABC 23 00:02:48,220 --> 00:02:59,110 and the presenter and in January's series key for you taking the first four characters of your name 24 00:03:00,580 --> 00:03:05,500 and then putting a dash in within the year. 25 00:03:05,510 --> 00:03:14,100 Another day followed by the month four for April and then a day and nine for the date. 26 00:03:14,170 --> 00:03:22,270 So this is a sample of a key January's creates a series key based on your name and a date. 27 00:03:22,360 --> 00:03:25,930 Let's take a look how he works. 28 00:03:26,020 --> 00:03:32,900 So here you have a maximum plus size for your name. 29 00:03:33,040 --> 00:03:33,790 I put four. 30 00:03:34,840 --> 00:03:36,190 So this is the trick. 31 00:03:36,520 --> 00:03:45,210 If you want to just a string the first four characters of the name you put four here if you wanted a 32 00:03:45,210 --> 00:03:52,440 straight more more characters you just increase in number accordingly. 33 00:03:52,810 --> 00:04:00,110 And then here is your problem for the user to enter the first name. 34 00:04:00,220 --> 00:04:11,250 So this you bring the problem present the first name and this is the Sierra key scene and the format 35 00:04:11,260 --> 00:04:12,040 specified. 36 00:04:13,080 --> 00:04:18,390 So the first percentage as it refers to the name. 37 00:04:18,390 --> 00:04:33,070 They have a dash for by presentation D for a year followed by a dash 0 here followed by another percentage. 38 00:04:33,160 --> 00:04:44,800 This time for the month for followed by a dash and followed by the date which is Dash and it and oh 39 00:04:44,810 --> 00:04:57,470 here we have the Declaration on the numbers use for the Windows API in the get standard handle function 40 00:04:57,470 --> 00:05:01,640 and redefine function here. 41 00:05:01,670 --> 00:05:09,800 Had a history to store the name in the user enters and we also have a system. 42 00:05:09,800 --> 00:05:19,380 Times did a structure and we created a variable other than did such a system. 43 00:05:19,630 --> 00:05:33,140 Since time it is tiny time on time and then over here we have to get standard handle API to get a input 44 00:05:33,140 --> 00:05:40,280 handle and it is required because refining is to use the input handle to read from the command line. 45 00:05:42,570 --> 00:05:53,890 And then we hear the from the user using a push the string to the state and the name and first name 46 00:05:54,710 --> 00:05:56,320 which is this free. 47 00:05:56,840 --> 00:06:08,560 And this becomes the barometer for if and then after printing the prompt turned his name he will reach 48 00:06:08,810 --> 00:06:14,350 the user input into input string using the refine function. 49 00:06:15,770 --> 00:06:28,400 So input string will contain the name of the user and then hear the get local time to save it in the 50 00:06:28,400 --> 00:06:29,020 system. 51 00:06:29,900 --> 00:06:31,760 So this we know a power function. 52 00:06:32,930 --> 00:06:47,950 So now this time contains the members for the here time and so on and over here a string year and 2. 53 00:06:47,990 --> 00:06:58,760 He s he also copied the man and put it in PBX and copy the D and put it in use case now. 54 00:06:59,670 --> 00:07:03,330 Oh this can be replaced. 55 00:07:03,380 --> 00:07:09,560 So if you are going to write your own kitchen then you replace this is your own code. 56 00:07:10,220 --> 00:07:15,960 You may also need to replace this line change these numbers. 57 00:07:17,270 --> 00:07:24,850 Depending on the algorithm some program might be more than four characters name. 58 00:07:25,280 --> 00:07:28,900 So if you're unsure in my experiment it will be. 59 00:07:30,260 --> 00:07:31,850 So how do you know why no. 60 00:07:31,850 --> 00:07:36,320 Here you have to examine your trainee. 61 00:07:37,180 --> 00:07:38,510 So in creamy 14 62 00:07:44,080 --> 00:07:51,100 if you put a name check it is the patch itself. 63 00:07:51,110 --> 00:07:54,010 Again we need clear. 64 00:07:54,700 --> 00:08:03,340 So from the circle yes you can see that even though you put a motive for characters as a name you only 65 00:08:03,340 --> 00:08:05,680 risk a voice for characters. 66 00:08:05,770 --> 00:08:15,040 So by analyzing the savaging you will know why no one here for me is you are the first four characters 67 00:08:16,860 --> 00:08:27,080 and as you can see the search engine has got one dash so you may need to modify to remove the idea idea 68 00:08:27,180 --> 00:08:28,850 necessarily dash here. 69 00:08:30,310 --> 00:08:38,840 However DFT Jen also shows you that this is not just did some some operation has been performed on the 70 00:08:38,830 --> 00:08:39,190 date 71 00:08:42,410 --> 00:08:45,200 so we may need to study the algorithm 72 00:08:47,880 --> 00:08:51,990 so over here whenever you need a. 73 00:08:52,110 --> 00:08:53,820 So depend on your algorithm. 74 00:08:56,300 --> 00:09:03,650 So this party needs to change here as well as this plus 75 00:09:06,530 --> 00:09:08,700 another part you may need to change these who are here 76 00:09:12,410 --> 00:09:18,980 so the type of string 0 0 q that is produced would be different for every software. 77 00:09:19,730 --> 00:09:26,420 So in this case we are just printing combining the year month and day. 78 00:09:26,420 --> 00:09:39,050 So we are pushing e e x EBIT and see X is yes to the stack and then use printer to clean up a zero key. 79 00:09:39,100 --> 00:09:50,760 So if you do use this for my specify a silky which is this for specify pacifier and we did it. 80 00:09:50,960 --> 00:09:58,840 Here we substitute s DDD with these values input string. 81 00:09:59,110 --> 00:10:00,490 Yes. 82 00:10:00,830 --> 00:10:07,970 And is here so interesting to replace your percentage has 83 00:10:10,990 --> 00:10:20,610 and yes who replace the first T X replace. 84 00:10:20,700 --> 00:10:26,740 Secondly and finding the last D who will be replaced is X.. 85 00:10:27,120 --> 00:10:36,810 So in the end you will get you will get this string and yeah I think am I need to change keys here is 86 00:10:37,020 --> 00:10:47,330 value in this example the multiply phone time is five but if you have a different number pushes you 87 00:10:47,340 --> 00:10:48,060 need to count. 88 00:10:48,900 --> 00:10:57,810 So here you have five pushes one two three four five five parameters so you multiply that five if you 89 00:10:57,810 --> 00:11:01,890 will have six parameters then you must multiply six. 90 00:11:02,130 --> 00:11:05,420 So this is not a place you need to change. 91 00:11:05,430 --> 00:11:13,200 So you need to study the assembly for this program and then just from there you understand the algorithm 92 00:11:13,200 --> 00:11:27,650 first and then only you can write your own code by replacing the necessary parts here here here as well 93 00:11:27,710 --> 00:11:32,460 as here and here. 94 00:11:32,580 --> 00:11:33,460 All right. 95 00:11:33,460 --> 00:11:38,970 And yeah I said in times you may need to do more than just these few of us. 96 00:11:38,990 --> 00:11:48,410 So in this lesson I will show you how to use this template to Ray Keegan for this company. 97 00:11:48,590 --> 00:11:50,520 So thank you for watching. 98 00:11:50,630 --> 00:11:51,470 See you on the next line.