Ok.
Ok, let's go ahead and get started.
Okay.
Good morning.
Welcome everyone, let's go and get started.
So first let's talk logistics. So tutorial three we're working on here I'd like to get that all checked off by.
You know I like to get most of you checked off by the end of today, but you can still come to office hours next week, I'm tutorial to I definitely want you to be done with so if you're if you're finished with tutorial to buy today you're definitely getting
getting behind assignment one right now. Well, I haven't updated that so assignment one right now I've put as I'll be talking about assignment one and assignment one is based on this code text analyzer to, which is based on tutorial tues code text analyzer
one. I will go through today the differences between them, but they aren't that, you know, it's more using some of the techniques we are used in tutorial three, but the contents there and so that you have, you know, this actually I think 12 parts.
If you break it down but seven for questions and worth 20 points.
So the question I have is right now it's due in a week.
So let's go here.
So right now, let's go back to this.
So the midterm.
So the midterm right now is March 4. So that's just after the break. March 2 is the midterm review so basically that's the week after fall after winter break right now.
assignment to is do just before the break. So the idea would be that it's due on that Friday, and I can go both ways I can go through the solutions for assignment two, and then you have the solutions for assignment one and assignment two, and you can
review those over the break, and then we have a midterm review and then you have the midterm exam that's the way I was planning it.
If you all are wanting more time for the assignments, I could make assignment to do on March 2, or just before March 2, and so I would go to the solutions in the midterm review.
And then, so then I can know if so if that's due March 2, I can push back assignment one to like your February 16 basically at least give you another week or something.
So, so the question is Will you have some sort of practice midterm no you will not have a practice midterm, because the assignments are essentially your practice midterm.
That's what I, the to the assignments are based on the tutorials, the midterm and final are based on the assignments. So the idea is that way you know exactly what it is you're responsible for my idea and the midterm review is all will discuss the concepts
and topics. And then we have a reference to the assignments, and thus you should have a good, excellent you know understanding of what the questions will look like on the midterm.
So, so the question I have right and so I'll make a Paul
saying in the termination of dates as well. Yes, that's why you do have to say that's why I am asking you all now is I want to get a sense of what you all want to do here so we create a poll here.
So.
So when is February.
Yep.
that's right. Explain what sorry, the options. The options for the pole.
Oh yeah I explained that right now so hold on one second. Let me just I'm just I'm so,
so the idea is right now.
So I'll just go ahead and start this so people can watch but the idea is that the first option is what the current situation is. And so the idea is that you be a site assignment to will be do, just before the break.
And so I'll give you the solutions. And then you have the solutions for assignment one into the study over winter break. There's a review on March 2, and then March 4 is the actual midterm.
The other way is you basically have the break to work on assignment to its do just after the break. When we basically go over the assignment to answers as part of the review for the midterm, and then the midterm is on the fourth
is assignment to on the thing, supposed to be the 25th not the 16th.
Sorry. The 26th says the wind should be Sunday do. First one is third and 18. The second one is ninth and 16.
No, no, sorry 916 for a one, and for a two normally comes out two answers come out the 16, or what the assignment one oh I just haven't decided what they do with the ninth of the 16th for assignment one.
But the main thing is assignment two would be would be do on March 1.
So the solutions would come out on March 2, which is just before the midterm.
Oh, wait. So why is there two days.
Pro versus the ferry March that very night 16, I haven't decided on which one to do.
Oh okay, I give one or two week extension on the current due date.
Okay, that makes a lot more sense. I was like, I thought that it was the ninth and the 16th from first summit the second second.
I thought it was the ninth and 16th for the first assignment and I'm
sorry.
Okay.
So, I will be on the same concept as like the assignments.
Yes, exactly based on this order.
Huh. And there's no length, like is it longer by is going to be lot more questions on the assignment or he's going to be the best questions and then the assignment or more different.
minutes. I'm not expecting you. I mean, so the questions are more pointed.
So, it's the ideas the concepts on the midterm, it's all going to be short answer on what's going to be on the assignment one and two.
So if you understand the same one and two well you'll do great on the midterm.
Okay, thank you, not need your camera on for the midterm.
I'll explain the midterm I have a separate solution to deal with.
I'm still deal with plagiarism and such.
Okay, are we all done.
Anyone else.
Okay, all I see this one person who hasn't but I'll just ended there.
So, what we see here is a slight preference for doing things later.
Okay, you're a post a sample midterm just look at last year's midterm.
The all the material for last year's run of this course is there, the midterm is posted the solutions for the midterm or even posted.
So feel free to go and you know look at the past mid term.
So, I kind of show you know.
So anyway, but so think about.
This is close enough. My guess oh that's that's five people more than ry, so the people who want to keep the current dates.
What are your thoughts you want the extra time for studying.
Yeah, if you do bad on assignment to you'll only have two days to understand everything.
Yes.
Yes, exactly.
Okay, so a middle position would be for me to release solutions to the assignment to during the break.
And basically I would have the assignment to do before the break.
But I would, I would accept it until say the middle of the break.
How does that sound.
So, somebody. So here's, here's my. So, so we could have.
So we'll do assignment, one you every night,
don't want to have anything officially do during the break.
but I'll accept it until
the 23rd to the 22nd.
any penalties for taking until the 22nd no no penalties.
Does this sound good to everyone anyone,
any concerns.
Ok.
Cool. So, I would wreck it so basically my recommendation is to try to what I'll keep.
I'll keep.
I'll keep this do the third.
So February.
Also until February.
So, if some of you are running behind you can.
You've got your basically some extra slack in there.
Can you submit the assignment.
You could do. Yeah, Exactly.
Well the 15th Yes, exactly. You can submit by the 15th.
So what was the question. I missed multiple times
around when will assignment to be posted.
assignment to posted by the end of next week.
Okay so, so that's what so this is what I'll do. And so in bright space it'll actually say what the cutoff date is for accepting this. How long should it take us to complete the assignments, it, it really, you know, it depends on your background I can't
I mean, they shouldn't take if you've been doing the tutorials, they shouldn't be that bad now. So, so this is assignment one assignment one just requires you to me I may have the solution.
The solution is didn't take me long to write up because I understand it so it's all question how much you understand things.
So here's the assignment here, it's posted in bright space. The link to this, so you have now there is an assignment one in bright space, you do with that.
Now, one key thing about the solution that you're supposed to specify. Is it supposed to send in is you're supposed to create as a text file. Following this template.
So what you should do. Let me show you how you answer it. So I'm going to save link as.
So we'll save it and my desktop saved on my desktop here.
Save on my desktop here. Okay, and I'm going to save it. I'm going to change the name to.
So my my Carlton one username.
So that's now there on my desktop. I then we'll go into my editor.
So here it is, I'll fill in my name.
So, sir.
Sir.
lines.
So, you fill in the template here, this is what it is. And then after you filled it out.
Check it before submitting
go here.
Browse this.
And so what it should say is past it. You know, if it doesn't say past. So for example, if you do something like don't answer the last question and delete it.
So it's not in there, let's reload this page here, you'll get an error like.
You'll get error, expecting questions one a one B is it's no seven but got this so you're missing question seven.
And this also shows you what it interprets for each question.
So, the reason it's important. So,
when.
So, this is what you should do. Now you might go like, why am I doing all this.
It's very simple. I know.
So this is basically why I want to do this is to make grading faster and fair, because that way we grade all a coin question all have another question.
And we do it all with no names just a student numbers.
So you're nice.
So, is this all clear to people, you know so doing this.
So what's life. so carriage return line feeds.
So, when you have attacked so.
So, text files can use different line endings, and you should like to be fair, I can my script can actually handle variations on this, to some degree, but you need to know this because if you make, if you mess up a file and make a text file that has both
carriage return line feeds as line endings and then line feeds or something like if you do some weird cut and paste and combination things. It can confuse programs.
So, you should know about this idea.
and do it Lansky note was there I'm back on comments I'm.
I just muted you on the back end if you need to talk please unmute fun.
Are these instructions going to be uploaded somewhere.
These are going to be in the lecture notes.
But I think the top of the assignment, basically says this, please ask off on the question apply template, your upload fashion be this, you know username and should be a Unix text file line for endings use me uses validator picture makes your answer files
properly named and formatted.
So, You have a, you have a program to check conformance, you have basic directions here. And if you need more elaborate ones they are in the lecture notes.
or you get an example, I just showed you an example but you have a valid data program, the validator will tell you whether it's right or not. and it checks for lots of different kinds of errors.
So, and in fact, I'm the past. This is the first time I am making a web based validator available I've done this, I've been creating these things for a couple of years now, but this is, I've been using a JavaScript program written in Node.
js for analyzing the assignments and actually this way splitting it and.
But finally, I've got it just so many students seem to have a problem with this. So, I mean a validated program and why did make a valid program last semester by made is a command line Node.
This is the first time I've made it into a little thing now, I will say, if you look at you can view the source on this. And you can see my code, my code is horrific.
So it, I'm pretty sure it basically works it might have some bugs. But, yeah, it's pretty horrific. So she decides to rewrite it let me know
if you see any bugs if it like if something weird happens, let me know. And, and again if you have problems of validating your assignment and like, I don't know what it is or keep mine.
So any further questions.
evaluator tell us if these things that visual yesterday tells you, yes, it shows you everything. If you get an error from it that you don't understand.
Okay so, um,
okay so there aren't any other questions. Again, we have time, you can try this and if you have issues, let me know. But, but no, it's us a text so use a text editor here.
So, so yeah.
Okay, so that's so now let's go over the material so that's how you submit assignment one.
Let's talk about the contents of this.
So let me first run it for you. So this, the assignment is based is on text analyzer to. This is what the layout looks like. If you look at it in the simulator.
You'll see.
I think I have actually I think there's more my solution here. So, Let me,
let me go here and
make sure I get the current conversion I have.
Okay,
from that.
And here's the simulator.
Less visually confusing. So here's text analyzer, I went ahead and did the changes to the code that you should have done in tutorial two with a few little things so here, uppercase you know empty count pets mentioned, you know can say,
row, row she
always wants is correct Roshi doesn't like that. So, this all shouldn't look very different. What I have done, however, is I've split it up. If you remember, if you go back to text analyzer one
text analyzer one had.
So I had a text field and then have this thing here and a menu, you know menu so like how some deliberate things that as a mode menu and then the functions.
What I've done instead here with text analyzer, too, is I've split it up a bit more.
I added this app title view.
I've added this analysis results view. And so, same basic functionality. And so app title just puts in the text here and do some formatting of it and add some spaces above and below it.
And then here is the analysis result. And this is a little different.
This is a little different and in particular notice when the program starts.
So right now it's as pets mentioned, so let me, let me do the first run this again.
So you'll notice that when it starts, it says, Please select a mode.
and here if you type something.
So I do that nothing happens here. I have to go here and select count. And then this all happens.
Now notice, this is the code that makes it happen.
One of the things is understanding how does this work, and how does it compare to what text analyzer one does.
And then mode menu. This is basically the same count uppers the same counts pets mentioned that's the code you should have written analysis, you know here, and you know this year so so yeah so this is, you know, not much.
Not much in the way of changes just a couple of minor things.
So, if you understood text analyzer one understanding this one shouldn't be a problem.
And in terms of the questions.
I want you to know about the Analyze analysis result what's the purpose of the spacer What does the result air say when the app starts Can you make a display initial message.
After you selected thankfully analysis menu Why or why not.
Why aren't we using a binding decorator and app title.
You know how could you change the analysis directories, where does it use any more closures, you change to preserve friends functionality so basically convert those anonymous functions into name functions.
Created create a pet count thing. I'll be honest, my solution for pets count, I did look do a search online to do it because doing it the brute force way is just way too annoying with Unicode.
And so I found I found a clever way for that so if you looked up that's fine but make sure you cite it.
The rest of these things. I don't think you can look up much. you're going to have to actually understand the code.
But email and look up things to understand what's going on.
How could you add a menu option other that sets the analysis of other without changing analysis dictionary with this new menu option do.
How do you site format wise.
Yeah, so, Daniel is that clear.
Can you elaborate on the other analysis mode and what it could do. No, it's just saying, I want you to add a menu option other, but do it with, I don't want you to create the other.
Don't add an entry to the analysis one.
Just add a menu item.
So, so this, so this is saying, other announced other without changing optics right and then what if you basically don't update the analysis dictionary but just make it display other in the venue.
What will happen.
Said help Carl.
Carl you good anyone else.
mean so so really what you're talking about, how can I change this. So, I can add another menu entry, without changing the state of structure.
And the question is, well,
there's other ways of it analysis, you can change this code to add an entry to the analysis menu with, because right now this automatically generates a menu from this dictionary.
I'm confused cream This is this extra practice.
What do you mean is this extra practice.
Yeah, yeah this was assignment, sorry. Yeah, no problem. Yeah, this is the assignment.
Yeah, no problem. Yeah, this this is the assignment. So, this is a code there so again if you understand tutorial on this code from tutorial to text allies to this assignment should be quite straightforward.
This code from tutorial to text allies to this assignment should be quite straightforward. If you got a visually, you had a question.
Yeah, it's just about the Carl's question actually like the analysis more thing so but just so I know for sure.
You want us to add a menu option just like the pets counter pets or whatever, but just not added through that specific construct.
Basically, you should, it should do the button should do exactly what the other buttons do.
Okay, but you don't want us to add it in that specific place where there's like the array of all the different yeah you don't don't add it here. Don't add it to this to this year right Don't touch okay.
When I select a menu. It should sue other, and it should set the, just like the other menu items, it should set the mode to be analysis mode to be other.
Okay, make sense. Thanks.
Cool. Okay.
I'm sure should there be a function associated with other. Well I'm just saying you can't change analysis, you can't change this data structure.
So I'll just say that.
But that's that's the best part of the question.
Okay.
If your intuition that things will be a little broken.
You're on the money.
I was trying to close them to function. Yes, that's all I'm doing is this question six I'm just trying to just turn the clothes into function so this is six should be pretty easy.
Well, bad practice. Yes.
It might be worse than that.
I will say that your solution shouldn't crash the app.
But you should understand what's going on in text analyze that you understand that
anything else.
Daniel kind of play with the code and see what happens in your. I think it will become pretty clear.
So now I'm.
So why why, if there are any answer the question the assignment I wanted to go back to us tutorial three.
So remember, so what's so I think we,
we talked about.
I think we went through most of tutorial. Oh, we didn't go through the gesture stuff.
So I will. I'll talk about that.
For Question, three are we keep this up in the town.
Um.
How often are the analysis mode functions called at minimum, how do you know,
Kyle, I will say that question three is a little trickier than it might seem
so.
So really think about that.
Okay, so let's, let's talk about the tutorial here and particularly let's, I want to talk about gestures.
And what's going on with these gestures, because this is a key thing it helps you understand.
So concert so.
So, if you really get to understand gestures.
You really have to understand what's going on with user input.
So.
So when a user touches a screen press is a key.
What's happening.
So, the thing first of all to understand, to a first approximation with swift UI. When the user touches the screen, and does anything with that your code does nothing.
It is completely handled for you behind the scenes.
So what's happening with a text field, when you, when you, when you create a text field here. So this let's go back to. Let's go back to this code here.
So here's our basic you know text analyzer one.
We have this text field here. And it says enter text, and then we say text, and we say, No, dollar t, which is a state variable.
So, notice that our code doesn't see the individual keystrokes at all.
This is kind of weird this.
So we aren't doing anything like, you know, let's read some characters and then let's parse the characters and let's do something.
What's happening instead with this, you what's happening instead is we've defined a state variable.
So this is the, the idea that you have to make sure it's very clear in your head, is that you're not the text changes here in the state variable.
And then your code. I mean, we don't handle the input directly, we don't see the input directly, all that happens is the entire screen gets refreshed.
Any view that depends upon the state will get refreshed, which means that the code will be run again.
So, like, you know, which code we talking about here we're talking about the text field itself will get updated. And then what else depends upon T is this this this text so this view will be redrawn every time a characters enter.
Yes, you don't have to do a lot of detail but notice that the text.
16.
You don't have to make the code to move to the next character No, you don't have any code talking about the next character at all.
I am the code reread the whole input every time yeah so.
So, what's your watch what happens with text analyzer let's. So literally,
What we see this most easily.
We do this when we do the count.
So this.
In order for this count to be updated every time we press a character that means the state variable as it changes.
This is automatically getting updated. This view is getting redrawn now. Logically, the entire screen is getting redrawn, but swift UI is smart enough to only redraw the portions that are affected by the by the state variable.
We don't have to think about what part of it is affected, it knows because it knows what's a function of that state variable, know the title text analyzer, that doesn't depend on what character has been typed, so it doesn't have to be redrawn the analysis
menu doesn't have to be updated because again that's not dependent on it, but this results area does have to be updated and so it is.
I'm getting confused on typing because I normally type divorce, and in here I have to type corny. So, I'm switching back and forth and it gets annoying.
So, this is.
So,
so this is so you're, you just tell swift UI, what does the screen look like, and what are the variables that relate to how the screen works.
So notice what happens with
in tutorial three, how does this relate to know so then how do we.
So this is the really interesting part here about let's switch to
demo one. No, no, sorry we're doing drag demo.
That's code I'm working on for tutorial for not quite there yet.
So wait for those you in 1406.
If you have you finished four to six you've seen the traditional way of doing interfaces.
If you haven't finished 1406 and you're going to see it soon. And we're going to see it in this class later when we do Android interfaces and then we do iOS storyboard.
The reason so I can kind of gone back and forth of how to start the course and whether to do it this way, versus the other way, but I really want you to.
Oh, that wasn't good.
She was on saying something
Caitlyn syntax is has a lot of similarities to the Swift, it has little differences.
But the programming model behind Caitlyn is actually very similar to Swift, so you'll see that it's like, oh you're doing this you're doing the same idea in a slightly different way, like for example the whole having variables that you can't just have
pick on no values that's a big part of Catlin's designed to what just happened. I lost my.
I lost my ex code, it just crashed.
Yeah, so it should be pretty easy to switch. I can't run hex code.
Anyway, we're about out of time.
We see Can I can I can run the simulator Let me see if I go home I think it's still here.
Oh yeah, here it is.
So here's, here's the drawing the circle to the box, how is this animation happening.
The way this animation is happening is we're just in response to our drag operation, we just have a callback function that changes the location of the circle.
We're not explicitly animating the circle. We're just changing its position, but because it's position is constantly being refreshed by the views gang refresh, we get animation.
We definitely do check off see I'm just I'm wrapping up here now I'll stick me remember class officially goes from 1130 to 130 so the time after I'm done lecturing, we use for answering questions and for doing check offs and stuff so.
But notice that so but this animation here is happening this way. So when we.
So what's actually the, what doesn't. when we handle gestures.
So when you have a drag racing, all that does is update state variables, and it's called when user event happens.
This whole, you know, having to track exactly how the user interface stopping what you're doing a touch in a drive or something like that that's a lot of state and it doesn't really fit well with a swift UI model.
And so what they do is they abstracted away and let some other lower level bit of code deal with all that pain, so you don't have to think about it.
So, that's all I really want, I think we're about good here I was going to stop here any other last questions about tutorial three otherwise, or the assignment one otherwise I will stop here and we will.
I'll stick around to do check offs.
And,
Yeah, so anyone else.
sound good.
And that was just for the chat call. Oh you're raising your hands for check offs. Okay, I wouldn't call it. Anyone raising anyone wanting to ask the question.