Okay, once again, all this week we're doing shell script basics, so if you're working in a Unix or Unix-like environment, you're probably going to have a shell that you can work with, bash is one of the most common, but not the only one. They're all very similar, and most of what I'm teaching in these basics should work throughout all of them, but I never said that it definitely will, but should for the most part. And we're just getting back to basics because my old videos, the quality, was pretty low, so I want to give a little updated look. And today, well first let's review what we went over last time. We went over new line characters. When we say who are you, I don't know. I can say dash n means no new line at the end of this, so I can run another command, another echo command, echo, who are you, and I can say, I don't know, blah, blah, blah, I don't even know what to type. So I'll hit enter, and even though these are two separate commands, the first one is not going to put a new line at the end, so it should all print out on the same line. There we go. At the same time, if I wanted to, I can put new lines within the command. If I do dash e, it tells it to look for these special backslashed characters, so I can say dash n, backslash n, which means new line. So everywhere I put a backslash n, as long as I have this e here, it will put a new line. I will hit enter, and you can see each thing is on a new line. So that's quick. Oh, and then clearing the screen, you can either type clear and hit enter, or if you are actually working in the terminal, not just writing a script, you can press control L, and it will clear the screen for you. So today we're going to look at saving stuff to a file, and then we will read what we put in the file, and we'll also work on appending the file. So creating a file, adding stuff to it later on, and maybe overwriting the file. So let me real quick here, makedir. I'm just going to create something in my temp directory. Temp directory is something that clears out, should clear out every time you restart your computer, so I don't care about this, so I'm just going to put it in here. Oh, I'm kind of, okay. I wasn't playing on teaching about makedir, but since I'm going to here, makedir, and we'll get into it more in a future tutorial, means makedir. So I'm going to make in a directory, and I'll call this temp tutorial, and kind of ignore what I'm doing right now. I should have done this before I started recording, but we will go over it later this week, and I'll control L to clear the screen. Okay, so right now I am in a folder, and I'm going to say echo hello world, and it puts it out to the screen, right? Well, let's say I want to save it to a file. So I can say, same thing, once again, hitting up arrow brings me to my previous command, and I can do this greater than symbol, and this is telling it to take the output and put it into the file I name, so I'll just call this output.txt. Make it a little bit easier to read up with some spaces there. So now when I hit enter, we don't see it on the screen, hello world, it actually went into a file that we just created. Now, to read from that file, I'm going to use the cat command, which stands for concatenate, which I'm not going to explain, but basically it prints out what's inside a file if we give it a file name, and there's another thing, you can type out the whole name, output.txt, or you can always start typing in most shells, you can press tab and it will auto complete for you if that file exists. So anyway, cat, output.txt, which is what we just created, if I enter, it says hello world. Once again, I'll hit up arrow twice just to go back to the previous command here, and I'll type the same thing, I'll say hello Chris, that's me, and I'll hit enter. Now, if we cat out, once again, I'll hit tab to auto complete that, and now the file says hello Chris, our hello world is gone, because we overwrote the file. Now, let's say we want to add a new line to that file, not overwrite what's in there, but just append to it. Well, once again, we'll say echo and we'll say hello world, and instead of doing greater than, we'll do greater than greater than, and that means to instead of once again overwrite the file, we're going to append to it, we're going to add to it. So we will say once again the same file, I'll type in ot and hit tab to auto complete. Once again, since that file exists, otherwise it wouldn't find it. I'll hit enter, and now if we cat, which once again reads the file, tab for output here, enter, and now that file contains two lines. So, we're writing to a file, created the file, when we wrote to it, we read the file, we appended to it with the greater than greater than, and then we read it again. So now let's append to it again. I just want to show you just to add something from a previous tutorial. I'll just say this is new, but what I'm going to do here is I'm going to say dash e, and I'm just going to put my little new line character there. So now when I hit enter, and I cat out the file that we have, you can see it does recognize our new line character, so new is put on the end there. And at the same time, let's say I say hello world again, but I say dash n, and hit enter, which means no new line at the end of the echo command, and we cat this out. You can see when we cat it out, we say hello world, and there's no new line at the end. So there is no empty line at the end there. So if we were to actually do that a second time, so echo, no new line, hello world, we're appending to our output file, and once again the output file, you can name whatever you want, or within reason. Once again, avoid special characters, and you should avoid spaces, and we will hit enter, and if we cat it out now, you can see the last line says, whoops, did not mean to resize that. Let me cat that out again, because I messed everything up. We'll say, it says hello world, hello world, and then our command prompt, because there's no new line at the end of the file. Now if we were to do it again, hello world, a third time, once I'm gonna control L to clear the screen, because it's getting too long there, so hello world, and this time I removed that no new line, and I cat out our output file. You can see it went on that same line again, because the new character at the beginning, there is no new character at the beginning, and we didn't put a new character at the end, or new line at the end, but the new line character we put the end here allows our command prompt to be at the end here. I hope that makes sense. I kind of sound like it didn't make sense. Basically just realize that if you don't put a new line at the end, the next line you add will be on that same last line as the last thing you added. Okay, so once again reviewing with the clear echo, and this doesn't just work for the echo command. Any command that has standard output, and there's different types of outputs, there's standard output and error output, but most time you're going to be working with standard output. Any program that has any type of output that comes to the screen can be redirected into file. If it's not standard output, you got to do it a different way, but so we're just using the echo. We're going to work with other commands in the future and put the output of these commands into a file, but just remember, you can echo one greater than means create or overwrite a file to mean append to that file. And also, if the file does not exist, it will create it there as well. So let's say I was to say to output greater than greater than that file does not exist yet. It does now cat to tab to autocomplete. There it is. So once again, working with basics this week, putting out a new video every day this week, hopefully. Just going back to the basics. We're going to continue our advanced stuff on video editing command line next week. I hope you enjoyed this tutorial. If you did, and you want to learn more, be sure to one subscribe to my YouTube videos because I put out videos regularly to check out the playlist for this this series of shell basics. Hopefully I'll remember to put an annotation or a link in the description. And like if you go there now, there might be some videos that aren't viewable yet because they're not released yet, but they will be by the end of this week. But that's only going to be an issue if you go to the playlist this week. But so check out those videos. Go to my website filmsbychrist.com. That's Chris the K. There should be a link in the description. I've got hundreds and hundreds and hundreds of videos, not only on shell scripts, but Python scripts and a bunch of other stuff. Everything should be broken down into playlists. And I just hope you subscribe, enjoy and learn. And I hope that you have a great day.


ThinkTechAway, civil engagement lives here. Comfort Zone on ThinkTech on Spectromosy 16. I'm your host, Arby Kelly, and today I'm excited to share something with you that has been created by Leiland Papaya. Is that how you say your name? Yes. Leiland Papaya. Leiland Papaya. All right. That happened on air. Oh well. Gonna keep moving. Leiland Papaya. So Leiland, can you tell me a little bit more about what you've created and what you're trying to advocate for? Yes. So I'm following a dream that I've had for the last couple years to start a mobile app where people will be able to have dinner parties at their house and charge people to attend. So what brought this into creation? Well with the popularity of other share economy businesses like Airbnb and Lyft and Turro, I just felt like it was the next great thing to come and like I said I had this idea a couple years ago and was like waiting and waiting and waiting for someone else to make it happen because I feel like I get ideas all the time and I just don't follow through on them. And two years later there was still nothing available so I was like I'm gonna take a risk and I'm gonna do it and I'm gonna launch it in Hawaii and it's gonna be great and everyone's gonna love it. So is this something you've been doing on your own or do you have a team to try and help you? Well I've been doing it on my own but I do have a developer that's creating the app for me. I don't know how to do code so. Gotcha. So can you tell me a little bit more about what the experience will be like when the app is done? How it will work? Yeah.  Let's say you have two extra seats at your dinner table and you charge $15 for each of those seats. You throw it up on the app and people will be able to request to come to your party and you either approve them or not. Hopefully you'll just approve people because they want to come to your house and eat dinner with you and then yeah they'll knock on your door, they'll show up and you'll get to make new friends and share your love of food and not have to fit the bill and the expenses for feeding people which is what I tend to do and I feel like a lot of people do a lot of potlucks at their house because they can't afford to feed everyone and I think with this app it gives you an opportunity to be totally in charge of what the dinner is going to be at your house but having a little financial support from your guests. I can see how some people, enterprising people, would even turn this into a thriving business. I know. This is what they do.  I can even see, I've been watching Hawaii 5.0 recently and Danny and Steve they want to open a restaurant and they haven't opened it yet and I could even see for them this app would be something where they could have it at their house and they could test recipes on people and get feedback before they actually went into business. There's so many different things you can do. If you're a student, culinary school, you can practice, yeah getting ready to open a restaurant or if you just don't even want to deal with the restaurant because of like the rent you'll have to pay and your employees and everything it's just a great way to share your love of food, yeah have a little mini restaurant in your house without all the crazy overhead. And one thing we really haven't touched on yet but I think is really important is the social aspect because it's so easy to get like locked in our own little lives where we don't talk to anyone new, we don't reach out to anyone new. So I can see how this app would be a really good way for even an empty nesters who their kids have moved away but she still loves to cook but now they're lonely at home they can invite people over, they can build their network. Yes I actually have one woman in Waikiki that is so stoked about this app she has an awesome Instagram account she posts pictures of these beautiful dishes that she makes it looks like art her food it's incredible and I reached out to her and she was exactly that empty nester she was like I am eating this food by myself it's such a shame no one even gets to eat it so she's alone and really excited to invite people into her house to feed them, yeah. So tell me about the the journey this app has taken you said it started out as an idea two years past no one else had created it so you then started to take action can you tell us a little bit about that journey? Yeah I just you know wasn't gonna let this other this this idea of many just kind of like fall into someone else's hands especially when I just wanted it to be done so that I could use it because I love you know I would love to go to a stranger's house and have a meal with them so I posted on Facebook does anyone know how you like get a what you know get a business going like this several people tagged this one woman who used to live here and so I reached out to her and she works for a company in New York for this guy and it turns out this developer had actually used an app like mine in France it's called Feastly and so just the fact that he was the type of person that would be in France and want to use that type of concept I was sold so yeah I've been working with him since August and getting it going and getting a logo and getting a video and a website and everything and it's taking a lot longer than I would like but we're making sure that we're doing it right and launching at the right time so the app is like no bugs and ready to go and that is a challenge it seems like everything in business takes longer yeah some more yeah I think it yeah yeah so do you do at this point have an estimate of when it will be out or is it still still in testing so right now we're sending people to our website to register you input your email and we'll send you the app when it's ready it's like almost ready there's just a few bugs but yeah I would say June would be a good estimate which is next month that is next month and it's also my birthday June babies June 24th June 10th all right so can you tell me you said before that this is an idea you'd had several ideas before but you've never acted on them so it made it really different this time that this is the one you you wanted to create just tired of working in 9 to 5 and I feel like this will be really successful to be honest I think you know this could be as big as Airbnb and Lyft and I would love to travel the world and promote dinner because we're launching in Hawaii I know a lot of people in Hawaii I know I can have a successful launch here but if it goes crazy in Hawaii I would love to travel the world and promote it in other areas and make this my life life's mission I've practiced this concept a couple times in my home just promoting on Facebook and I actually had strangers come to my house like people in my neighborhood that were like I would love to have you know dinner with my neighbor and pay $20 sign me up so the idea that several people across the world will be having that same experience in their home because of me I just got me more excited than anything else that I could think of so even as you talk about it going across the world I even had the thought of I have a friend who travels a lot and has business events wherever she goes and they're always looking for restaurants and cool places to eat and I just had the thought well if you're someone with a beautiful home or you're a man you've got a really cool neighbor in your house sitting like hopefully it's all legal there but there are so many different opportunities for you to just connect with people and when you when you look at the the political divisions in our world the religious divisions in our world there are so many so many ways that we divide ourselves from each other it sounds like your app is one of the things that's that's trying to help bring people back together yeah yeah yeah studies show over and over again that safer neighborhoods are ones where the neighbors know each other and they look out for each other and so getting people you know growing up we had dinner at our neighbors all the time we were friends with them but you know just like this day and age we just don't do that and I think Hawaii is a very tight-knit kind of community but it's also very transient so like I've moved a lot it doesn't give me an opportunity to really meet my neighbors but you know if they were on this app I would probably be friends with all of them and they'd be friends with me yeah yeah I'm curious about some of the other ideas you've had before you acted on this one what other ideas that you kind of have I don't know I can't think of one off the top of my head but I know I remember my dad and he was talking with my brothers we lived in like really small town St. George Utah and he was like oh my gosh it would be such a smart idea we were to create a rival ambulance company because there was only one ambulance company and apparently at the time they kind of sucked at their job and he just had the brilliant idea to start an ambulance company but we just talked about it and thought about it and talked about it but we never actually took action yeah what was what was the thing that turned this from an idea to I'm actually gonna make this happen well to be honest I sold a house in Colorado I didn't make very much money I made it just enough money that I could probably blow it in one year in Hawaii going on a couple trips maybe not working as much and I've actually done that before and I just felt like I want to invest this into my future and something that's gonna make myself and a lot of people really happy and I just told myself you know I could lose it all but it's just money and I'm really trying to make decisions based on love and not fear yeah even if this thing only like works a little bit you know like only a few people use it it'll still be fun for me and yeah it's just money I love that it's just money it's so it it's not like you're you're thinking I need this to work or you've put all your eggs in this basket for you this is this is an idea something you think would help the world something you're trying to put out there into the world but you have other options and and if this doesn't work out you're gonna try something else yeah and if I was to not do this and wake up one day and someone else did it I would be so mad you know and I'd have to die knowing that I didn't do that thing because I was afraid and you know there are some fears not just about the money but that you know there'll be some backlash because oh now we're selling food in our homes like don't you need to have a commercial kitchen for that or like what if someone gets you know hurt or whatever but I think that these are all things that are already being worked through with Airbnb I think when Airbnb first came out people were probably like no that's crazy you can't have a stranger sleep in your house that's so dangerous yeah they could rob you but no that's not happening people are learning that your neighbors are safer than you thought and like it's okay to invite someone into your house a stranger into your house they're probably really nice you know just like you so yeah there's certainly plenty of things that could go wrong with this and several other any kind of idea you have when you're taking a risk as an entrepreneur but it's super cool to be the first one to do it because you were the one that took the risk and if you succeed it's just that much more sweet that really is so inspiring but I am wondering what advice you would give to our viewers because I know our viewers I'm sure you've had ideas about something you want to build or something you want to offer the world but you haven't acted on it so so Leland what advice would you give them to just start moving in the right direction you just got to start taking steps so I was really surprised when I posted on Facebook you know like who who can help me with this so many people were excited to help me so many people knew the right person knew the direction to go and then I took the next step by just calling the guy you know and actually his first step for me was to listen to a bunch of podcasts about about startups so I did that you know there were several steps I needed to do before I actually spent the money and I think we get stuck on like oh it's gonna cost a lot or it's gonna be dangerous or risky you can still take steps and if those steps start to build momentum and start making you feel good and excited then you know you're going in the right direction also like you just have to trust like things kind of always work out like if you lose all your money you'll be fine it's not I think that our brains are trained to help us avoid pain and so we get these really good ideas and it feels really good and then the second thought is oh but you could get hurt because we really our bodies are intended to help us avoid pain and suffering so you kind of got to go with the first thought which was the one that made you feel really good and if you're not happy with your current job or your current situation and you're thinking about that every day and it's making you sad you need to go in the direction of the thing that makes you feel good and try to ignore that little fear response that's trying to protect you from hurt because the hurt usually isn't even that bad like if I this money that I made off of selling my house in Colorado I've never actually even seen it like I made the money and then I just I paid it for the app right so it doesn't affect my life in any kind of negative way if I lose the money that is interesting and I know so many of so many times we see this big goal we really want to build and we see like all the way in the distance it's so far it's going to take so much sweat and blood and effort to get there that we've just think you know I'm just going to save the trip instead of focusing on you know the million of tiny steps that it will take to get there when the only step you need to worry about is the very next one yeah and then the next one alright viewers we are going to be right back after a short break and when we come back you'll be surprised at what we're talking about see you in a minute. I'm Andrea Gabriele I'm the host for young talents making way here on Think Tech Hawaii we talk every Tuesday at 11 a.m. about things that matters to tack matter to science to the people of Hawaii with some extraordinary guests the students of our schools who are participating in science fair so young talents making way every Tuesday at 11 a.m. only on Think Tech Hawaii mahalo Comfort Zone on Think Tech on Spectrum OC 16 I'm your host Arby Kelly and I'm here with Leland Papaya the creator of an app that is coming soon to you now now Leland over the break I was thinking that it's it's so interesting how we've been conditioned to be afraid of strangers like like you said when Airbnb first came out it was it was a big scary idea that you'd let strangers stay in your home and that was one of the things you mentioned being of that people would have to get over when they tried to use your app yeah so what do you think that is I don't think we're actually as scared of our neighbor as we think everybody is I think we live in a day and age where we're more disconnected than ever and people are really craving connections it's very rare that I tell anyone about this idea where they say oh my god I could never do that it happens every once in a while but mostly people are like how do I sign up I can't wait to do it you know most of us live on streets where we're passing by our neighbor and just like waving hello and we're like this is so awkward we live right next to each other and all we do is wave especially in Hawaii I know that we're not immune to crime but it's a really safe place to live and so I don't think we're I don't think there's not very many people that would be too scared to use this app and it's not like staying the night I mean if you show up for someone's dinner party and they're a little weird you're there for an hour and then you have a story to tell yeah I don't I don't think that danger is the first thing that comes to mind with this one I feel like it's more just awkwardness maybe we don't have the same political views or maybe yeah we don't have anything to talk about but I really feel it like with this one that's the worst case scenario that's gonna happen is there gonna be a way for people to to kind of rate the interaction like oh it's a horrible cook or oh it sends like super serial killer vibes is there a way for people to kind of like rate other users I'm really glad you asked me that because I put a lot of thought into that and the answer is no I don't want people to go to a dinner party and feel like they're being rated and reviewed because cultures are different especially in Hawaii and maybe you think I'm rude because I got up to go to the bathroom in the middle of dinner or I was talking with my food in my mouth or whatever like that or I put my elbows on the table certainly people can make a lot of mistakes during dinner and I just don't think it's fair to feel like you're being reviewed same with the host if you know a little lady on the street is trying to cook you heard her famous chicken lemon chicken and rice and she like overcooked the chicken you know and like didn't really do that good of a job I feel like her heart is in the good in the right place and I just think it would be crushing for her to get a one-star because of that now certainly if someone is consistently providing a bad experience our email is available and I definitely want to hear about those and I will personally call them go to their house and coach them on what is going wrong and if someone needs to be taken off the app I will for sure but I just don't think in this type of community building relationship building app that I really want human beings to be reviewed when they're just trying to share a meal with someone I think I can see where you're coming from but they're also charging people for that meal which means if someone advertises that they've got like a super super fancy meal and you show up and it's not what was advertised then then what is the situation there yeah that's a good question I still want to stick to I want to hear from people and especially in the initial stages I'm going to be reaching out to guests afterwards and asking them how things are going or how things went and I want to have a personal relationship with hosts and you know contact them about this complaint and it better not happen again and if it does then you're going to be taken off the app I don't think anyone is going to use this to take advantage of people I think there's going to be some hiccups and mistakes made as they're figuring things out but you know I'm open to first suggestions if that's not working we can add the reviews later on but for right now I feel like for example with Airbnb you're rating the house and the room more than the love and energy that someone puts into a meal and like that you know rating them on their personality or their their culture that can get a little sticky I think I can see that I can see that something you'll have to you'll have to test and tweet as it because I can see how the the personal level of feedback is going to be working when it's here in Hawaii but if it if it blows up is incredibly successful you're gonna you're gonna have to either bring on a team to do that you're gonna have that's something that's a bridge you'll cross yeah yeah yeah my developer keeps telling me like whenever I anticipate problems he was like by that time you'll be making so much money you'll be able to afford you know lawyers and a team and you know all of that stuff so that's a good perspective yeah I did I didn't get a question in my ear from from the team back there wondering if you'll be able to like verify users like Lyft or Uber do again when we're when we're really popular and we're making a lot of money then yes we'll be able to do that do that but for right now it's just gonna be a small community of hosts and guests where we're just gonna have to trust each other and yeah I would love to add that later on for sure all right so it sounds like if anyone you're not anticipating problems with the app you're not anticipating problems in the community but if there are you are gonna make the decision at that time as to how how to deal with it then yeah I want to have a real close like I said a real close relationship with the hosts and the guests reach out to them after parties ask them how it went and call them on the phone if I need to show up if I need to go to their dinner parties I am so excited about that I mean once we launch I'm gonna go to a dinner party every single night I can't wait I want them to know that I'm a person I'm here this is my little app you know we're not a huge company and let's all guard it and keep it safe and secure as a community rather than feeling like it's this big company that will just turn you off if you make a mistake you want that very personal feel yeah so if there are if there are viewers who are interested in investing or maybe beta testing or anything else how should they get in contact with you is that something you're even looking for well we've been doing yeah beta testing yes so we're doing alpha testing right now and we're almost done with that beta testing will be in June I've got about 70 emails of people that are ready to go whether as a host or a guest but we would still love to have more people that can be patient and understanding and help us figure this out as a community for sure and you would do that by going to our website and registering all right all right let's see what about what about food preferences like someone being vegan or vegetarian or like purely carnivore how do people navigate that yeah so I encourage people when they name their meal to you know if it's vegan call it vegan pizza party or whatnot you know if you have a really sensitive food allergy maybe this app isn't for you you know because I know that I had a vegan dinner party once where I accidentally put a salad dressing on the table that had a little bit of dairy in it and you know I'm a human we make mistakes we're not restaurants we're just people kind of throwing parties so you got to go into those with caution but yeah I would love to later on have search functions on the app or you can search for a vegan party or a gluten-free party and I think people that are really into cooking those specialty foods are really going to get a kick out of using the app to spread their love of gluten-free cooking or a vegan cooking awesome yeah so where can people go to get on your waiting list yeah so on our website www.dinnerparty.io yes yeah pretty much the only thing that's there right now is a short explainer video and a place to put your email and as soon as the app is ready and it's free by the way of course of course we'll email it to everyone that way wait I just had a question you said the app is free but you also said it can make you lots of money how does that work oh yeah so just like Airbnb dinner party will collect a small 10% commission off of every seat sold so you don't have to charge users but you just you just get a tiny fraction of the seats sold yes and I'm sorry correction we charge 13% because our the payment processing company takes 3% that makes sense so 10% just to keep it rolling keep it going website advertising the app which is way more expensive than I thought it was going to be yeah marketing is not fun but where do you where do you see this app going in the in the next five years where do you want it to be well I just would love for it to be a household name like Airbnb I'm really excited about the people I think there's a lot of people that need this app one would be people who are alone and are eating alone and actually I was living in Kailua for a while and I always saw this one woman out to eat at restaurants with her dog and I just couldn't wait for the app to be ready so that I could give her a card because you know you go out to eat at a restaurant to be around people but do you really connect no you're surrounded by a sea of people but you're there by yourself and the waitress will come up and ask you what you'd like to order but there's no connection yeah so people that are alone I want them to I want this to be popular enough that they're hearing about it and they're hearing that it's going well and that it's safe you know so they feel like they can use it and then I also want it to be popular enough that tourists hear about it because you know when people come to visit Hawaii they're eating all of their meals mostly at restaurants which is great we have a lot of great restaurants yeah but who are they hearing about all the cool things that we have here they're hearing about it from the hotel they're hanging about for the restaurant and they're just hearing about all the tourist traps basically are they really hearing about the cool like the beach cleanups that are going on or the fundraisers or the just the events that you only know about if you live here so yeah and then the other thing is like experiencing Hawaiian culture I would love for a few Hawaiian families to use this app saying why Manila or why and I to where a tourist can actually see like how Hawaiians do it you know like a backyard barbecue eat Hawaiian food I mean that is really hard to come by I mean the Polish the Polynesian Cultural Center I feel like is the go-to for the tourists to like learn about Hawaii but how about like with a real family so it sounds like this is not only something that's going to bring neighbors together but something that could also give give tourists a glimpse of real Hawaii and something that could give locals tourist money in their pocket yes because right now a tourist money is only going to the big dogs yeah so you know similar to Airbnb I know that Airbnb has a little bit of a like negative thing going on right now I'm not sure I really try to stay out of that but Airbnb gives people an opportunity to make a little money on tourism you know for the extra bedroom that they have and same-same so yeah you can make a little side hustle having tourists over for your auntie's lasagna all right that is so powerful and I am so excited for when you finally bring the app out to to us so we can practice it and use it and get to know our neighbors yeah so are you gonna host yeah I'll do both it'll be fun yeah you're welcome yeah our pleasure and viewers this is something that is gonna make a difference in Hawaii and it was done by someone here who just wanted to make a difference had dozens of ideas but finally took action so you can make a difference but you can only make a difference if you start taking action so take action and change the world I'll see you next week bye


this afternoon. This afternoon we will, as you may already know, be launching the Fiji rugby women's campaign for three, across three competitions, namely being the Rooster Chicken Fiji Anandrua campaign, also for the ANZ Marama competition and the Royal T-Ranandi competition. You will see to my left trophies that are going to be in 30 days time. Women don't fight. Oh, yes they do. In rugby we do. But without further ado, I will ask the Honourable Prime Minister to deliver his remarks for us this afternoon. Honourable Penny Wong, the Australian Minister of Foreign Affairs, members of the Australian Government delegation, and the media, the accentees, ladies and gentlemen. I'm pleased to deliberately, before, whether you mind people calling you Penny Wong, rather than Penelope Wong. Penny is fine. Okay, thank you. I appreciate you when my mother is telling me off. I'm happy to be sharing this space with the Australian Minister of Foreign Affairs and be with you all this evening. As you know, the theme of this week's special leaders meeting here in Den Rao is reflection, renewal, and self-trend to commit ourselves to renewing in our gathering this afternoon. Playing a vital role in promoting regional cooperation and integration, addressing common challenges, and improving the lives of the people of the Pacific region. On reflection and in keeping with the meeting theme, I see rugby's remarkable treasure of two Olympic gold medals, one bronze medal, one quarter cup final at the Rugby World Cup and the IRB seven series champions, and one super women's wing, and also one Prime Minister twice. I also acknowledge the accomplishment of the Women's Rugby League team in Fiji that gains all odds, made a series of exceptional accomplishments in the last few years. Well done, girls. That is, since it was launched in 2017 by winning the Super W in its maiden season, Olympic bronze medal in 2021, and the silver in the 2022 Commonwealth Games. I know, Excellency, that I carried the Fiji flag in the Commonwealth Games in 1974, but it didn't win any medal. I'm also, I'm only keeping the flag bearing furrow. The magnitude of our women's achievements has demonstrated to everyone in Fiji, and hopefully abroad, that Fiji is national force to everyone. It is incredibly important because all we want to do is make people aware that sports can contribute to the improvement of our health, the improvement of our education systems and participation, creation of employment, stimulating economic development, realizing human rights and gender equality. These are values we hold dear here in Fiji, and we also hold very dear in Australia and everybody's gender equality. Everyone present here today understands that and it's therefore very, very important. I'd like to acknowledge the incomparable support gathering and the scores, the importance of our, and I just clarified that concept with the Honorable Minister, that Wubale is not neighborly. Wubale is one home, family. That's our people together. This is evident in the immeasurable impacts that the Pacific Australian sports is making and ensuring that Pacific and Australian athletes are not only training and playing together at the highest levels, but also forging, dizzying higher. I'm reliably informed Fiji stepped in so that other international unions were incapable of accepting the invitation. What is evident and most remarkable is that the tour was a resounding success for both. It was so important for Fiji that we brought back a soldier serving in Malaya to play. And if you look at the Fiji Rugby Union wall now and you will see a striding Fiji and rugby player. That player was brought back from Malaya to represent Fiji in that tour. It was Joe Levula, a chief from 90, the land that we stand on tonight. The Governor of Fiji is committed to seeing this partnership grow, not only as an enabler for achieving sustainable development goals, but more importantly, and as Mandela said in 2000, sports has changed the world. It has the power to inspire. It has the power to unite people in a way that little else does. It speaks to our youth in a language they understand. Sports can create hope where there was only despair and hope. Therefore, we must all continue that momentum of the kind of support that has made today possible. I'd like to acknowledge the local businesses who have stood in the gap for our women. NZ, you recognize that? Australian New Zealand Bank. CJ Patel Group of Companies. Royal C, Fun Flavor and Widbix Brands. Fiji Airways, Fiji Gas, Rooster Chicken and Tropic Boat Industries Limited. As we look forward and prepare for the enormous decade of sports in rugby ahead of us, we know that there is a significant opportunity to progress together as one Pacific wubale. The UN is keen to partner with rugby, with rugby failure, and Pacific organizations in commemorating that journey. In commemorating that journey, let us continue to reflect on the lessons and achievements that we have experienced together as a wubale. Let us also take the time to renew our commitments to that Pacific wubale. Let us recognize that our unique cultures and traditions are what binds us together today. We've come together this long, this far, and we come together again to mark and celebrate together what unites us and makes us strong. Thank you. Honorable Prime Minister, distinguished guests, ladies and gentlemen, if I may very briefly, the Pacific Ours Sports Program, administered through the Australian Government's Department of Foreign Affairs and Trade, has been instrumental in catapulting women's rugby in Fiji, particularly through the Oceania 7s in 2021, which played the platform for bronze medal-win for Fiji and the 7s at the Tokyo Olympics. The Rooster Chicken Fijianandrua 2022 successful campaign, resulting in their winning the Super W in their maiden season. Who can forget? Maybe the Waritas fans in the room. But none of us has forgotten the historic win over the Waritas 32-36. The first time the Fijianandrua were playing in the competition and they were unbeaten while the Waritas had won the previous four times and were unbeaten until they met the Fijianandrua. What was the Honorable Minister for Foreign Affairs of Australia? Well, that's quite an introduction, isn't it? These are the queue deeply for generosity in receiving me and for your leadership, not only in your election, but also bringing together this special leaders summit for the Pacific Island Forum. And I'm here in Fiji again, representing Australia. We have an enduring relation to many aspects, from sport to education, to climate, to defence and security. And that's as it should be. That's as it should be. I thank you for your words of wisdom about the meaning of Vivaldi, one home family, one home, and your expression of hope for renewal and strengthening the relationship. We share that. I hope to building on our shared priorities. One of those, obviously, is climate. And I did want to take the opportunity to have the first announcement in relation to that strengthening and renewal, which is an additional $10 million from Australia to help rebuild schools in Fiji's northern division that were devastated by the tropical cyclones in 2020 and 2021. This is additional funding on top of an existing program, which will enable us to rebuild all nine destroyed or damaged, but most importantly, not just rebuild them, but rebuild them to a higher standard. So they are category five. And importantly for Fiji that we use local sources, local cloak with you. But of course, the big news today is the launch of the 2023 Fiji women's rugby season. And it's a happy event, isn't it? It's a happy event. It's a wonderful, it's a real privilege to be here and we're very pleased to support some of this through Pacific Gold Sports, although I did say to my staff as we're driving here, so let me get this clear. The Prime Minister spoke much more eloquently than I could about what sport means, the way it brings people together. From all walks of life, and you know that if you go to big sporting events, there are more people from different parts of the community than at any other event you go to accept possibly, you know, meetings of faith. And it's a wonderful thing. And if I may, on the participation of women, which is really the trajectory of popularity and engagement has been fantastic, so congratulations. Australia wants to support the full participation of women in society because we believe the community benefits from that. So yes, I believe in gender equality, we would talk about that, but it is actually about a stronger community. It's a stronger community if you get the benefit of all of the skills and talents of your society, and that means the full participation of women and girls. And one of the ways in which you do that is through sport. It's empowering and it demonstrates that participation. So I'm very, very grateful for the opportunity of being here, and I wish you luck, but not too much luck. Finally, if I may just mention a couple of things about the Pacific Island Forum Special Leaders Meeting, I want to again acknowledge that Prime Minister Rambook is leadership as chair, and I look forward to working of course with the Cook Islands as well when they assume the forum chair. I want to again place on public record our deep appreciation of Prime Minister Rambook, all leaders including President Maumau and the Micronesian President Summit in demonstrating leadership at a time which I think it was important, and to say again how a strong and united Pacific Islands Forum we believe is in all of our interests. And we thank you for your part in that. So thank you very much for the opportunity to be with you today. Thank you. Thank you very honorable Prime Minister and honorable Minister. We will have an opportunity to ask questions now. I can see members of the media already looking in my direction. We will limit, but if we could start with the questions now. Thank you. No questions? All right. You must. Hey. Really? Thank you. No, we'll move on to our next event. They're more interested in the rugby. That's the reality isn't it? That's good. We'll move to present the honorable Prime Minister with our gift before he presents it to the audience.


I'm not even going to say anything, and Hunter is going to come in and give me a squeeze and we're going. Alright, if I'm like this, you got it. That means, hey, I'm body blocking for you guys, keep going. The rooms, keep it like about four people, but just conduct it back there. Which all that is, is re-clearing the space and re-confirm.   He's going to check, you go inside there, you own that. That's the one hand in there. Get that door, get that one. Offset, go offset, offset, there you go. And then, what you're calling yours is...


Hello everyone, in this video we are going to introduce our next abstract data type and this is one that unlike the stack you've probably encountered in your natural life. And also is just super critical in computing applications, shows up absolutely everywhere and at least is pretty easy to understand I think. And that is the concept of the queue and a queue is an abstract data type where addition happens at one end, so we're going to have a collection of items once again. Addition is going to happen at one end and we remove from the other end. So it's a line, right? It's a line at Burger King and McDonald's at the bank at the DMV wherever you are, right? It's a queue. It's a line. And things in the queue, items that we put in the queue get serviced in the order they were placed in it, right? We call that first in, first out behavior, FIFO. The first thing into the queue is the first thing out. That's a fair queue, right? Compare that to the stack. Everything happened at one end of the stack called the top. That was last in. The first thing you put in is the last thing that goes out. The queue is opposite of that, right? We all know what queues are. We all know what they are. And it turns out they solve a whole bunch of problems in computing. And kind of the purpose of the queue is fairness, right? We want to process things in the order they were received. First come, first serve, right? So the printer queue, right? If you print a whole bunch of stuff at once or a bunch of different documents in a row from your computer, they come out in the order that the printer received them. The printer has a queue of things that it does. Keystrokes, right? It actually takes some time for your computer to process every keystroke. And usually it processes them instantaneously and you don't even notice it. But you have all encountered cases where you're like typing and then something lags your computer. It's doing some heavy crunching.  And then all of a sudden a whole bunch of keys appear in a row, right? Well, luckily for you, the computer, the operating system is putting those keystrokes in a queue. Otherwise, they would just kind of get all jumbled together, right? And the other big place where you encounter queues are in network applications. So your router, for example, and the router at your institution, wherever you are, the network traffic that comes in and that goes out is being processed through a queue, right? And it's got to go, you know, the router has to determine whenever, let's say you're on campus and there's 10,000 people hooked up to the network and they're all watching you too. That data is streaming in over the internet and through a router. The router has to determine which computer on its network, you, your buddies, the person on the other side of your buddy, whose data goes to who. Well, it determines that through a queue. The data comes in and it very quickly snaps it out and puts it along, but it does take a couple seconds. You know, it takes some amount of time for it to figure out where it goes. It processes the data in the order it was received, okay? So queues, they're kind of natural, they're useful in a lot of application. Queues are queue data, right? A queue is a collection of items and we typically store those items in a list. So in your next homework assignment, you are going to be implementing a queue data type and under the hood, the data structure will be an array-based list. Queues are very simple in the behavior that they expose. You're going to have a constructor. You're going to have an enqueue, enqueue an item, put it at the back of the queue, and a dequeue item, pull the thing off the front, add to the rear, pull off the front. That's it. You are not operating anywhere in the middle, right? Queues are not concerned with the middle of them. Just whoever is at the front of the line and then we add people to the back. That's it. Okay? Also be able to ask, is our queue empty and how many items are in it? All right. So let's go over to our worksheet. I'm going to switch over to my whiteboard and we're talking about this right here, the queue handout. So pull this up, we're going to work through it just to make sure that we understand conceptually how queues work. Conceptually they're not too bad. They make mostly perfect sense, I think, but let's walk through the examples here. All right.  So step one, we have queue gets the queue constructor. So that's just saying make for me an empty queue, okay? Nothing there. Nothing yet. All right? Nothing. I know. On to step two, we are going to end queue the number 45, this is step two. Now conceptually here, queues can hold whatever, right? Any element. I'm just happening to put numbers in this one for whatever reason. It could be people, it could be bank account objects, it could be whatever, okay? So when I end queue something in the list, okay, I'm just going to write down what's in there. Now a queue, the queue has the notion of a front and a back, right? So right now the front, the person at the front, the item at the front of the queue is the number 45 and the item at the rear is also the number 45, right? So when we talk about queues and we're visualizing queues, know where the front is and know where the rear is, all right? That'll distinguish it from when you're visualizing, say, a stack because a stack only knows where the top is. All right. Step three, end queue the number 10. So when we add the number 10 to our queue, we get rid of, we're going to say that 10 is coming after 45 and now the rear is pointing to 10, okay? So 45 is the front, 10 is the rear and actually, you know, the queue doesn't care like how these things are stored or where they are necessarily and the user of the queue doesn't care. It's just who's the front and where's the rear, that's all, all right? Number four, end queue 9999, okay? So I'll draw it down here and it doesn't matter but there is an ordering, okay? Then we've got to update where the rear is. I always end queue at the rear of the queue, end queue happens at the rear, okay? Now we need to dequeue, step four, we're going to dequeue here, all right? Dequeuing removes and returns the item at the front of the queue, well, who's the front of the queue? Well, conceptually, the front of the queue is 45, okay? So dequeuing, we're on, oh, I'm sorry, we're on step five now, dequeuing, we are going to remove 45, right? And return it, so I'll kind of say 45, you know, with a little arrow that's going to be my sign that I'm returning it and I need to remove them, okay? Well, when I remove 45, who becomes the front of the queue? That's the question, right? Well, the front of the queue, queue's behavior says the next person, the next one that was added after 45 is going to be processed next. First come, first serve, we process them in the order they were receiving. So 45 goes away and the front of the queue is now 10, okay? All right, let's dequeue again. If we dequeue, again, step six, okay, we're on to step six now, who do we dequeue?  So we're going to remove and return 10, so 10 is gone out of our queue and now we're back to a case where we only have one item in the queue and that's 9999, okay? All right, so finally, we, step seven, we enqueue again. Step seven, we are going to enqueue the number six, where do we enqueue? We enqueue by adding to the queue after the current rear of the queue. The current rear of the queue, there's only one item. The front and the rear are the same thing. So just, you know, think about a line, first come, first serve, number six is going to get in line behind 9999 and then we update the rear to point to six, okay? So that's it for a queue, conceptually, very simple, right? No big deal. You are going to have to implement a queue in code. As I mentioned, I'm not going to switch over to code right now, but as I mentioned, you are going to use the list, the array-based list, as the data structure for a queue, okay? Because list is general purpose, you can put things in, add things, remove things, you can do all sorts of wonderful things with a list. But for the user of your queue, they don't care about all those other things. The queue only cares about enqueuing and dequeuing and how big it is. That's it, okay? So we're going to hide the list and use it as a data structure. Now, when we think of lists or array-based lists in particular, you know, you usually think of them like this, it's a contiguous block of stuff. And these are the indices, right? The array indices, list indices, indexes indices. And then you've got data in here. What data do you have, you know, doesn't matter, right? It doesn't really matter. But let's, I'm going to put, I'm just putting some letters in here as my data, okay? Now, we want to model or implement a queue using Python's array-based list as the data structure. We have to make a fundamental decision at this point. We have to decide, if we're going to use this list, what is going to represent the front of the queue and what is going to represent the rear of the queue, because I need to know those things in order to enqueue and dequeue properly, okay? I'm going to remove the item from the front when I dequeue and I'm going to add items or append items to the end whenever I enqueue.   It's up to you, you have to figure out. Your goal in computing is to be the most efficient, right? So, is there one, which one of these, the beginning of the list, index zero or index negative one, that is going to give me better efficiency for enqueue and dequeue? Well, let's think about it for a second, right? Let's say I want to use, I'm going to take these indices away just to give me some more writing room. Let's say I choose the front of the queue to be index zero, right? And the rear to be down here, right? And that kind of makes sense, right? Maybe your first instinct to do it that way. Okay, so I dequeue, let's talk about enqueue first. If I'm enqueuing and this is my queue, okay, this is the data structure that holds my queue, it's a list, it's a Python list, this is the data structure inside my queue, okay? I have a queue class, this is going to be my data inside of it. Where do I, when I call enqueue, I want to put things at the rear of the list, okay? How do I add things to the rear of a list? Well, if the rear is down here, I can call list dot, how do I add something to the end of a list? I call list dot append. Apologize for my handwriting because it's hard to write on this white board, it's not very stable. Anyway, list dot append, we'll put data here. We like list dot append because what is its big O? Well, we talked about this a couple of times, the big O of list dot append is big O of 1. That's good, that's as good as we're going to get. But now I need to dequeue, when I dequeue, right, I need to dequeue from the front. The front is up here. How can I remove items from the front of a Python list, of an array-based list? Well, there's basically two ways, but the one I want to use is I need to pop. Remember, there's a pop method and I want to call pop zero. Popping zero says take the item at index zero in front of the queue, in front of the queue should be index zero, remove it and return it. If you go back to our discussion, though, on pop, what does popping do? Well, an array-based list needs to be a contiguous block, so there can't be any gaps here. So when you pop this guy out, when you remove him, what's going to happen? All these guys will shift down a slot. And as we talked about in the array-based list lecture, that's expensive. We've got to shift all of these guys. So popping zero is a big O of n operation. Okay, so my dequeue is big O of n and my nqueue is big O of 1. That's not great. I mean, it's okay. Big O of n isn't terrible, but big O of 1 is way better. Okay, so could we do better? Could we do better if we treated beginning, and I'll write it down here, if we treat index zero in our list as the rear and index n minus 1 or minus 1 as the front? Would it get better if we did that? Okay, well, our problem with dequeuing, remember we dequeue from the front always. We have to dequeue from the front. And in fact, why don't I, I'll just make it obvious. You have to, when you dequeue, you dequeue from the front. When you nqueue, you nqueue at the rear. Okay, so my problem before was my dequeue was big O of n. Okay, all right, well, now I can actually dequeue in big O of 1 time. How do I do it? Well, Python lists have this pop method, just plain old pop, right? Plain old pop, no argument given. When you plain old pop, you're removing from the end of the list, removing and returning the last item at the end of the list. And go back to our array-based list discussion. Popping from the end of the list is big O of 1. You use some math to find the last item in the list because you know how big the internal elements of a list are and you know how long the list is. You jump immediately to the end of the list using some arithmetic and you remove and return the item. Easy, right, easy for the computer anyway. But now I'm nqueuing. I nqueue at the rear. Conceptually, that's easy. But in my data structure, the rear of the list is index zero. Well, how do I put an item into a list, a Python list at index zero? My method for that is insert, right? There's an insert method on Python. Let me say list.list.insert, try and emphasize the fact that I'm using list methods here. And I'm sorry that my whiteboard is getting out of control. If I do list.insert at index zero, like again, list.insert, that's something Python knows how to do, the value, that will put it here, but then what's got to happen? Well, anything that was already here in these spots, what's got to happen to them, they got to shift down. You got to move you here, you here, you here, you here, and then my new value, whatever that is, is going to go into the first slot, okay? The shifting, once again, I've got to move every item. I've got to copy it. That makes this big O of n, okay? So, not an ideal scenario. Let me switch back to my slides here real quick. Great. So, whenever you are using a Python array-based list, you cannot get both nq and dq to be big O of 1. Unlike the stack, remember the stack, we could push in, we could pop in big O of 1 time, that use a Python array-based list, and that is important. Because we are using an array-based list, one of these guys, either nq or dq, must be big O of n. Now, that's actually a problem. If you think about a queue that might exist on a router, for example, that's processing millions or billions even of packets per second, trillions potentially, packets per second, it can't be slow. No operation can be slow there. So, a array-based list is maybe not appropriate for certain applications there, okay? That's a limit of the data structure that we are using. Now, in your next assignment, you're going to make queues and stacks and another ADT. After that, our next assignment, you're going to make a new data structure. It's going to be called a linked list and it's going to overcome this problem. It will have some downsides to it, but you will be able to make a queue using a linked list, a different data structure where both nq and dq is a big O of 1 operation. And that's a good thing. All right, so we will talk about one more abstract data type in the next video and then we'll send you off to code these things.