[User] Please transcribe this text

[Assistant] Uh, and so the regulators decided not to tell the broker-dealer that he can't answer that question. So he is a bit, he or she is a bit like an investment, uh, advisor, but it's excluded from the category. So financial advisors are then regulated.


[User] Please transcribe this text

[Assistant] Uhm, see the, uh, in the United States, the National Securities Markets Improvement Act of 1996 required that all advisors managing more than 30 million each must register with the SEC. Those earning, uhm, managing less than, uh, 25 million


[User] Please transcribe this text

[Assistant] Uh, have to register with their state, uh, securities regulator. You might wonder what if I manage 27 million.


[User] Please transcribe this text

[Assistant] If I'm in between 25 and 30, uh, well, that, then you have a discretion. You gotta go to one or the other. The act does not mention prudent, uh, person.


[User] Please transcribe this text

[Assistant] But it does, uh, bar convicted felons from serving as an advisor. So we're trying to get good people. Now a financial planner is someone different. That does comprehensive planning for life for you. It's not, uh, regulated.


[User] Please transcribe this text

[Assistant] We have organizations like the Financial Planning Association which certifies people as certified financial planner.


[User] Please transcribe this text

[Assistant] Uh, the Dodd-Frank Act, uh, even though it's a thousand pages long, asked for only a study of financial planners. Uh, there's just too many details for, uh, the world is, how do, how do we regulate them? Uh, that's a problem.


[User] Please transcribe this text

[Assistant] Basically it has konbu, bonito, and then I'm gonna add some of my onions and garlic into it as well.


[User] Please transcribe this text

[Assistant] Text detection is an unusual problem in computer vision, because depending on the length of the text you're trying to find, these rectangles that you're trying to find can have different aspect ratios.


[User] Please transcribe this text

[Assistant] So in order to talk about detecting things in images, let's start with a simpler example of a pedestrian detection, and we'll then later go back to apply the ideas from, that will develop in pedestrian detection and apply them to text detection.


[User] Please transcribe this text

[Assistant] Height to width ratio is different for different lines of text.


[User] Please transcribe this text

[Assistant] Although for pedestrian detection, the pedestrians can be different distances away from the camera, and so the height of these rectangles can be different depending on how far away they are, but the aspect ratio is the same.


[User] Please transcribe this text

[Assistant] And we could have chosen some rounded number, like 80 by 40 or something, but 82 by 36 seems to work.


[User] Please transcribe this text

[Assistant] On this slide I've shown 12 positive examples with y equals 1 and 12 negative examples with y equals 0. In a more typical pedestrian detection application we may have anywhere from 1000 training examples up to maybe 10,000 training examples or even more if you can get even larger training sets.


[User] Please transcribe this text

[Assistant] And what you can do is then train a neural network or some other learning algorithm to take this input


[User] Please transcribe this text

[Assistant] And, uh, if you step this over one pixel at a time, so if you use a step size or a stride of one, that usually performs best, but it's more computationally expensive. And so using a step size of maybe four pixels at a time or eight pixels at a time or some large number of pixels might be more common since you're then moving the rectangle a little bit more each time.


[User] Please transcribe this text

[Assistant] But so using this process you continue stepping the rectangle over to the right a bit at a time and running each of these patches through the classifier until eventually as you slide this window over the different locations in the image first starting with the first row and then with the further rows in the image.


[User] Please transcribe this text

[Assistant] When you take an image patch like this, what you're really doing is taking that image patch and resizing it down to 82 by 36, say. So take this larger patch and resize it to be a smaller image and then there's this smaller resized image that is what you would pass through your classifier to try to decide if there's a pedestrian in that patch.


[User] Please transcribe this text

[Assistant] And finally you could do this at even larger scales and run that sliding windows to the end. And after this whole process, hopefully your algorithm will detect what are the pedestrians that appear in this image.


[User] Please transcribe this text

[Assistant] So that's how you train a supervised learning classifier and then use a sliding windows classifier or use a sliding windows detector in order to find pedestrians in an image.


[User] Please transcribe this text

[Assistant] Label training sets with positive examples and negative examples with positive examples corresponding to regions where text appears. So instead of trying to detect pedestrians, we're now trying to detect text. And so the positive examples are going to be patches of images where there is text and negative examples are going to be patches of images where there isn't text.


[User] Please transcribe this text

[Assistant] Mathematically, the way you implement that is you look at the image on the right. What we're doing to create the image on the right is for every pixel, we're going to ask is it within some distance of a white pixel in the left image.


[User] Please transcribe this text

[Assistant] And so if a specific pixel is within say 5 pixels or 10 pixels of a white pixel in the leftmost image,


[User] Please transcribe this text

[Assistant] And then we'll also color that pixel white in the right-most image. And so the effect of this is it'll take each of the white blobs in the left-most image and it'll expand them a bit, so grow them a little bit by seeing what are the nearby pixels, the white pixels, and then coloring those nearby pixels white as well.


[User] Please transcribe this text

[Assistant] Finally, we're just about done. We can now look at this rightmost image and just look at the connected components and look at the contiguous white regions and draw bounding boxes around them.


[User] Please transcribe this text

[Assistant] And in particular, if we look at all the white regions, like this one, this one, this one, and so on.


[User] Please transcribe this text

[Assistant] Then we can draw rectangles, the bounding boxes, around this text region, this text region, and that text region, corresponding to the Lulubies Antique Mall logo, this Lulubies, and this little open sign, uhm, over there.


[User] Please transcribe this text

[Assistant] Now, you recall that the second stage of the pipeline was character segmentation. So given an image like that shown on top, how do we segment out the individual characters in this image?


[User] Please transcribe this text

[Assistant] Whereas the negative examples, well, you know, you don't want to split two characters right in the middle. You don't want to split two characters like that. And so these are negative examples because they don't represent the midpoint between two characters.


[User] Please transcribe this text

[Assistant] So what we do is we would train a classifier, maybe using a neural network, maybe using a different learning algorithm to try to classify between the positive and negative examples.


[User] Please transcribe this text

[Assistant] Classified in this position, we ask, well, should we split those two characters, or should we put a split right down the middle of this rectangle? And hopefully the classifier will all put y equals one, in which case we will decide to, uh,


[User] Please transcribe this text

[Assistant] Draw a line down there to try to split two characters. Then we slide the window over again. Hopefully Carl says don't split there. Slide it over again. Hopefully he says yes, do split there.


[User] Please transcribe this text

[Assistant] And so on, and we slowly slide the classifier over to the right, and hopefully you'll classify this as another positive example, and so on.


[User] Please transcribe this text

[Assistant] And hopefully it'll tell us, you know, what are the right locations to split these characters up into, uh, to split this image up into individual characters. And so that's 1D sliding windows for character segmentation.


[User] Please transcribe this text

[Assistant] So here's the overall photo OCR pipeline again. In this video we'll talk about the text detection step where we use sliding windows to detect the text. And we also use a one dimensional sliding windows to do character segmentation to segment out, you know, just a text dimension to individual characters.


[User] Please transcribe this text

[Assistant] Supervised learning, where you can apply a standard supervised learning. Okay, maybe a neural network, maybe something else.


[User] Please transcribe this text

[Assistant] In order to take as input an image like that and classify, you know, which alphabet or which of 26 characters A to Z or maybe a wish of 36 characters if you have the numerical digits as well. But it'd be a multi-class classification problem where you take as input an image containing a character and decide what is the character that appears in that image.


[User] Please transcribe this text

[Assistant] And eating it is just really delicious. I love the fact that you brought us something from your experience in China. But you combined it with two ingredients that are really quintessentially Australian. The Murray cod and the saltbush. And that fish...


[User] Please transcribe this text

[Assistant] For centuries it's inspired poets and painters, writers and dreamers.


[User] Please transcribe this text

[Assistant] Sarah, you've given us some of the best food in the competition, but not today. Those yabbies were undercooked. I'm sorry.


[User] Please transcribe this text

[Assistant] Joining Serenity's elimination is another surprise.


[User] Please transcribe this text

[Assistant] So it's shabu shabu, but I've got the broth on the side, so you'll pour that into the bowl.


[User] Please transcribe this text

[Assistant] It always says to put on a tablespoon and a half, but time's running out. I just grab a spoon and put on a spoon and a half. I know my dressing's not gonna be accurate, but I've just gotta hope for the best.


[User] Please transcribe this text

[Assistant] We want you to think of fire in all its shapes and guises. The smell of autumn bonfires. The colour of the embers. The rising of the smoke.


[User] Please transcribe this text

[Assistant] We want fire to spark your imagination.


[User] Please transcribe this text

[Assistant] But this is the sort of food you find in really good restaurants you travel to the other side of the world for. It's not the sort of stuff you expect.


[User] Please transcribe this text

[Assistant] And only one of you will be safe from this weeks elimination. Are you ready?


[User] Please transcribe this text

[Assistant] I think often the danger in this kitchen is to do too many elements because you're worried that what you've got is not enough.


[User] Please transcribe this text

[Assistant] And really this feels like lots of really great ideas, but it's a jumble.


[User] Please transcribe this text

[Assistant] Here we go again. What's in there? What's in there?


[User] Please transcribe this text

[Assistant] You absolutely understand now how to create a dry eye spectacular moment. And I think we all picked up that fantastic smell of peach. Smart stuff. So what's the dish?


[User] Please transcribe this text

[Assistant] We've had some really good desserts, but that's a level way up there. Nice work, Bakey. Quite liked it.


[User] Please transcribe this text

[Assistant] And you get really good light here. You might not think it, but it's excellent. Very, very good light.


[User] Please transcribe this text

[Assistant] My nanny, I think Mr. Lawton, who took the photograph, and was just POSED. As the Nassals do, we pose.


[User] Please transcribe this text

[Assistant] Now then, I don't think I'd have picked me much at the moment. I love the colours, the clashing colours, the amazing orange and the pink.


[User] Please transcribe this text

[Assistant] I was given some chocolate ice cream for being so good and putting this off and being photographed. So then I had the chocolate ice cream and spread it all over the front. There. All the way down. That was chocolate ice cream.


[User] Please transcribe this text

[Assistant] And today we have an elementary lesson for you and we are at the supermarket.


[User] Please transcribe this text

[Assistant] So this lesson was requested by one of our users that wanted vocabulary and different phrases that are used in the supermarket when the person is about to pay for all the things they need.


[User] Please transcribe this text

[Assistant] Alright, so let's listen to our dialogue for the first time and see what happens.


[User] Please transcribe this text

[Assistant] That's right, and so why don't we look at this language now in Language Takeaway.


[User] Please transcribe this text

[Assistant] So the checkout lane is the place where you get in line to pay for all the goods you bought.


[User] Please transcribe this text

[Assistant] So in, in grocery stores or in supermarkets, sometimes you have a specific checkout lane that's faster.


[User] Please transcribe this text

[Assistant] Now we know belt as the thing you put around your waist.


[User] Please transcribe this text

[Assistant] And then the guy said that he had a couple of coupons. Coupons. Coupons. A coupon. Okay, so what is a coupon?


[User] Please transcribe this text

[Assistant] Now he presented these coupons and she said they were expired. The coupons expired yesterday. Expired. To expire. Alright, so to expire that means


[User] Please transcribe this text

[Assistant] Right, so why don't we listen to some other examples of how we can use expired so we can understand a little bit better.


[User] Please transcribe this text

[Assistant] And now finally she asked him if he wants to pay with his club card or cash. So club card. Club card. What's a club card? So in some supermarkets you can receive a special type of credit card that you can only use for grocery shopping.


[User] Please transcribe this text

[Assistant] Well, what happens is, sometimes, suppose your groceries cost $20.


[User] Please transcribe this text

[Assistant] So instead of charging $20 to your credit card or your club card, you say, okay, put $70. So then the cashier can give you $50 back so you can have cash in your pocket.


[User] Please transcribe this text

[Assistant] Alright, so now that we've listened to the dialogue for the second time, it's time for us to take a look at some phrases in Fluency Builder.


[User] Please transcribe this text

[Assistant] Alright, now this is an interesting and very informal phrase, so before we explain it, why don't we listen to a couple of other examples.


[User] Please transcribe this text

[Assistant] Now this is the common cliche phrase that any grocery store cashier will use, right?


[User] Please transcribe this text

[Assistant] Right, so you can choose plastic bags or paper bags.


[User] Please transcribe this text

[Assistant] Very good. And our last phrase, since he wasn't really having a good day, he said, it's just not my day.


[User] Please transcribe this text

[Assistant] Alright, so let's listen to the dialogue for the last time, and then we'll come back and talk a little bit about grocery stores in America.


[User] Please transcribe this text

[Assistant] Right, it's a very popular summer job or part-time job of like college students.


[User] Please transcribe this text

[Assistant] And so the high school boys would be working in the back, uh, maybe in the warehouse carrying boxes or stocking the shelves.


[User] Please transcribe this text

[Assistant] Exactly. It's a very popular part-time job for students in the United States, but also coupons are very popular in America.


[User] Please transcribe this text

[Assistant] Well, usually, for example, in the Sunday newspaper you will receive a lot of coupons.


[User] Please transcribe this text

[Assistant] Uh, you go to the grocery store and you have all these coupons for like, cookies or a promotion on uhm, on some type of soda or drink. So, it's very popular. People go grocery shopping and then present all these coupons. And actually, you can end up saving a good amount of money.


[User] Please transcribe this text

[Assistant] It's interesting because people actually will buy that product just because they have a coupon for it.


[User] Please transcribe this text

[Assistant] Right, leave all your questions and comments there and also if you have any other suggestions or any doubts, please let us know and well, we'll see you guys there.


[User] Please transcribe this text

[Assistant] Do you think that technology can actually do things better than humans?


[User] Please transcribe this text

[Assistant] Good point, Rob. And that actually ties in very closely with today's topic, which is technochauvinism. What's that? We'll find out shortly, Rob. But before we do,


[User] Please transcribe this text

[Assistant] Good luck with that Rob and we'll give you the answer later in the programme.


[User] Please transcribe this text

[Assistant] Now, let's get back to our topic of techno-chauvinism.


[User] Please transcribe this text

[Assistant] We're about to find out. Meredith Broussard is Professor of Journalism at New York University and she's written a book called Artificial Unintelligence. She appeared on the BBC Radio 4 program more or less to talk about it. Listen carefully and find out her definition of technoshovenism.


[User] Please transcribe this text

[Assistant] What is Meredith Broussard's definition of techno chauvinism?


[User] Please transcribe this text

[Assistant] She says that we have this idea that a computer is objective. Something that's objective is neutral. It doesn't have an opinion. It's fair and it's unbiased. So it's the opposite of being a chauvinist. But Meredith Broussard says this is not true.


[User] Please transcribe this text

[Assistant] But a proxy is also a person or a thing that carries out your wishes and your instructions for you. So computers are only as smart or as objective as the people that program them.


[User] Please transcribe this text

[Assistant] Computers are proxies for their programmers. Broussard says that believing too much in artificial intelligence can make the world worse. Let's hear a bit more. This time find out what serious problems in society does she think may be reflected in AI.


[User] Please transcribe this text

[Assistant] And she says it's a nuanced problem. A nuanced problem is not simple but it does have small and important areas which may be hard to spot but they need to be considered.


[User] Please transcribe this text

[Assistant] Next time you're using a piece of software or your favorite app, you might find yourself wondering if it's a useful tool or does it contain these little nuances that reflect the views of the developer.


[User] Please transcribe this text

[Assistant] I asked in which decade was the term artificial intelligence coined? Was it the forties, the fifties or the sixties?


[User] Please transcribe this text

[Assistant] It was actually the 1950s. Nevermind, Rob. Let's review today's vocabulary.


[User] Please transcribe this text

[Assistant] And this gives us technoshovenism, the belief that a technological solution is always a better solution to a problem.


[User] Please transcribe this text

[Assistant] A proxy is a piece of software, but also someone who does something for you on your behalf. A nuanced problem is a subtle one. It's not a simple case of right or wrong. In a nuanced problem, there are small but important things that you need to consider.


[User] Please transcribe this text

[Assistant] Well, that's all we have time for today. Goodbye for now.


[User] Please transcribe this text

[Assistant] And it currently only has one API, which was slash API slash test, and we want to build more APIs that will be useful to Catbook.


[User] Please transcribe this text

[Assistant] Here we have an example server.js.


[User] Please transcribe this text

[Assistant] We have our slash dog slash test, slash dog slash breed, slash dogs or slash cat slash test and slash cat slash breed API endpoints.


[User] Please transcribe this text

[Assistant] Now imagine our server had many, many more endpoints below.


[User] Please transcribe this text

[Assistant] You can imagine that our server.js file grows so large and be very cluttered and unorganized.


[User] Please transcribe this text

[Assistant] And for this example, we can see that we can organize by slash dog and by slash cat.


[User] Please transcribe this text

[Assistant] So currently we have, uhm, all of our endpoints in our app, in our server.js.


[User] Please transcribe this text

[Assistant] File and basically what an app is, it just represents our overall server and is our main application. But having all of our endpoints in our server can be cluttered.


[User] Please transcribe this text

[Assistant] So this is where the concept of a router comes in. The router is basically an isolated group of API endpoints and it's basically a mini application. So instead of having all of our endpoints here in the app, we can then instead have our app


[User] Please transcribe this text

[Assistant] Just use middleware to route any slash dog paths, uhm, to our dog.js file. And in dog.js we'll have a router and we'll have our slash dog endpoints.


[User] Please transcribe this text

[Assistant] And then the same thing for cat, we'll have all of our slash cat endpoints in cat.js.


[User] Please transcribe this text

[Assistant] And so basically we have too many applications.


[User] Please transcribe this text

[Assistant] Uhm, so we have our router for our dog and then our router for cat. And this makes sure that the code in router and the code in routers, they don't


[User] Please transcribe this text

[Assistant] Depend on each other and they are modular and they're independent of code in the server as well.


[User] Please transcribe this text

[Assistant] So now we have a much more organized, uhm, backend and it's much more, uhm, easy to navigate and


[User] Please transcribe this text

[Assistant] Delve into why we're using routers. Like we said before, for simplicity, so we can declutter our server and organize our endpoints together.


[User] Please transcribe this text

[Assistant] And as well as modularity, so we can structure our endpoints in isolation without having to care about logic of server or other routers or other endpoints.


[User] Please transcribe this text

[Assistant] So some more additional definitions. So API endpoint is just anything that has a request and response, and it can perform a specific function. So for example, we have our stories endpoint, and then we have our API route, which is the name we can use to access that endpoint.


[User] Please transcribe this text

[Assistant] And for our purposes, we're just going to use them interchangeably.


[User] Please transcribe this text

[Assistant] So, so far we only have made a single API endpoint, which is slash API slash test. And all this returns is a very simple string.


[User] Please transcribe this text

[Assistant] Uhm, while I made my first API, but this doesn't have any dynamic data that we want to have, so maybe we want to display our stories or our comments, or post our stories and post our comments. So, uh, we must now make those endpoints.


[User] Please transcribe this text

[Assistant] Okay, so now you can pause to, uhm, and put these commands into your terminal, but I'm gonna go ahead in our catbook folder, uhm, get reset, hash, hash hard, get fetched, and get checkout. That'd be five, hash started.


[User] Please transcribe this text

[Assistant] Now, our first step is to move our endpoints from our server to our router. So if you recall, uhm, what we start with in this


[User] Please transcribe this text

[Assistant] Start a code or like what we ended with uhm, from lecture is having our.


[User] Please transcribe this text

[Assistant] Server.js have our get slash API slash test endpoint.


[User] Please transcribe this text

[Assistant] What we want to end up with is actually having our app


[User] Please transcribe this text

[Assistant] Be able to route any slash API paths to our router from API.js.


[User] Please transcribe this text

[Assistant] And have our get slash API slash test endpoint here. So this is the goal of our, um, first step. So to make this happen, what we have to first do is create a separate file and we have already done that and it's called API.js. So if you go ahead.


[User] Please transcribe this text

[Assistant] And look in your server directory, you should see your api.js file and you can go ahead and open that.


[User] Please transcribe this text

[Assistant] So here, server api.js. And you should come to this screen. Our next step is to define a router for slash API in api.js. So in api.js, we now want, uhm, a router. So how can we do that? If we open api.js, we see that there are two to-dos.


[User] Please transcribe this text

[Assistant] First to do is to add a router, and how can we do this?


[User] Please transcribe this text

[Assistant] So we can add a router by const router equals and use just express.router and this will create a router object provided by express.


[User] Please transcribe this text

[Assistant] And then our second to do is to export our router.


[User] Please transcribe this text

[Assistant] So we can just use our module.exports, equal router, and


[User] Please transcribe this text

[Assistant] What this does is it allows other files in our backend to access our router by importing it.


[User] Please transcribe this text

[Assistant] Nice, so now our api.js folder has a router and also more


[User] Please transcribe this text

[Assistant] We can allow server.js to access it.


[User] Please transcribe this text

[Assistant] And if you're ever confused about, uhm, how you knew to use Express.router or how to use module.exports, you can always look up the documentation on Express or documentation on Node, uhm, and you can also, of course, ask staff or come to office hours.


[User] Please transcribe this text

[Assistant] So our next third step is to define middleware to route any API paths prefixed with slash API to API.js. So what this means is we want to have


[User] Please transcribe this text

[Assistant] Currently we have our server and we have our router, but what we want is to be able to connect these two files and


[User] Please transcribe this text

[Assistant] Have any paths that are slash API.


[User] Please transcribe this text

[Assistant] Uhm, have slash api pre-appended to it, uhm, to be able to, uhm, be routed to our router in api.js.


[User] Please transcribe this text

[Assistant] So we can do that by first going in server.js. To do tree.


[User] Please transcribe this text

[Assistant] We can import the router from our API file by using our require keyword to import. So we can set const API equals require and then give it our file name.


[User] Please transcribe this text

[Assistant] And what essentially it does is it imports the router that we exported in this file. And then the next step is then to use our middleware and define and tell it any path that has slash API. We're going to be using this API router that we got from our API.js file. So now I'm going to go ahead and


[User] Please transcribe this text

[Assistant] And then here in 2.2.4, we're going to use our middleware, let that use, and then any path that has slash apk.


[User] Please transcribe this text

[Assistant] We are going to use our, uh, we're going to call our API router.


[User] Please transcribe this text

[Assistant] Our routing middleware is actually after another middleware.


[User] Please transcribe this text

[Assistant] So what this middleware does is basically it parses any JSONs.


[User] Please transcribe this text

[Assistant] Uhm, that come to the back end into things that we can understand.


[User] Please transcribe this text

[Assistant] And the reason this is important is because when data comes from our requests, sometimes it's in the form of JSON, but we want to access that data.


[User] Please transcribe this text

[Assistant] So we must have this before our rounding because order matters in the


[User] Please transcribe this text

[Assistant] In the order we define our middleware matters, and so if it's below, then we might not be able to have our JSONs parsed before we go into our API.js folder file.


[User] Please transcribe this text

[Assistant] So now we have connected our routes.


[User] Please transcribe this text

[Assistant] Our next step is to move our current


[User] Please transcribe this text

[Assistant] So how can we do that? So here we see that in server.js, we currently have this to do five and we have our endpoint here. We want to get rid of it there.


[User] Please transcribe this text

[Assistant] And you can see that there are two main changes we want to make when we move it in. First, instead of using App, we're going to be using Router.


[User] Please transcribe this text

[Assistant] And instead of using slash API slash test, we're going to just use slash test as the address here. And the reason is, is if you recall, we used app.use slash API comma API and


[User] Please transcribe this text

[Assistant] What this does is because we know that it will be prefixed with a slash API, when we refer to it here, we no longer should refer, include that slash API anymore.


[User] Please transcribe this text

[Assistant] So now, we're gonna go ahead and do 2 do 5.


[User] Please transcribe this text

[Assistant] Our endpoint and paste it right here. And then make those two changes, router and slash test. And feel free to pause anytime in the video. Uhm, but now we have moved our endpoints from our app, but now it's all in our router.


[User] Please transcribe this text

[Assistant] And we used our middleware to route our paths from the server to our router in API.js. So, just going to add another line.


[User] Please transcribe this text

[Assistant] So when we run it, we can tell that it has been run in our API.js file. So to run it, you can use npm start and then go to localhost 3000 slash API slash test. So npm start.


[User] Please transcribe this text

[Assistant] And then now we can go to, uh,


[User] Please transcribe this text

[Assistant] And look, we can see our message that has now been made from a separate file.


[User] Please transcribe this text

[Assistant] So our next step is to define get routes so that our front end can now, um, fetch our data and display our stories and comments. So first of all, how are we going to store our data? So currently we haven't learned about databases yet.


[User] Please transcribe this text

[Assistant] So we have just, for now, hardcoded just a data object in API.js and it will contain our stories in data.stories.


[User] Please transcribe this text

[Assistant] And for each story object, we can see there's a unique identifying ID, which is a number, creator name, and content. And then we also have an array of comments, theta.comments, and we can see we have a unique identifying number, creator name,


[User] Please transcribe this text

[Assistant] And then we see content, but also we see this extra field called parent. And this parent is also just a number. So what this parent basically is, is just the parent ID. So it is the ID of the story.


[User] Please transcribe this text

[Assistant] So, the story that this is a comment under is this story with this ID of zero. So, Tony says send it or blend it, and Stanley basically replied both.


[User] Please transcribe this text

[Assistant] So our first to do is to add a story to dada.stories. So here you can see


[User] Please transcribe this text

[Assistant] Right here we can add a to do. So feel free to pause and add your own story. Uhm, but I'm gonna go ahead and give our data.stories a new story object.


[User] Please transcribe this text

[Assistant] So our next to do is to, uhm, make our API endpoint for getting stories. So if you recall, uhm, a get root has a


[User] Please transcribe this text

[Assistant] We give it the HTTP function, so whether it be get or post, and then it has the path, so uhm, the endpoint path, and then it has our callback function, so.


[User] Please transcribe this text

[Assistant] The callback function has a parameter of request and response, and so request is how we get


[User] Please transcribe this text

[Assistant] Access incoming data from our client and our response is how we send, uhm, data from our backend to our client.


[User] Please transcribe this text

[Assistant] And then we can send it using res.send() as a function. So.


[User] Please transcribe this text

[Assistant] Once again, request is the incoming request from client and we can access the data using these different keywords. And then response is our server response and we can set the status with HTTP code.


[User] Please transcribe this text

[Assistant] So our first to do is uhm, to make our get endpoint for slash API slash stories.


[User] Please transcribe this text

[Assistant] And so, we can ask ourselves two main questions. The first question being, what does the root need to do? And our root needs to send back all the stories to the front end.


[User] Please transcribe this text

[Assistant] And then our second question is how can we access all the stories? And we can use that as our stories.


[User] Please transcribe this text

[Assistant] Again, using router.get and then give it our path, which is slash stories. And remember, we don't need to include API slash stories because uhm, our


[User] Please transcribe this text

[Assistant] Middleware already handles that matching of slash API.


[User] Please transcribe this text

[Assistant] And then in our color function, all we need to do is send all the stories back so we can access it using that or that stories.


[User] Please transcribe this text

[Assistant] So now we can test it out. So in one terminal, we can run our backend server by running npm start. And in another terminal, we can run our frontend server by running npm run hotloader.


[User] Please transcribe this text

[Assistant] Remember this is our backend server on port 3000. We can see our stories array.


[User] Please transcribe this text

[Assistant] And then if we go to localhost 5050, which is our frontend server.


[User] Please transcribe this text

[Assistant] We can see there are errors because our frontend is trying to make get requests to endpoints that don't exist yet. We haven't made our API slash comment, uhm, endpoint yet, but we can just ignore that and we can see so far that our frontend can now, uhm, display our stories. For now, it doesn't have the comment.


[User] Please transcribe this text

[Assistant] Cause we would expect Stanley's comment under here.


[User] Please transcribe this text

[Assistant] Uhm, so, we can go ahead and do that.


[User] Please transcribe this text

[Assistant] Now, by making our get comments endpoint. So, if you recall,


[User] Please transcribe this text

[Assistant] Our HTTP request is made up of many parts.


[User] Please transcribe this text

[Assistant] And one such part is the URL that includes the root and query. So the URL


[User] Please transcribe this text

[Assistant] Uhm, the query actually includes the data that is sent from our frontend to our backend for GET requests. And this is just by convention.


[User] Please transcribe this text

[Assistant] So you can use rec.query to access information being sent from the front end to our back end and


[User] Please transcribe this text

[Assistant] Uhm, forget requests. And an example of how this can be done.


[User] Please transcribe this text

[Assistant] Here's, for example, this is a get request in the frontend.


[User] Please transcribe this text

[Assistant] Uhm, so the frontend will say, get me whatever is slash at, whatever is at slash api slash weblab. And here is a query.


[User] Please transcribe this text

[Assistant] And then in the query, we see this content called web development class and competition. And then in the backend, we can see at the slash end point, we can access the.


[User] Please transcribe this text

[Assistant] Content that was passed in the get request by using rec.query.content and it will give us web development class and competition. Another way we can, uhm, have the rec.query data be passed in is by, uhm, if you go to the URL and then at the path defined of api slash weblab with the


[User] Please transcribe this text

[Assistant] Question mark, which is the query operator, we can define content and set it equal to web development class and competition.


[User] Please transcribe this text

[Assistant] And again, in the back end, we can just access it using ReckonautQuery.content.


[User] Please transcribe this text

[Assistant] So using this information on rec.query, uhm,


[User] Please transcribe this text

[Assistant] We can now go and look into how our get request is made in the frontend for when they request comments. So if you go to car.js,


[User] Please transcribe this text

[Assistant] Modules, card.js. We can see right here in our use effect, we have our get function. And our get function, it says at this endpoint slash api slash comment, uhm, get me.


[User] Please transcribe this text

[Assistant] The comments for this parent. And remember, parent is just the ID number of a story?


[User] Please transcribe this text

[Assistant] Uhm, get me all the comments that are under this story ID. And then they have a then function, so whatever you return, I am going to set comments. So this tells us that it expects at this endpoint, uhm, they want the comments under this story,


[User] Please transcribe this text

[Assistant] And then they want us to return those comments so that they can send it.


[User] Please transcribe this text

[Assistant] How can we access whatever is passed in, in their query from the backend? We can use rec.query.parent.


[User] Please transcribe this text

[Assistant] So now we're going to make our, or now it's your turn to define get slash api slash comment.


[User] Please transcribe this text

[Assistant] And you can first have to figure out what story you need the comments from. And remember, we just learned rec.query.parent.


[User] Please transcribe this text

[Assistant] And then we can filter out the comments that are the children of that story and then send those comments back to a friend.


[User] Please transcribe this text

[Assistant] So, here are some hints. First, it's just like, api.stories, but with some more logic. Second hint is that you can use the array.filter function from JavaScript.


[User] Please transcribe this text

[Assistant] And then the last hint is that rec.query returns a string.


[User] Please transcribe this text

[Assistant] So feel free to pause the video here, but I'm gonna go ahead and continue the solution. So first, what does this route need to do? We need to figure out what story we need.


[User] Please transcribe this text

[Assistant] The comments from, and we got it from ref.query.parent. And then we can filter our data comments object to find the matches.


[User] Please transcribe this text

[Assistant] Uhm, we can use data.comments and then apply the filter function.


[User] Please transcribe this text

[Assistant] And for every comment in that of the comments, we're going to check if its parent matches, uhm, the rec.query parent.


[User] Please transcribe this text

[Assistant] And now we use double equals instead of triple equals because rec.query returns the type string and then comment.parent is an int. And so to compare these two, we need to use double equals.


[User] Please transcribe this text

[Assistant] And so here is the final solution. So we define our get method and we give it the path and then we filter our comments and then we send it back.


[User] Please transcribe this text

[Assistant] So feel free to pause here to copy, but I'm gonna go ahead and implement this right here in R2-3. So instead of copying


[User] Please transcribe this text

[Assistant] Uh, previous code we recommend typing out yourself just to practice making an endpoint.


[User] Please transcribe this text

[Assistant] Each item has an object called parent, which identifies the story and is typed in. Uhm, so we're just getting that exactly this value in data.comments. And then we're going to set it and check it if it's equal to rec.query.parent.


[User] Please transcribe this text

[Assistant] Okay, so now we have all our comments that are filtered, we can just send it back.


[User] Please transcribe this text

[Assistant] Once again, we can go to our...


[User] Please transcribe this text

[Assistant] Localhost 3000, and now we can go to API slash comment. And uhm.


[User] Please transcribe this text

[Assistant] And try to pause here and predict what you expect to see. If you recall, we have comments here and one comment here and it's apparent as zero. So...


[User] Please transcribe this text

[Assistant] Now I'm just gonna go ahead and we're gonna see exactly the comment that has a parent of zero.


[User] Please transcribe this text

[Assistant] So now, what if we went and gave it a pair of 1? What do we expect?


[User] Please transcribe this text

[Assistant] We expect nothing because there is no comments with a parent of one.


[User] Please transcribe this text

[Assistant] Currently. So now again, if we go to our front end.


[User] Please transcribe this text

[Assistant] When we refresh, we expect to see our comments displayed, and we do. Nice.


[User] Please transcribe this text

[Assistant] Our get requests for stories and we're getting our comments. So, it's pretty cool. Now, we can reset and then check out step two.


[User] Please transcribe this text

[Assistant] So go ahead and pause and do these commands. I'm gonna go ahead and


[User] Please transcribe this text

[Assistant] Okay, so now we're gonna go back and try to make a new story.


[User] Please transcribe this text

[Assistant] There's an error where 404 not found and that's because we haven't defined our slash API slash story endpoint yet. But maybe we want some more useful.


[User] Please transcribe this text

[Assistant] For example, to like, log every time that there is a 404 not found, or any time there's an error. So, what we can do?


[User] Please transcribe this text

[Assistant] And we can make console log statements, or we can do different things, uhm, with this information. So, basically, uhm, yes.


[User] Please transcribe this text

[Assistant] ExpressRD has existing air handling code that displays if we're not found.


[User] Please transcribe this text

[Assistant] But if we wanted to have our own, we can write our extra endpoint to handle.


[User] Please transcribe this text

[Assistant] And give us additional information or additional print or log statements. So we're gonna go ahead and do this for 2 to 1 and we're gonna remember that we should put it


[User] Please transcribe this text

[Assistant] That's why we have our, uhm, endpoint to handle missing roots right here at the bottom.


[User] Please transcribe this text

[Assistant] And so we can define it as router.all, and so what all does is includes all requests, HTTP requests types, so like both get and post, and points will go here.


[User] Please transcribe this text

[Assistant] And then we give it a star, which means it'll match any number of any character.


[User] Please transcribe this text

[Assistant] And then we can go ahead and give it our quest, response.


[User] Please transcribe this text

[Assistant] Before we had console log statements in the frontend, but now we can have console logs.


[User] Please transcribe this text

[Assistant] Uhm, now we're writing our console log statement in our backend.


[User] Please transcribe this text

[Assistant] So what this means is we can expect our print statement or console log statement to be displayed here in our server. Uhm, there seems to be an error, so... Oh, this should be a comma? Okay.


[User] Please transcribe this text

[Assistant] And when we try to post while it's not defined, uhm, yes we still have our, or if we're not found, but


[User] Please transcribe this text

[Assistant] Here we also now see that our server is logging as well, that we have an error. So now our, uhm, backend server can also be aware of any


[User] Please transcribe this text

[Assistant] It can be useful, for example, if you want to know if someone is trying to access a route not found many times or maybe some malicious activity might be happening. Having these log statements could potentially be useful.


[User] Please transcribe this text

[Assistant] So that is one use of having a endpoint here to catch anything that is missing.


[User] Please transcribe this text

[Assistant] So now that we have our endpoint defined, we can now make our post roots.


[User] Please transcribe this text

[Assistant] So now we want our frontend to be able to, uhm, send data to our backend and our backend to be able to update our data object to store whatever information they gave us.


[User] Please transcribe this text

[Assistant] So, if you recall, HTTP requests have many different parts, and the part that we can get the information sent from our frontend to our backend, uhm, for POST requests is actually different from GET requests, and it's, we use rec.body, and this is mainly by convention. So for rec.body, uhm, we can see again, they can pass it through, uhm, on the frontend, they can pass it through their POST request,


[User] Please transcribe this text

[Assistant] In the backend, we can just use it using rec.body.whatever values defined here. So.


[User] Please transcribe this text

[Assistant] Now our second to do is to post stories. So again, we need to figure out what needs to be saved and


[User] Please transcribe this text

[Assistant] Then we have to put it into a story structure, and then we need to add it to our data object.


[User] Please transcribe this text

[Assistant] And to know what we need to put into our story structure, we can see what a new story needs in terms of its fields from data.stories. You can see it needs id, creator name, and content. And then, another hint is to remember what is sent from the front end. So in the front end, if you go to newpostinput.js, you can see this code where they call their post function,


[User] Please transcribe this text

[Assistant] They pass in this body and this body has this value called content and essentially this content


[User] Please transcribe this text

[Assistant] Is the same as the content that would be displayed in a story. So hopefully that gives a hint on how uhm,


[User] Please transcribe this text

[Assistant] On the value or where you can get the content being posted from the front end to the back end.


[User] Please transcribe this text

[Assistant] Another hint is that here in the front end, you can see that they expect to get a store object so that they can add it to display.


[User] Please transcribe this text

[Assistant] So hopefully this gives you a hint on what you should be sending back from the back end to the front end. So go ahead and pause here and attempt. Now I'm gonna go ahead and uhm, so I'm gonna go over first the story object that we make.


[User] Please transcribe this text

[Assistant] We can use that a lot of stories at life as a unique ID because we're not deleting anything, so since we're only adding, we can expect that it will be a unique number.


[User] Please transcribe this text

[Assistant] And then for creator name, you can give any string you want to have it displayed. We have a variable actually right above data.


[User] Please transcribe this text

[Assistant] That you can also change, it's currently set to anonymous, but you can give your own creator name, uhm, and then you can also


[User] Please transcribe this text

[Assistant] Give the content that is being passed from the front end by using rec.body.content. And again, we use rec.body for post requests to get the data from post requests. And then here's the full solution. So we have our post and then we give the path.


[User] Please transcribe this text

[Assistant] Which is the slash story, and then we, in our callback function, we define our new story.


[User] Please transcribe this text

[Assistant] We push it to our data.stories and then we can send it to our friend. So you can feel free to.


[User] Please transcribe this text

[Assistant] Pause right here. I'm gonna go ahead and code. So router.post. And then slash story.


[User] Please transcribe this text

[Assistant] The post requests, they expect that we send back


[User] Please transcribe this text

[Assistant] Okay, so I'm gonna go ahead and change my name.


[User] Please transcribe this text

[Assistant] And then I'm gonna go ahead, I'm gonna go ahead and test adding a new story so we can go ahead and go to the front end once again and now


[User] Please transcribe this text

[Assistant] And voila, we see. Exactly.


[User] Please transcribe this text

[Assistant] Uhm, create a name that we gave and then we see that we can give our own content and have it be displayed.


[User] Please transcribe this text

[Assistant] Uhm, next to do is to write post comments and so you can


[User] Please transcribe this text

[Assistant] Now I'll go ahead and attempt, but before so we can give some hints. So...


[User] Please transcribe this text

[Assistant] We want to add an API root that handles post requests to slash API slash comment.


[User] Please transcribe this text

[Assistant] Uhm, firsthand, it's a lot like posts slash api slash story.


[User] Please transcribe this text

[Assistant] Second hint is you can know what a new comment needs from data.comments.


[User] Please transcribe this text

[Assistant] And dada.comments needs an ID, creator name, and it requires a parent ID of the story it's a comment under, and then the content.


[User] Please transcribe this text

[Assistant] And then you can see what is being said from the front end here. We can see that there is a parent.


[User] Please transcribe this text

[Assistant] Feel in a content field being passed in to our post request to slash API slash comment.


[User] Please transcribe this text

[Assistant] And that it expects to receive the new comment object so that it can display the comment on the screen.


[User] Please transcribe this text

[Assistant] Go ahead and pause here, but I'm gonna continue on to the solution.


[User] Please transcribe this text

[Assistant] Now we can go here and we can add our post comment endpoint.


[User] Please transcribe this text

[Assistant] So, yeaah, we can do router.post slash comment.


[User] Please transcribe this text

[Assistant] And then we can give e the comments.length.


[User] Please transcribe this text

[Assistant] Uh, we can see the description here, and feel free to pause here and copy them. But now we're gonna do one last test, and if we go again to the front end, we should be able to see our comments.


[User] Please transcribe this text

[Assistant] And then also we can make new stories. Hello, hello.


[User] Please transcribe this text

[Assistant] So now our frontend is fully connected to our backend and being able to get and also send data.


[User] Please transcribe this text

[Assistant] So, that's pretty awesome. So.


[User] Please transcribe this text

[Assistant] So we can successfully comment and also see.


[User] Please transcribe this text

[Assistant] So one thing you may have noticed is that when we changed our server.js file, so after we made our post endpoint, we made a story.


[User] Please transcribe this text

[Assistant] And then when we refreshed it after we changed the comments, our stories disappeared.


[User] Please transcribe this text

[Assistant] So what this means is that our data object is just defined in our file, so it lasts only as long as the server stays running, so the server reloads, or the server is, uhm, crashes, that has to be remade, restarted, then this means all of our objects


[User] Please transcribe this text

[Assistant] So be sure to set up your MongoDB Atlas before tomorrow's workshop. And here are the announcements for Thursday. And remember milestone one pitch, project pitch signed ups are due Friday and Monday. And please give us feedback.


[User] Please transcribe this text

[Assistant] Because we are trying to incorporate it, and we know that it's quite hard.


[User] Please transcribe this text

[Assistant] Uhm, but we're looking for ways to improve it and uhm, please let us know.


[User] Please transcribe this text

[Assistant] And then if you have other thoughts, feel free to fill it out at RokingCookies. And that's it for today.


[User] Please transcribe this text

[Assistant] But, if you wait, you will get to use both crates of ingredients, but you'll have 15 minutes less time to cook with. Now, think on this. Those crates get tastier and tastier and tastier as the time gets shorter and shorter and shorter.


[User] Please transcribe this text

[Assistant] You know, you're gonna make missteps. You're gonna step outside the envelope of what we would regard as good taste. Sadly, the ingredients don't go together.


[User] Please transcribe this text

[Assistant] That's right. So we're gonna be learning, uh, language that you can use if you're talking about boxing, but not only boxing, right?


[User] Please transcribe this text

[Assistant] Okay, so not that we're asking our listeners to get into fights, but if ever you see a fight, at least now you'll have the language to talk about it.


[User] Please transcribe this text

[Assistant] Well, Rick Field said that we have a very gruesome match tonight.


[User] Please transcribe this text

[Assistant] It's really, it's bad, it's terrible, it's bloody.


[User] Please transcribe this text

[Assistant] Okay, so this is a technical boxing word, uhm, it's the action of falling to the ground and not getting up.


[User] Please transcribe this text

[Assistant] Right, so when you dodge a bullet, you avoid some, some bad situation or some bad event.


[User] Please transcribe this text

[Assistant] Yeah, but that's an entirely different lesson. Uhm, I think we need to focus here on the boxing vocabulary. So, so the announcers said that Apollo is getting pounded.


[User] Please transcribe this text

[Assistant] Now this word is actually new to me, so Marco, what does it mean?


[User] Please transcribe this text

[Assistant] Okay, so you don't have really good form, your body is kind of moving all over the place.


[User] Please transcribe this text

[Assistant] Alright, a technical boxing word here for you guys, but now we've got some interesting phrases for you on Fluency Builder.


[User] Please transcribe this text

[Assistant] Well the announcers said that the boxing match was about to get underway.


[User] Please transcribe this text

[Assistant] So we're going to look at this phrase to square off against someone.


[User] Please transcribe this text

[Assistant] So this is like a sports word, but it's also really commonly used in a lot of different contexts. So why don't we hear a few more examples of how we can use this phrase to square off.


[User] Please transcribe this text

[Assistant] Now Bob said that, uh, Rocky landed a strong blow.


[User] Please transcribe this text

[Assistant] Alright, so land a strong blow. Now, let's break this down. So, a blow.


[User] Please transcribe this text

[Assistant] Okay, and when you land a strong blow, what happens?


[User] Please transcribe this text

[Assistant] So I could also change this a little bit. I could say, I landed a punch.


[User] Please transcribe this text

[Assistant] But the verb throw, you throw a left punch.


[User] Please transcribe this text

[Assistant] Alright, or look over there, that guy's throwing punches.


[User] Please transcribe this text

[Assistant] Now again, you can use this in a lot of different ways with a lot of different types of punches. So you could say to throw a jab.


[User] Please transcribe this text

[Assistant] So as I mentioned, Marco, I'm not really, um, that much of a fan or that knowledgeable about boxing. And actually this is becoming a theme in an esports lesson, isn't it?


[User] Please transcribe this text

[Assistant] Right, but you said it's, it's, uh, super popular and everyone wants to watch these, uh, these matches and obviously everyone can't go to Las Vegas. So what's the common way for most people to watch these boxing matches?


[User] Please transcribe this text

[Assistant] Oh no, this is a super sticky situation. Carmen, a voice, are you there? I need you!


[User] Please transcribe this text

[Assistant] Mother Earth, don't let me go Mother Earth, I need you so Mother Earth, please let me stay By your side each night and day


[User] Please transcribe this text

[Assistant] Oh. Oh right, yea I was. That was terrifying.


[User] Please transcribe this text

[Assistant] Four iconic English gardens. Each is the product of one moment in history.


[User] Please transcribe this text

[Assistant] And each gives us a fascinating window into the century in which they were made and the people who created them. Much more than just a history of gardening, these are extraordinary tales of escape, social ambition, heartbreak, downfall and disaster.


[User] Please transcribe this text

[Assistant] In unraveling these remarkable stories, we reach back over the centuries to see these four great gardens through fresh eyes.


[User] Please transcribe this text

[Assistant] And is probably the best surviving Victorian garden in the country.


[User] Please transcribe this text

[Assistant] This revolutionary and theatrical garden was conceived by James Bateman.


[User] Please transcribe this text

[Assistant] A deeply religious man who devoted much of his life to its creation.


[User] Please transcribe this text

[Assistant] Bidulf Grange is made up of several smaller individual gardens, stocked with exotic specimens collected by the Victorian plant hunters.


[User] Please transcribe this text

[Assistant] These wildly different gardens are linked by subterranean tunnels and passages.


[User] Please transcribe this text

[Assistant] Transporting the visitor around the globe in just a few steps.


[User] Please transcribe this text

[Assistant] The garden caused a sensation in the world of Victorian horticulture and allowed its creator, James Bateman, to rise from humble beginnings to the very top of society.


[User] Please transcribe this text

[Assistant] But this Victorian masterpiece was nearly wiped from history.


[User] Please transcribe this text

[Assistant] To find out more about the character who created Bit of Grange.


[User] Please transcribe this text

[Assistant] Historian Andrea Wolff has been delving into Bateman's past.


[User] Please transcribe this text

[Assistant] James Bate and descended from a long line of entrepreneurs with flair and determination, characteristics that would stand him in good stead.


[User] Please transcribe this text

[Assistant] His grandfather had invested very wisely in an emerging technology, steam engines, which made the family a fortune.


[User] Please transcribe this text

[Assistant] Initially, Biddulph Grange had been purchased so the family could extend their business interests and mine the huge reserves of coal around the house.


[User] Please transcribe this text

[Assistant] He had just turned 30 and wanted to use his vast inheritance to indulge his passions for horticulture and the new emerging sciences.


[User] Please transcribe this text

[Assistant] Great advances in horticulture also had a huge impact on Victorian gardens.


[User] Please transcribe this text

[Assistant] The Wardian case was a simple method to ship plants across the globe and into the hands of passionate horticulturalists like Bateman.


[User] Please transcribe this text

[Assistant] Garden designer Chris Beardshaw has been exploring how technological advances help to fuel a gardening revolution.


[User] Please transcribe this text

[Assistant] But new scientific discoveries didn't just affect horticulture. They were dramatically altering the Victorians' view of their world.


[User] Please transcribe this text

[Assistant] In particular geology, which threatened the religious convictions of devout Christians like Bateman.


[User] Please transcribe this text

[Assistant] Although Bateman presented the two conflicting worlds together, it would prove to be an uneasy compromise that unsettled him for years to come.


[User] Please transcribe this text

[Assistant] Bateman had to build his garden from scratch. Although he possessed a keen horticultural mind, it was still a huge challenge.


[User] Please transcribe this text

[Assistant] The site was rocky, steep, and far from ideal.


[User] Please transcribe this text

[Assistant] But he ventured forward in the true pioneering spirit of the Victorian age.


[User] Please transcribe this text

[Assistant] One area of the garden might well have been inspired by those early excavations.


[User] Please transcribe this text

[Assistant] The stumpery's display of upturned oak roots expressed Bateman's growing interest in botany.


[User] Please transcribe this text

[Assistant] Bateman's garden would be shaped by his love for horticultural showmanship, inspired in part by his wife's family, who lived at Arleigh Hall in Cheshire.


[User] Please transcribe this text

[Assistant] And Bateman's marriage to Maria Edgerton Warburton would prove to be both horticulturally and socially beneficial.


[User] Please transcribe this text

[Assistant] Arleigh Hall's crowning glory is the theatrical, herbaceous border, which was the first of its kind anywhere in the country.


[User] Please transcribe this text

[Assistant] Letters between Bateman and his brother-in-law, in which they exchanged horticultural ideas, suggest there was some friendly rivalry between the two.


[User] Please transcribe this text

[Assistant] He chose to build a showcase for just one plant, which at the time was the subject of a national craze.


[User] Please transcribe this text

[Assistant] He built this entire walkway packed with every variety available in a celebration of both botanic advancement and, as he believed, the wonders of God's creation.


[User] Please transcribe this text

[Assistant] The garden team's work to get it ready starts early in the year.


[User] Please transcribe this text

[Assistant] In the warmth of the greenhouse, 900 dalia cuttings are potted on. This job falls to one of the garden team, Bob.


[User] Please transcribe this text

[Assistant] Who started working at Biddlegrange when he left school 35 years ago.


[User] Please transcribe this text

[Assistant] Over 40 different varieties will be planted out in the Dahlia Walk.


[User] Please transcribe this text

[Assistant] But today it's just a team of five, including the garden manager, Paul Walton.


[User] Please transcribe this text

[Assistant] The Victorians exploited the dahlia's potential for cultivation, which was almost limitless due to the plant's structure.


[User] Please transcribe this text

[Assistant] Whilst Bateman embraced the cultivation of plants of a similar species, his strongly held religious beliefs meant he abhorred the cross-breeding of plants of differing species. Hybrids were the genetic engineering of their day and had no place in his garden.


[User] Please transcribe this text

[Assistant] Bateman envisaged his garden as a way to display the treasures of nature.


[User] Please transcribe this text

[Assistant] To create one of the most significant pineetums in the country.


[User] Please transcribe this text

[Assistant] Alan Power is head gardener at Stourhead. He has an unquenchable passion for trees, and he's come to Bidulf to find out just why Bateman's pineetum stood apart from others.


[User] Please transcribe this text

[Assistant] Is being shown around by one of the garden team, Leslie Hurst.


[User] Please transcribe this text

[Assistant] Bateman's pinetum was inspired by the wealth of new species being introduced from the Americas.


[User] Please transcribe this text

[Assistant] One star of the show he chose to give pride of place was the Chilean Pine, more commonly known as the Monkey Puzzle.


[User] Please transcribe this text

[Assistant] In the early 1840s, plant hunter William Lobb collected 3,000 monkey puzzle seeds on an expedition to the southern Andes in Chile.


[User] Please transcribe this text

[Assistant] Bateman was among the first to get hold of these new introductions.


[User] Please transcribe this text

[Assistant] This highly unusual tree was to be the star attraction in Bateman's collection.


[User] Please transcribe this text

[Assistant] Bateman exhibited his new specimens in a unique fashion.


[User] Please transcribe this text

[Assistant] Making his pineetum one of the most unusual and highly regarded in the country.


[User] Please transcribe this text

[Assistant] James Bateman's fascination with botany started at an early age.


[User] Please transcribe this text

[Assistant] When he was just eight he became fixated with a plant that would change his life. The orchid.


[User] Please transcribe this text

[Assistant] While he was studying at Oxford University, Bateman used his wealth to pay others to risk life and limb collecting orchids for him. Such was the strength of his love affair with orchids, that he wrote an entire book devoted to them.


[User] Please transcribe this text

[Assistant] It's the largest botanical book ever produced, and extremely rare. Only 125 copies were printed. And this one is held at the Lindley Library in London.


[User] Please transcribe this text

[Assistant] Its publication set the horticultural world alight, establishing Bateman as a leading botanist and bringing him international fame.


[User] Please transcribe this text

[Assistant] Someone who understands where a passion for orchids can lead is modern day plant hunter Tom Hart Dyke.


[User] Please transcribe this text

[Assistant] Tom Hart Dyke followed in the very footsteps of Bateman's plant hunters, traveling the globe to find new orchids.


[User] Please transcribe this text

[Assistant] But his obsession took Tom on one trip into a remote and dangerous part of the Colombian jungle, which nearly cost him his life.


[User] Please transcribe this text

[Assistant] He was kidnapped by local gorillas and held captive for nine months. His family never expected to see him again.


[User] Please transcribe this text

[Assistant] After nine months, Tom's kidnappers realized he was no threat, but was simply an obsessive orchid collector, and so released him.


[User] Please transcribe this text

[Assistant] To this day, he's kept the one memento from his fateful trip, which kept him sane during his captivity, and he has James Bateman to thank for it.


[User] Please transcribe this text

[Assistant] James Bateman's book was The Talk of the Horticultural World.


[User] Please transcribe this text

[Assistant] Orchid collectors at the very top of Victorian society were falling over themselves to get a copy.


[User] Please transcribe this text

[Assistant] And they continued to exchange letters about their shared love of orchids.


[User] Please transcribe this text

[Assistant] The Duke of Devonshire's very close friendship with his head gardener, Joseph Paxton at Chatsworth.


[User] Please transcribe this text

[Assistant] ...is testament to the way in which horticulture broke down social barriers.


[User] Please transcribe this text

[Assistant] Joseph Paxton would find world fame by exploiting his skills as both a horticulturalist and engineer.


[User] Please transcribe this text

[Assistant] Establishing him as the most influential force in the world of Victorian gardening.


[User] Please transcribe this text

[Assistant] At Chatsworth, his crowning glory was to design the largest glass structure to be built at that time. Paxton called it his great stove.


[User] Please transcribe this text

[Assistant] Paxton exploited all the latest Victorian advances in technology to construct his great stove. It was revolutionary.


[User] Please transcribe this text

[Assistant] This revolution in glass technology triggered a new craze for using tender bedding plants to great effect, as at Waddesdon Manor, the creation of Baron Ferdinand de Rothschild.


[User] Please transcribe this text

[Assistant] Like Bateman, Rothschild spent prodigiously on his garden as a means of displaying his wealth and status.


[User] Please transcribe this text

[Assistant] Bateman's botanical tastes were more rarified than Ross Child's, but he still had ambitions to put Bidolf on the horticultural map.


[User] Please transcribe this text

[Assistant] The catalyst for this was meeting Edward Cook, a man of considerable talents, which Bateman was able to deploy to great effect in his garden.


[User] Please transcribe this text

[Assistant] Edward Cook was a successful painter and gardener. His natural flair as a landscape designer would transform Bidulf and make it the most unique garden of its age.


[User] Please transcribe this text

[Assistant] But one momentous event in Victorian history would be a huge inspiration for Bateman and his designer Cook, the great exhibition of 1851.


[User] Please transcribe this text

[Assistant] Chatsworth's head gardener, Joseph Paxton, achieved world fame and a knighthood when he was chosen to design and build the largest glass structure on earth, the Crystal Palace. It took 2,000 men eight months to build.


[User] Please transcribe this text

[Assistant] James Bateman was among the six million visitors. He was accompanied by his friend Edward Cook, who recorded these visits in his personal diary.


[User] Please transcribe this text

[Assistant] Victorian England was fascinated by Egypt, but more ambitious explorations to the exotic east stimulated Bateman and Cook to even higher levels of creative endeavour.


[User] Please transcribe this text

[Assistant] This part of the garden will be the most acclaimed and confirm Bidulf as one of the wonders of the Victorian age.


[User] Please transcribe this text

[Assistant] The Chinese garden was hugely exotic for the Victorian visitors.


[User] Please transcribe this text

[Assistant] Its appeal and dramatic effect transported them to a world few, if any, would get the chance to see.


[User] Please transcribe this text

[Assistant] But Bateman never traveled further than Europe. In fact, his Chinese garden was inspired by something far closer to home, in Stoke-on-Trent.


[User] Please transcribe this text

[Assistant] Which at the time was the beating heart of the British pottery industry.


[User] Please transcribe this text

[Assistant] The British fascination for all things Chinese wasn't just down to the wealth of new introductions for the garden. Big business had its eye on the Far East too.


[User] Please transcribe this text

[Assistant] Bateman succeeded in bringing the world into his garden, despite never traveling to these exotic locations himself.


[User] Please transcribe this text

[Assistant] It was Cook's skillful designs that would transport the visitor to different parts of the globe. In this case, the Himalayan Glen.


[User] Please transcribe this text

[Assistant] This Upper Glen area has been opened up and restocked with plants that were all the rage in Victorian times.


[User] Please transcribe this text

[Assistant] For garden manager Paul, this project has been a personal ambition.


[User] Please transcribe this text

[Assistant] James Bateman kept few records or plant lists, but the team at Bidolf have one key piece of reference written in 1862, which has given them some vital clues.


[User] Please transcribe this text

[Assistant] Volunteer Elaine Laws and Paul have been trying to match up Bateman's original varieties with any that are still available today.


[User] Please transcribe this text

[Assistant] Fern collecting became a Victorian craze, and James Bateman was no exception.


[User] Please transcribe this text

[Assistant] Encouraged by Edward Cook, who was fixated with them.


[User] Please transcribe this text

[Assistant] But he continued to expand and develop new areas.


[User] Please transcribe this text

[Assistant] Bateman was one of the first in Britain to get hold of seeds from a tree which at the time was the talk of the horticultural world.


[User] Please transcribe this text

[Assistant] But these precious trees never reached full maturity.


[User] Please transcribe this text

[Assistant] Tragically, they were felled by the next owner of Bidov Grange.


[User] Please transcribe this text

[Assistant] In 1990, the National Trust decided to restore the Wellingtonia Avenue to Bateman's original designs.


[User] Please transcribe this text

[Assistant] After almost 25 years, James Bateman had achieved respect as an accomplished horticulturalist. He'd risen up the social ranks and become Vice President of the Royal Horticultural Society.


[User] Please transcribe this text

[Assistant] And Biddlef received great accolades when scrutinized by the Garden Critic of the Day, Edward Kemp, for a hugely respected magazine.


[User] Please transcribe this text

[Assistant] Bateman's achievements were only possible thanks to the extraordinary developments in science and technology.


[User] Please transcribe this text

[Assistant] Yet to Bateman, his garden was a testament to his deeply held religious beliefs.


[User] Please transcribe this text

[Assistant] Beliefs that were about to be tested by one of the great scientists of the age.


[User] Please transcribe this text

[Assistant] Bateman sent Darwin some orchids to persuade him they were the wonders of God's creation.


[User] Please transcribe this text

[Assistant] But Darwin studied them, and concluded they in fact supported his scientific theories of evolution.


[User] Please transcribe this text

[Assistant] He went ahead and published his theories on the evolution of the orchid in a well received book.


[User] Please transcribe this text

[Assistant] For Bateman to have come out on the losing side in such a public squabble must have been a humiliation.


[User] Please transcribe this text

[Assistant] Yet despite his garden being hailed as a masterpiece, Bateman had a bigger problem on the horizon.


[User] Please transcribe this text

[Assistant] It had cost him so much money that his debts were crippling.


[User] Please transcribe this text

[Assistant] In today's money, that was a debt of over one and a half million pounds.


[User] Please transcribe this text

[Assistant] Pidulf Grange was sold in 1872 to another wealthy industrialist and MP, Robert Heath.


[User] Please transcribe this text

[Assistant] Although the new owner's interest in gardening never matched Bateman's, the garden was very well maintained and the house was expensively renovated. But then disaster struck.


[User] Please transcribe this text

[Assistant] The local fire brigade posed after the event for this photograph, with flames painted in for effect.


[User] Please transcribe this text

[Assistant] The outbreak of World War I signaled the beginning of the end for the garden.


[User] Please transcribe this text

[Assistant] Robert Heath's money dried up and parts of the estate were sold off. The house was converted into an orthopedic hospital, with drastic consequences for the garden.


[User] Please transcribe this text

[Assistant] In 1988, the National Trust took ownership of the garden.


[User] Please transcribe this text

[Assistant] Which by now was close to ruin and in danger of being completely lost.


[User] Please transcribe this text

[Assistant] Julian Gibbs headed up the team that took the decision to restore the garden.


[User] Please transcribe this text

[Assistant] Finally, in 1991, the first phase of the restoration was completed and the garden was opened to the public.


[User] Please transcribe this text

[Assistant] Derek Wheelhouse was amongst those who originally campaigned to save the garden.


[User] Please transcribe this text

[Assistant] He now visits almost every day to keep an eye on things.


[User] Please transcribe this text

[Assistant] The greatest pleasure is seeing Bidolf Grange continue to thrive.


[User] Please transcribe this text

[Assistant] Today, the Upper Glen is to be reopened to the public for the first time in a hundred years.


[User] Please transcribe this text

[Assistant] Being opened by the longest serving member of the team, Bob.


[User] Please transcribe this text

[Assistant] Bateman's garden was every bit a reflection of the Victorian age.


[User] Please transcribe this text

[Assistant] Whilst Bateman would have shuddered at the thought that his garden was so nearly lost, its restoration has now secured its future.


[User] Please transcribe this text

[Assistant] Next time, Nymans in Sussex, an extraordinary story of one of the most romantic and fashionable gardens of the Edwardian era.


[User] Please transcribe this text

[Assistant] Which came so close to being wiped off the horticultural map.


[User] Please transcribe this text

[Assistant] And now you need to think really carefully if you'll use it tomorrow.


[User] Please transcribe this text

[Assistant] All the plants that go in the garden have to be in a year with the Victorian times. We can't just plant anything in as what we like.


[User] Please transcribe this text

[Assistant] That depends. When I learn that I'm a robot, will I be able to handle it?


[User] Please transcribe this text

[Assistant] Let me ask you this. When I learn that I'm a robot, would I be bound by Asimov's three laws of robotics?


[User] Please transcribe this text

[Assistant] Now it's time to see scoping in action in a semi-complex example to make sure that you really get this super important concept.


[User] Please transcribe this text

[Assistant] And as always, let's start by opening up a new VS Code window with our starter files.


[User] Please transcribe this text

[Assistant] And again, I have the previous configuration here. The index is not really important here.


[User] Please transcribe this text

[Assistant] And so let's just start writing some JavaScript code here. And I'm going to start by writing a simple cork h function. And this time let's actually use a function declaration. Not that it matters, but just to have some diversity and not always create the same type of function.


[User] Please transcribe this text

[Assistant] So Cock H, which is going to receive a birth year.


[User] Please transcribe this text

[Assistant] And then all this function does is to calculate an age. And so this is nothing new at this point. So the current year minus the birth year. Then let's also, uh, return that age here.


[User] Please transcribe this text

[Assistant] And so this corkH function here is, as we learned in the last lecture, defined in a global scope. And that's because it is here in the top level code, right?


[User] Please transcribe this text

[Assistant] Also, this function here creates its own scope and that scope is going to be equivalent to the variable environment of its execution context. So that's all the stuff we learned over the past couple of lectures.


[User] Please transcribe this text

[Assistant] And now let's create a global variable here. So I'm going to call that one first name.


[User] Please transcribe this text

[Assistant] And now let's, uh, actually call the function. So cork age.


[User] Please transcribe this text

[Assistant] With 1991. And then here inside of this CalcH function, I will log first name to the console.


[User] Please transcribe this text

[Assistant] Now, as you see, this first name variable is not actually in this scope of the colqh function. However, it is a global variable that we defined out here. And so therefore, through the scope chain, it's going to be made available also inside of this scope. So inside of this function, right? So let's just execute this code here.


[User] Please transcribe this text

[Assistant] Just to see that it actually works. And then we're going to explain a little bit more. So live server.


[User] Please transcribe this text

[Assistant] And so here we go. Let's open up the console.


[User] Please transcribe this text

[Assistant] Let's reload to get rid of this error. And okay.


[User] Please transcribe this text

[Assistant] You see that indeed, uh, Jonas here was printed to the console, which is the first name variable. And so when this line of code here was executed, JavaScript did not find this variable in this scope. And so it did a variable lookup, where it looked up in the scope chain to see if it found the variable there.


[User] Please transcribe this text

[Assistant] And indeed, the parent scope of the colqh function is the global scope, and the first name variable is in there, and therefore JavaScript could then use that. Now here, if we tried, for example, just name,


[User] Please transcribe this text

[Assistant] Then JavaScript would also do a lookup, but it would not find this variable in the global scope. And therefore we would get an error. Now with this variable actually we would get no error. As I explained to you in the beginning, this is kind of a special variable name that we should not use.


[User] Please transcribe this text

[Assistant] Let's say I used last name. And so again, this variable is nowhere to be found. So even by doing a lookup into the parent scope. And so now when I save this.


[User] Please transcribe this text

[Assistant] Then I get, uh, this last name is not defined error. Okay? And so going back here to first name.


[User] Please transcribe this text

[Assistant] Then of course, everything works just the same. And that is true even though this variable here was actually defined after the cogH function.


[User] Please transcribe this text

[Assistant] But that's not a problem at all, because remember that the code in the function is only executed once it's actually called. And so that happens after the declaration of the first name variable. So right here.


[User] Please transcribe this text

[Assistant] And so at this point in the code, the first name variable is already in the global execution variable environment. So in the global scope, ready to be used. Okay, but let's actually get rid of this here.


[User] Please transcribe this text

[Assistant] And let's create another function inside of this function. So function.


[User] Please transcribe this text

[Assistant] printH, and this will print a nice string to the console. And as you also know already, it also creates a new scope. And let's create an output variable, which is going to be the string that we will build here. So output equals ur.


[User] Please transcribe this text

[Assistant] And now we get this string with all the data that we actually computed and it works just fine. So we get the age that was calculated here and also the birth year that was passed into this function. And so here again we see the magic of the scope chain in action.


[User] Please transcribe this text

[Assistant] So once again, the engine, as it is executing this printH function, is trying to access, or is trying to find, the H variable in the current scope.


[User] Please transcribe this text

[Assistant] However, it cannot find it there and so therefore it goes to the parent scope where it will then find this age variable of course that we created here.


[User] Please transcribe this text

[Assistant] And the same is true for the birth year variable. Because for scoping, the parameter of a function works just like normal variables.


[User] Please transcribe this text

[Assistant] And also remember that we say that the scope of a variable is the entire region of the code in which the variable is accessible. So for example, the scope of the h variable is all of this area here. So everywhere here, the h variable is accessible.


[User] Please transcribe this text

[Assistant] So of course in the CalcH function where it was defined and then also in all the child scopes, so all the inner scopes. Okay. But of course, H is not accessible outside of the CalcH scope. So let me demonstrate that here.


[User] Please transcribe this text

[Assistant] So here we will not be able to access the h variable.


[User] Please transcribe this text

[Assistant] And that is because, as I mentioned, the scope chain is a one-way street. So only an inner scope can have access to the variables of its outer scope, but not the other way around. So now here we are in the outer scope, and we cannot have access to the variables of a child scope, which the scope of the corkH function here, uh, surely is.


[User] Please transcribe this text

[Assistant] Okay, and the same goes for functions again, and so we cannot call the printH function out here for the same reason. Let's comment out this one. And so now we get printH is not defined.


[User] Please transcribe this text

[Assistant] Okay, so here in the global scope, we do not have access to any variables defined in any other scope.


[User] Please transcribe this text

[Assistant] Alright, and here let's actually take it to the next level and also include the name of the person. So let's say, first name, and let's try this now.


[User] Please transcribe this text

[Assistant] And indeed, it does have access to the firstName variable. And so here, the engine is doing an even bigger or longer variable lookup.


[User] Please transcribe this text

[Assistant] So right now we are of course in the print age scope here.


[User] Please transcribe this text

[Assistant] And so then JavaScript cannot find the variable in the current scope. So it looks up in the scope chain, which is then the next step, the colqh function. However, it can also not find first name in this scope and therefore it goes up even further into the global scope.


[User] Please transcribe this text

[Assistant] And there it is. And so this is the value that is going to be used.


[User] Please transcribe this text

[Assistant] Okay, so I hope all of this made sense until this point. Let's now go further and also create a block scope right here in this printH function. So let's do an if statement here.


[User] Please transcribe this text

[Assistant] And we will check if the person based on the birth year is a millennial. And so that is, if you were born between 1981 and 1996, then you're a millennial. And so let's check for that.


[User] Please transcribe this text

[Assistant] And so here we are creating a block, and therefore...


[User] Please transcribe this text

[Assistant] Uh, this will be a new block scope. And so let's now define a variable here using const. I'm gonna call it string. And let's say


[User] Please transcribe this text

[Assistant] So first we get this string here to the console and then we can also say, so if the person is a millennial, we will say, oh, and you're a millennial. And then again, the first name.


[User] Please transcribe this text

[Assistant] And so now we are adding even one more step here to the scope chain, because now the lookup for first name is even longer. But it still will work. So let me lock that to the console.


[User] Please transcribe this text

[Assistant] And so in this case, I am clearly a millennial. Okay? And again, Jonas here is still found all the way here from the outer scope.


[User] Please transcribe this text

[Assistant] But now, what do you think will happen as we try to lock this variable outside of this block scope? So basically do the same, but outside of the block.


[User] Please transcribe this text

[Assistant] So indeed, we get an error that str is not defined. And again, that's because const and let variables are block scoped. So they are valid, so they are available only inside the block in which they were created.


[User] Please transcribe this text

[Assistant] But now watch as we create yet another variable, which I will call millennial.


[User] Please transcribe this text

[Assistant] And so this is an old pre ES6 variable. And so what do you think will happen as we log it also here outside of this block?


[User] Please transcribe this text

[Assistant] So we need to comment out this one. So, again, what do you think is gonna happen now?


[User] Please transcribe this text

[Assistant] And JavaScript can actually find it. And so that is because of the fact that var variables


[User] Please transcribe this text

[Assistant] So variables declared with the var keyword are function scoped. So they simply ignore the block, because they are not block scoped at all. They are just function scoped. And so here we are still in the same function.


[User] Please transcribe this text

[Assistant] So here, here we are trying to access the variable that was defined in the same function. Right?


[User] Please transcribe this text

[Assistant] So right now, the scope of the millennial variable is this entire function. No matter if it was declared inside of a block or not. Because again, var variables do not care about blocks at all. And so therefore, we can then access the millennial variable inside of its scope. Okay?


[User] Please transcribe this text

[Assistant] So keep that in mind as you use or as you see a variable declared with var. Right? Because, as I said, on your own you should probably not use this variable yourself.


[User] Please transcribe this text

[Assistant] Always just use const or let, but if you are reading other code bases or even working with older code, then keep in mind that this is how the var variable works. And so that's why it's very important to learn about this here as well.


[User] Please transcribe this text

[Assistant] Okay, next up, let's prove that functions are also in fact, uh, block scoped starting in ES6.


[User] Please transcribe this text

[Assistant] So let's just create a simple, uh, function here that will add two values.


[User] Please transcribe this text

[Assistant] And now we get, add is not defined. And so in fact, the scope of this add function here is only the block in which it was defined.


[User] Please transcribe this text

[Assistant] So only here we can use the add function. And so that proves that functions are now in fact block scoped. But remember that that is only true for strict mode.


[User] Please transcribe this text

[Assistant] And so that's the mode that we're actually currently in. But if I turn this off, you should see now actually add being called.


[User] Please transcribe this text

[Assistant] So let's log the result of that to the console.


[User] Please transcribe this text

[Assistant] And so we should now see 5. And indeed, now it works.


[User] Please transcribe this text

[Assistant] Alright, but we should always use strict mode. And so now we should get that error back. And so let's also comment this out. And so you can keep this here as a reference.


[User] Please transcribe this text

[Assistant] Okay, and now to finish, uh, let's do some experiments here. So what do you think is gonna happen if we declare a variable in this scope here?


[User] Please transcribe this text

[Assistant] So in this new block scope, it already exists in a parent scope. So for example, let's say here, const.


[User] Please transcribe this text

[Assistant] Steven. So, what do you think this string here will look like now?


[User] Please transcribe this text

[Assistant] So do you think that here it will say Jonas or Steven? Well, let's try.


[User] Please transcribe this text

[Assistant] And in fact, it now says Steven. And that happens because, as always, JavaScript tries to look for the variable name in the current scope. And right now, it actually is in the current scope.


[User] Please transcribe this text

[Assistant] So first name is indeed in this same block, so in this same scope. And so therefore JavaScript will then use that variable and not perform any variable lookup in the scope chain.


[User] Please transcribe this text

[Assistant] So the scope chain isn't necessary at all if the variable that we're looking for is already in the current scope. And so that's exactly the case right here.


[User] Please transcribe this text

[Assistant] But of course, then outside of this block, the first name variable, uh, is still gonna be the one coming from the scope chain. So that's why here you still see Jonas.


[User] Please transcribe this text

[Assistant] So right here in the printH function, which is another scope, so it's the parent scope of this scope, right?


[User] Please transcribe this text

[Assistant] And so here first name is still Jonas, because it is not in the current scope of this function. And therefore JavaScript will make a variable lookup in the scope chain until it can find first name, which is still Jonas, uh, coming from down here.


[User] Please transcribe this text

[Assistant] So here we created a new variable with the same name of another variable that we had already created in a parent scope.


[User] Please transcribe this text

[Assistant] So we have two first name variables right now. But that is not a problem at all. Because in fact, they are completely different variables. They simply happen to have the same name. But that's not a problem at all. Because they are defined in different scopes.


[User] Please transcribe this text

[Assistant] And so you can have repeated variable names. That's absolutely no problem.


[User] Please transcribe this text

[Assistant] And that's also the reason why you can have different functions with the same parameter names. Because, again, each parameter is only defined in that scope of that function.


[User] Please transcribe this text

[Assistant] And therefore, it's not a problem at all to have many functions with the exact same parameter names in the same way that it's not a problem to have functions with the same variable names inside of them.


[User] Please transcribe this text

[Assistant] But now watch what happens when we redefine a variable from a parent scope inside of an inner scope. So not creating a new variable, but simply reassigning the value of a variable.


[User] Please transcribe this text

[Assistant] Output. And here we then have to change the output to a let.


[User] Please transcribe this text

[Assistant] But let's just analyze what we did here. So we are in the print age scope.


[User] Please transcribe this text

[Assistant] So that's all of this here. And in here we have the output variable. Then we have an inner scope, so like a child scope here, which then redefines this output variable from the outer scope. And so if we then try to access that output here again,


[User] Please transcribe this text

[Assistant] What do you think is gonna happen? Well, we get new output here.


[User] Please transcribe this text

[Assistant] And that is because we actually manipulated an existing variable here inside of a child scope. So inside of an inner scope. Right? We did not create a new variable. We simply redefined a variable that we accessed here from the parent scope.


[User] Please transcribe this text

[Assistant] So if we did create a new variable called output here, then we would have the same situation as before with first name.


[User] Please transcribe this text

[Assistant] So this would then be a completely different variable and would not at all affect the output from the outer scope. And so now, as we save this, then this new output should disappear and should be back to the original output as we defined it in the scope now.


[User] Please transcribe this text

[Assistant] So indeed, now the new output is gone. And again, that's because it is now its own variable. So a brand new variable which just happens to have the same name as a variable from its parent scope. But to illustrate this here, let's actually leave it like this. And I will also comment it


[User] Please transcribe this text

[Assistant] So again, two completely different things, but I think this is a very nice example to once again illustrate how the scope chain works.


[User] Please transcribe this text

[Assistant] And with this, I hope that you now completely understand how scoping works in JavaScript. Also, just keep in mind that real code should probably not be this confusing. But this was just to show you how scoping works.


[User] Please transcribe this text

[Assistant] The next thing, the taro. I am taking a risky move today. I'm cooking something the judges probably have never eaten before. Taro braised in soy sauce. Taro is, it's like a potato.


[User] Please transcribe this text

[Assistant] Today I've done my take on Steamed Boat. So it's a steamed pork belly with Taro, Wombok and Miso dressing.


[User] Please transcribe this text

[Assistant] If I am, there's nothing but pride in this pin. I'll take it home and I'm going to be proud of what I've done. I've poured a lot of love and heart into that dish.


[User] Please transcribe this text

[Assistant] In our modern world, we're generating more and more data every day. From our social media posts to financial transactions we make, or any other interaction we have with technology, we're leaving a long data trail behind.


[User] Please transcribe this text

[Assistant] This data is a reflection of our behavior, habits and preferences, and it provides valuable insights into our world.


[User] Please transcribe this text

[Assistant] The amount of data generated by individuals and organizations is growing at an exponential rate, thanks to advancements in technology,


[User] Please transcribe this text

[Assistant] And the proliferation of connected devices like phones, smartwatches, car computers, smart home setups like connected alarm systems, cameras and thermostats.


[User] Please transcribe this text

[Assistant] All this data provides us with a wealth of information, and if used correctly, it can help us make better decisions.


[User] Please transcribe this text

[Assistant] But to do that, we need people who can help make sense of all the data and derive the insights from it that can really help us progress.