1 00:00:00,25 --> 00:00:07,305 [MUSIC]. 2 00:00:07,305 --> 00:00:10,11 So, at this point in the class, we've introduced you to CodeSkulptor, and we've 3 00:00:10,11 --> 00:00:13,580 shown you a little bit of Python. However, we haven't shown you how to save 4 00:00:13,580 --> 00:00:15,571 anything. So, if every time you go back to 5 00:00:15,571 --> 00:00:18,653 CodeSkulptor, you have to retype in your work, that's going to get really tedious, 6 00:00:18,653 --> 00:00:21,441 really fast. So, today, we're going to talk about 7 00:00:21,441 --> 00:00:24,346 saving things and how to get them back into CodeSkulptor. 8 00:00:26,120 --> 00:00:27,930 Okay. Let's head over to CodeSkulptor. 9 00:00:27,930 --> 00:00:30,367 Here we are. And for the purposes of today, I don't 10 00:00:30,367 --> 00:00:34,90 want to use the example program. Instead I just want to type my own. 11 00:00:34,90 --> 00:00:40,79 [SOUND] It's my first program. Print, hello. 12 00:00:40,79 --> 00:00:43,77 Right? I've got this fantastic program. 13 00:00:43,77 --> 00:00:45,570 I run it. Does what I expect. 14 00:00:45,570 --> 00:00:47,592 Now I want to save it because I'm happy with it. 15 00:00:47,592 --> 00:00:50,84 Well, how do I do that? You can see up here in the control par-, 16 00:00:50,84 --> 00:00:53,630 part of the application that there is an icon with a disk. 17 00:00:53,630 --> 00:00:57,70 And that is the Save button. I pushed it. 18 00:00:57,70 --> 00:01:00,290 Looks like nothing happened. Well, actually, something did happen. 19 00:01:00,290 --> 00:01:02,904 The address in the address bar is changed. 20 00:01:02,904 --> 00:01:06,616 And if you look up here, you can see that now at the end of the URL, is this 21 00:01:06,616 --> 00:01:11,890 hashtag and its filename. This filename was randomly generated for 22 00:01:11,890 --> 00:01:14,836 you. This now names your file in the Cloud. 23 00:01:14,836 --> 00:01:18,709 When you push the Save button, your file is sent off to the Cloud. 24 00:01:18,709 --> 00:01:22,485 A new randomly generated filename is, is created for you, and it is part of the 25 00:01:22,485 --> 00:01:25,686 URL. So, this URL will now, and until the end 26 00:01:25,686 --> 00:01:28,843 of the class, name your file. Okay? 27 00:01:28,843 --> 00:01:32,540 So what does that mean? It means I can copy this URL. 28 00:01:32,540 --> 00:01:35,330 I can create a new tab. I can paste it. 29 00:01:35,330 --> 00:01:38,168 Let's load this. And, hey, we got our program back. 30 00:01:38,168 --> 00:01:40,662 Okay? So, if I lose my program, say, we go back 31 00:01:40,662 --> 00:01:43,954 to CodeSkulptor it's gone. All right. 32 00:01:43,954 --> 00:01:47,660 Well, it's not really gone, okay? I can paste this back. 33 00:01:47,660 --> 00:01:51,340 However, that filename was randomly generated. 34 00:01:51,340 --> 00:01:54,850 We don't know what it is. So, only you know what it is. 35 00:01:54,850 --> 00:01:58,200 You need to keep track of it. If you lose it, it's gone. 36 00:01:58,200 --> 00:02:00,492 All right? So, how can I keep track of it? 37 00:02:00,492 --> 00:02:02,360 Well, there are several ways. Okay. 38 00:02:02,360 --> 00:02:05,880 One, you could bookmark it. Two, you could look in the history of 39 00:02:05,880 --> 00:02:09,179 your browser. Three, you could copy it and save it into 40 00:02:09,179 --> 00:02:13,360 a file on your computer. Four, you could email it to yourself. 41 00:02:13,360 --> 00:02:15,408 And I'm sure there are many other ways that you could come up with to keep track 42 00:02:15,408 --> 00:02:17,171 of your filenames. All right? 43 00:02:17,171 --> 00:02:20,801 So, you should do whatever you find most comfortable but you absolutely need to 44 00:02:20,801 --> 00:02:23,106 save these filenames. Okay? 45 00:02:23,106 --> 00:02:27,572 And I'm going to show you on Chrome, there's this little star button over 46 00:02:27,572 --> 00:02:30,919 here. I can push that and it will put a 47 00:02:30,919 --> 00:02:34,258 bookmark. So, I'm going to call it hello program. 48 00:02:34,258 --> 00:02:36,810 I'm going to put it in the bookmarks bar, say done. 49 00:02:36,810 --> 00:02:39,60 And here it the/g, here it is. It shows up on the bookmarks bar. 50 00:02:39,60 --> 00:02:41,985 If you don't have a bookmarks bar, you should go through the menus, I'm sure you 51 00:02:41,985 --> 00:02:43,830 can find it. Okay? 52 00:02:43,830 --> 00:02:46,752 And when I push this and it doesn't matter where I am. 53 00:02:46,752 --> 00:02:49,714 Let's open up a new tab. I push this and all of a sudden my 54 00:02:49,714 --> 00:02:51,783 program comes back. Okay? 55 00:02:51,783 --> 00:02:55,111 So, it is critically important that you keep track of these URL's, so that you 56 00:02:55,111 --> 00:02:58,294 can get your files back. I don't want to go through all the 57 00:02:58,294 --> 00:03:00,790 possible ways that you can manage your bookmarks. 58 00:03:00,790 --> 00:03:03,328 You can use Google to find out about that. 59 00:03:03,328 --> 00:03:05,624 All right? But make sure that you do so. 60 00:03:06,890 --> 00:03:08,754 Okay. So, you've written your very important 61 00:03:08,754 --> 00:03:12,680 program and you've saved it to the Cloud and we push the, the Save button. 62 00:03:12,680 --> 00:03:17,236 We are very comfortable that our file has been saved but to be really cautious, we 63 00:03:17,236 --> 00:03:21,730 should download it to our local computer as well. 64 00:03:21,730 --> 00:03:25,560 You really want a copy for yourself, not just relying on the Cloud. 65 00:03:25,560 --> 00:03:27,817 Okay? You could lose the URL, you could lose 66 00:03:27,817 --> 00:03:30,969 something else. And downloading, okay, by pushing 67 00:03:30,969 --> 00:03:35,109 Download button right here, gets the file that you most recently saved to the Cloud 68 00:03:35,109 --> 00:03:39,144 and it brings it back to your local computer. 69 00:03:39,144 --> 00:03:40,839 Okay. So, this button is only going to be 70 00:03:40,839 --> 00:03:43,608 active right after you hit the Save button. 71 00:03:43,608 --> 00:03:46,598 Now, your web browser recognizes that this is a Python program, and so it gives 72 00:03:46,598 --> 00:03:50,444 you a warning, Hey, this program could run and harm your computer. 73 00:03:50,444 --> 00:03:53,836 Well, it's a program that you wrote, it's not going to harm your computer, so you 74 00:03:53,836 --> 00:03:56,968 can ignore this and keep it. All right? 75 00:03:56,968 --> 00:03:59,967 We've now downloaded our program. Okay. 76 00:03:59,967 --> 00:04:04,620 We can actually open the Downloads folder and here we go. 77 00:04:04,620 --> 00:04:08,410 You can see that I have two files that I've downloaded in the past. 78 00:04:08,410 --> 00:04:10,389 All right? And I can actually open them and you can 79 00:04:10,389 --> 00:04:13,290 look at it in Notepad and here is my program. 80 00:04:13,290 --> 00:04:17,692 So, now I have some extra security. And we strongly recommend that after you 81 00:04:17,692 --> 00:04:21,346 get a working program or after you're done working in a particular session, 82 00:04:21,346 --> 00:04:26,949 that you both bookmark the file and you download it to your local machine. 83 00:04:28,670 --> 00:04:32,20 Now, saving your files is only useful if you can actually get them back. 84 00:04:32,20 --> 00:04:35,452 So, if you copy the URL, either into your own file or just copied it, you can paste 85 00:04:35,452 --> 00:04:39,200 it back into the address bar and get your file back. 86 00:04:39,200 --> 00:04:44,30 If you bookmarked your URL, then you can get it back, by using the bookmarks. 87 00:04:44,30 --> 00:04:46,80 Okay? If you forgot to bookmark, you can 88 00:04:46,80 --> 00:04:49,640 actually use your History in Chrome. That's Ctrl+H. 89 00:04:49,640 --> 00:04:53,50 And you can see all these exciting Codes-, CodeSkulptor files I've worked 90 00:04:53,50 --> 00:04:54,223 on. Right. 91 00:04:54,223 --> 00:04:56,159 You push this. You can get something back. 92 00:04:56,159 --> 00:04:58,850 hey that's not the one I wanted. I can keep searching. 93 00:04:58,850 --> 00:05:00,775 Hey, here's another one okay. Okay. 94 00:05:00,775 --> 00:05:04,285 And you can probably find pretty much everything you've done in your History, 95 00:05:04,285 --> 00:05:07,742 all right? Now, what if I downloaded the file 96 00:05:07,742 --> 00:05:10,714 locally? Okay, so here I am at CodeSkulptor, and I 97 00:05:10,714 --> 00:05:14,420 had previously downloaded my file. That's where this Open Local button 98 00:05:14,420 --> 00:05:16,942 comes. If I use the open button, I can navigate 99 00:05:16,942 --> 00:05:21,590 through my hard drive. I can find the file that I care about. 100 00:05:21,590 --> 00:05:25,850 And I can open it, and here it is. Okay? 101 00:05:25,850 --> 00:05:29,216 So, you can use one of these mechanisms to retrieve the files that you've saved, 102 00:05:29,216 --> 00:05:32,572 depending on how you decided to actually save it. 103 00:05:32,572 --> 00:05:36,407 Now, it's never going to be the case that you type your program in one shot, you're 104 00:05:36,407 --> 00:05:40,20 done, you save it, and you submit it, okay? 105 00:05:40,20 --> 00:05:44,108 Programming is an incremental process. So, here I wrote my program, I said, 106 00:05:44,108 --> 00:05:47,35 print hello. I said, oh wait, I was trying to write, 107 00:05:47,35 --> 00:05:48,835 hello world. Okay. 108 00:05:48,835 --> 00:05:52,955 I'm on, hey much better. I Save that. 109 00:05:52,955 --> 00:05:56,289 wait a minute. I like exclamation points. 110 00:05:56,289 --> 00:05:59,962 There's not enough of them. All right, let's Save that. 111 00:05:59,962 --> 00:06:01,754 Oh, wait. Let me run that again. 112 00:06:01,754 --> 00:06:04,859 No, that's not really what I wanted. I wanted this. 113 00:06:06,240 --> 00:06:08,320 Okay? And you keep going,okay? 114 00:06:08,320 --> 00:06:11,340 Eventually, you get to something that you're happy with. 115 00:06:11,340 --> 00:06:13,130 You say, okay, this is the program I want. 116 00:06:13,130 --> 00:06:15,350 You go off and submit it or whatever, okay? 117 00:06:15,350 --> 00:06:19,315 I want you to notice, though, while you're doing that, if you keep saving, 118 00:06:19,315 --> 00:06:23,215 that the name of your file basically stays the same, except this version 119 00:06:23,215 --> 00:06:28,520 number at the end, increments. It started out at zero, then it went to 120 00:06:28,520 --> 00:06:31,810 one, two, three, four, and this is somewhat convenient. 121 00:06:31,810 --> 00:06:34,476 You can actually go back in time while you're working in a session, you keep 122 00:06:34,476 --> 00:06:37,381 saving. You say, oh, I screwed up and I overwrote 123 00:06:37,381 --> 00:06:40,303 things. You can just, even if you didn't bookmark 124 00:06:40,303 --> 00:06:44,73 them, you can change that number and say, oh, I really meant to use that program 125 00:06:44,73 --> 00:06:47,852 one back. And hey, it goes back to my program with 126 00:06:47,852 --> 00:06:51,347 all the exclamation points. Okay, so the version number you might 127 00:06:51,347 --> 00:06:54,47 find that relatively convenient way of going back in time and looking at 128 00:06:54,47 --> 00:06:57,570 previous versions while you've been sitting there working. 129 00:06:57,570 --> 00:07:02,480 Okay, as you can see, I've been working hard on my hello world program here. 130 00:07:02,480 --> 00:07:05,835 And I finally got it the way I want it and I'm ready to submit it to Coursera, 131 00:07:05,835 --> 00:07:09,465 to send it to all my friends and family, and basically show off my, that coolness 132 00:07:09,465 --> 00:07:14,850 of all of my work, all right? You can just use the URL that you have 133 00:07:14,850 --> 00:07:19,71 here and that's perfectly fine. But you'll notice hey, this is the lucky 134 00:07:19,71 --> 00:07:22,431 number 13 version of my, my file and maybe I don't want people to be able to 135 00:07:22,431 --> 00:07:28,320 look back through the history, and see what happened in version number 6, okay? 136 00:07:28,320 --> 00:07:31,660 So, we added a little suitcase button. When you push the suitcase button, it 137 00:07:31,660 --> 00:07:35,128 generates a new filename for you. So, it does everything that the save 138 00:07:35,128 --> 00:07:38,26 button does, it just doesn't have a version number. 139 00:07:38,26 --> 00:07:40,672 Now, if you'd like, you can use this to submit to Coursera, you can use this to 140 00:07:40,672 --> 00:07:44,360 send to your friends and family and they can't see all the versions. 141 00:07:44,360 --> 00:07:47,100 There's nothing wrong with the version numbers, this is just your choice. 142 00:07:47,100 --> 00:07:50,38 There's one final thing I want to call you attention to. 143 00:07:50,38 --> 00:07:53,29 And that is the prefix of the filename right here, okay? 144 00:07:53,29 --> 00:07:56,431 Now, you can see that it's user1 here, but if you go to CodeSkulptor right now 145 00:07:56,431 --> 00:08:00,510 and save, I guarantee you that it's not going to be user1. 146 00:08:00,510 --> 00:08:03,570 So, you guys are going to generate hundreds of thousands of files a week and 147 00:08:03,570 --> 00:08:07,441 this prefix helps us keep those files manageable, all right? 148 00:08:07,441 --> 00:08:11,534 So, we change this every once in a while. We will change it in time, at times that 149 00:08:11,534 --> 00:08:15,570 are not so disruptive, but do be aware that that could change, okay? 150 00:08:15,570 --> 00:08:19,332 And if it changes your version numbers will just keep incrementing. 151 00:08:19,332 --> 00:08:23,957 So, you, here I have User 1, Version 3. If I hit Save and we had changed that to 152 00:08:23,957 --> 00:08:27,180 User 2, it would go to User 2 Version 4, okay? 153 00:08:27,180 --> 00:08:29,618 Another thing I want to call your attention to is the dashes in the 154 00:08:29,618 --> 00:08:32,318 filename. They might be dashes, they might 155 00:08:32,318 --> 00:08:35,398 underbars, okay. Don't worry about that, that's not a big 156 00:08:35,398 --> 00:08:37,512 deal. So, we've now shown you that using 157 00:08:37,512 --> 00:08:40,776 CodeSkulptor, you can save your files to the cloud, and then you can download them 158 00:08:40,776 --> 00:08:44,861 back to your local hard drive. You need to do this early and often, 159 00:08:44,861 --> 00:08:47,413 okay? As you're working, make sure that you 160 00:08:47,413 --> 00:08:50,214 save, all right? And when you're done working, either 161 00:08:50,214 --> 00:08:53,30 because you finished your program or you're tired of working at the computer 162 00:08:53,30 --> 00:08:55,758 for now and you're going to walk away, make sure at that point you bookmark and 163 00:08:55,758 --> 00:08:59,390 you download the file to your local computer. 164 00:08:59,390 --> 00:09:02,44 This will make sure that you can always get it back. 165 00:09:02,44 --> 00:09:05,210 Remember, we cannot recover those URLs for you. 166 00:09:05,210 --> 00:09:09,53 If you lose the URL, we don't know it's yours, we can't find it, we can't get it 167 00:09:09,53 --> 00:09:12,876 back. If you keep the URL, however, you can get 168 00:09:12,876 --> 00:09:15,573 it back. And you can use that URL to submit it to 169 00:09:15,573 --> 00:09:18,112 Coursera. You can use that URL to send to your 170 00:09:18,112 --> 00:09:20,526 friends. Marvel at the wonderful work that you've 171 00:09:20,526 --> 00:09:23,232 been doing in this class and generally enjoy yourself. 172 00:09:23,232 --> 00:09:25,447 Okay? We promise that we will save all these 173 00:09:25,447 --> 00:09:28,540 files in the Cloud throughout the class. All right? 174 00:09:28,540 --> 00:09:31,520 But it's your responsibility to track the URL's. 175 00:09:31,520 --> 00:09:35,573 With that, I hope you have a lot of fun in this class.