WEBVTT

00:00.960 --> 00:01.640
Hi everyone.

00:01.640 --> 00:02.320
Welcome back.

00:02.360 --> 00:06.240
In this lecture we are going to be coding the similar functionality.

00:06.240 --> 00:12.520
But we are going to be try to implement the same functionality using the coding assistant.

00:12.520 --> 00:15.480
So we hand coded this whole logic right.

00:15.520 --> 00:20.200
And also we ran the program and then validated the program.

00:20.200 --> 00:27.000
Now I'm going to show you one additional approach of coding the same logic using our GitHub copilot.

00:27.160 --> 00:28.400
So in your package.

00:28.400 --> 00:33.120
So if you open the stream Gatherer's package you will see a markdown file over here.

00:33.400 --> 00:41.680
So this markdown file has all the prompts that are required to replicate the code we have been doing

00:41.680 --> 00:42.200
so far.

00:42.200 --> 00:48.240
And I have the prompts available pretty much for all the functionalities that we are going to be exploring

00:48.240 --> 00:50.920
for the stream Gatherer's API.

00:51.080 --> 00:56.080
So in this case, what I'm going to do, let's say you want to do the same coding logic, right?

00:56.120 --> 01:01.960
But you still don't want to hand code it basically the traditional way of coding everything by yourself.

01:02.160 --> 01:07.120
Then what you can do is you can leverage this stream Gatherer's markdown file, and then you can see

01:07.220 --> 01:13.460
that I have a prompt named Windows Fixed Operations certain creating fixed size groups.

01:13.460 --> 01:16.740
So I'll create a table of contents also over here.

01:17.580 --> 01:17.940
There you go.

01:17.980 --> 01:19.380
We have the table of contents.

01:19.380 --> 01:22.100
So it has the windows fixed operations.

01:22.100 --> 01:24.660
If we go to this one it talks about this one right.

01:24.700 --> 01:28.820
So I'm going to be copying this and then open the copilot chat.

01:28.820 --> 01:30.180
I'm not going to use the agent mode.

01:30.180 --> 01:30.500
For now.

01:30.500 --> 01:31.820
Let's use the ask mode.

01:32.020 --> 01:33.460
Let's create a brand new chat.

01:33.660 --> 01:34.300
There you go.

01:34.540 --> 01:36.940
So in here I'm going to be placing this one.

01:36.940 --> 01:38.620
So what is the prompt actually.

01:38.620 --> 01:45.020
So the prompt says that create a method that demonstrates the fixed size windowing of movie collections.

01:45.020 --> 01:47.060
And this is the name of the function it's going to be.

01:47.060 --> 01:48.900
That's the expected function signature.

01:49.060 --> 01:53.860
And then I'm going to be passing these requirements to the LM okay.

01:53.900 --> 01:57.900
So in this case the section header should be windows fixed.

01:57.940 --> 01:59.060
That's what this one is.

01:59.060 --> 02:01.060
Basically this is the print line.

02:01.260 --> 02:04.380
Let me put this in a side by side view and then explain this code okay.

02:04.420 --> 02:09.300
And then what we are doing is that hey the gather that window fixed three to group the movies into windows

02:09.300 --> 02:15.480
of three and process each window as a separate collection and print window contents with proper formatting,

02:15.640 --> 02:18.800
and display each movie with indentation of this one.

02:18.840 --> 02:25.920
Add spacing between windows for clarity, and then handle classes where final window may contain fewer

02:25.920 --> 02:27.040
than three movies.

02:27.120 --> 02:27.760
So here.

02:27.760 --> 02:29.880
This is a very descriptive prompt.

02:29.880 --> 02:35.160
The reason why I'm giving this descriptive is that I would like to have the same code that I have done

02:35.160 --> 02:40.400
to be replicated, but when you are working on some features, let's say you have some thoughts on your

02:40.400 --> 02:40.800
head.

02:40.840 --> 02:44.520
You can actually provide those thoughts in simple manner.

02:44.720 --> 02:48.320
You should still be able to see the similar code replicated for you.

02:48.480 --> 02:53.480
Okay, so now I'm going to pass this prompt and then ask it to write the code for me.

02:53.480 --> 02:57.200
So I'm not doing agent mode, I'm just doing the ask mode okay.

02:57.240 --> 02:58.240
And then press enter.

03:02.160 --> 03:08.000
So here you can see write the same code that we wrote over here is being written for us.

03:08.280 --> 03:10.320
So it says that this is a sysout.

03:10.320 --> 03:12.640
And then we have the gather window fixed of three.

03:12.680 --> 03:18.960
And then you have the whole code being printed in the console after the gatherer gathers the windows

03:18.960 --> 03:20.260
of fixed size three.

03:20.300 --> 03:21.660
And then you can see that.

03:21.700 --> 03:23.540
Here is a quick summary of what's done.

03:23.580 --> 03:26.380
Here we have the group stream into fixed size windows.

03:26.620 --> 03:28.300
Handles the last window gracefully.

03:28.620 --> 03:30.700
And then printing the title over here.

03:30.700 --> 03:33.300
Now you can actually also ask more questions on.

03:33.340 --> 03:37.820
That can you explain more about the windows fixed.

03:40.820 --> 03:44.100
So here it gives you some different examples actually.

03:44.100 --> 03:46.500
So here it gave you a very simple example.

03:46.500 --> 03:48.380
Here we have a list of integers.

03:48.380 --> 03:50.860
And then this is the gather function.

03:50.860 --> 03:53.300
And then this is the output how it's going to be.

03:53.340 --> 03:57.060
And it also talks about what is the key characteristics over here.

03:57.060 --> 04:00.500
And then you can see that with 12 movies how the result is going to be.

04:00.660 --> 04:05.500
And comparison with windows lining is something which we are going to look in the next lecture.

04:05.500 --> 04:07.460
But this is a beauty of this coding assistant.

04:07.500 --> 04:10.540
Now what I'm going to do is that I'm going to remove this whole code.

04:10.620 --> 04:11.060
Okay.

04:11.260 --> 04:14.500
Now I'm going to ask the agent to make the change for me.

04:14.500 --> 04:16.420
So now I'm going to go to the agent mode.

04:16.900 --> 04:24.260
Can you please make the change in the demo dot Java file, please use the initial code that you generated

04:24.260 --> 04:25.140
for movies.

04:25.140 --> 04:26.310
So I'm going to press enter.

04:26.350 --> 04:26.550
Okay.

04:26.590 --> 04:31.110
So this is an agent mode which is going to go to this file and then make the change for you.

04:31.150 --> 04:33.870
You'll be able to see it as it's doing the changes.

04:33.870 --> 04:38.750
So let me close this one open so you can see that it is going to be starting to edit.

04:38.790 --> 04:39.590
You see this right.

04:39.590 --> 04:41.350
It edited the file for you.

04:41.350 --> 04:45.670
So here we have the similar code which is movie stream gather for each.

04:45.870 --> 04:48.950
It's the same code that we wrote beforehand.

04:48.990 --> 04:50.750
Now you have this code readily available.

04:50.790 --> 04:55.070
All you got to do is give this prompt and it will write the code for you.

04:55.110 --> 05:00.630
Let's say if you are really lazy to type in, but you still understand the complete concept, if you

05:00.630 --> 05:05.230
want the AA to do the for you, it will very much do the job for you without any issues.

05:05.270 --> 05:09.790
Now what I'm going to do, I'm going to be accepting this change, and then I'm going to run the program

05:09.790 --> 05:12.110
again, and then I'll show you the result.

05:13.990 --> 05:14.710
There you go.

05:14.750 --> 05:17.110
It's the same result that we have over here.

05:17.110 --> 05:22.790
So this is the beauty of these copilot assistant where you don't have to hard code everything.

05:23.030 --> 05:25.710
All you got to do is provide a proper prompt.

05:25.750 --> 05:28.870
It will write the code for you without any issues.

05:28.870 --> 05:31.870
And this also improves our speed of learning.

05:31.870 --> 05:37.690
And also from a developer standpoint, all you got to do is you ask the prompt, the LM will write the

05:37.690 --> 05:38.530
code for you.

05:38.570 --> 05:42.810
You will be like a human in the loop who validates the code is good or bad.

05:43.050 --> 05:48.090
If the code generated is not aligned to what you are thinking, all you got to do is give it a feedback.

05:48.090 --> 05:49.770
It will make the changes for you.

05:49.770 --> 05:54.730
So in the following lectures I'll be hand coding this stream gatherer API concepts.

05:54.730 --> 05:59.810
But this is something which I would like to show you as a modern way of learning things.

05:59.810 --> 06:02.210
Modern way of coding concepts.

06:02.250 --> 06:04.050
Modern way of building applications.

06:04.050 --> 06:11.050
Using these AI assistants, these AI assistants are going to stay and it's going to continuously get

06:11.050 --> 06:11.570
better.

06:11.650 --> 06:17.090
I hope you all were able to successfully code this windows fixed concept using the AI assistant.

06:17.090 --> 06:21.970
And in your case, all these concepts will be available as part of these prompts.

06:22.330 --> 06:28.730
Um, please go ahead and start using these concepts of using AI assistant to write the code for you,

06:28.770 --> 06:35.090
which is again going to improve the developers productivity and also the speed of learning as you learn

06:35.130 --> 06:36.010
new concepts.

06:36.010 --> 06:37.530
This marks the end of this lecture.

06:37.530 --> 06:38.610
Thank you for watching.
