Placeholder Image

字幕表 動画を再生する

  • All right.

  • Hello, world.

  • This is CS 50 on Twitch.

  • My name is Colton Ogden.

  • I'm today joined by these nice and, uh outside.

  • What are we?

  • What are we talking about today?

  • So Colton's invited me here today to talk about a city sandbox, which is one of the city's Web based applications.

  • And it compliments what's known a CS 50 i d e.

  • With which many folks are probably familiar, which is a more feature full Web based I.

  • D or integrated development environment.

  • Nice.

  • And I mean traditionally in the past, from my memory, we had to do things like install VM where even before that we have seen 50 appliance.

  • Yeah, back in the day.

  • So really, back in the day when I first started teaching CS 50 and even took CS 50 many years ago, we would all have user names and passwords on one of Harvard's own central servers, and they serve a rain, UNIX or clinics or some similar operating systems.

  • And even before wait 20 years ago and what everyone would do in the class is connected via telnet, which is really old school program or protocol or more recently, by sshh secure, shelled by encryption to Harvard Server, where everyone had a home directory like a folder where they could put files and they had access to compilers like GCC, your clang and G B and other such tools.

  • But fast forward to more recent years.

  • We actually moved off of that environment to a virtual machine, as you say, using BM wear or parallels or other software where students started running on their own Macs or PCs.

  • Ah, virtual machine.

  • So their own copy of Lennox and we called it the CS of the appliance.

  • That was a bit heavy weights.

  • And frankly, it was a bit knowing to support for students because if they change their operating system or upgraded something, the thing would often break.

  • And so we eventually transition to a cloud based, integrated development environment, thanks to our friends at Cloud nine now and Amazon.

  • But that is a complete I D with the bugger built in and persistence and any number of other feet.

  • Cher's and so it seems that the sandbox, which will look at today, do as well as a a counterpart tool.

  • It's really about quick and dirty programming environments when you just want a demo, Something you want to just try out an idea.

  • You don't wanna have to organize your files and save things and use your your day to day environment.

  • You could just spawned one up and throw it away after.

  • And the beautiful thing, too.

  • And I think one of the original sort of motivations for the appliance is that everybody's in a consistent environment that set up the same way.

  • Indeed, this has been very important because it's just no fun, especially for new programmers to figure out.

  • Why is my Mac not working?

  • Why is my PC not working like the instructors is?

  • And so we instead try to just normalize everyone's environment by using these days of a browser alone.

  • Awesome.

  • Um, City were actually also for the very first time, looking at all three platforms extreme, too extreme to twitch normally.

  • And we've been looking at Twitter chat exclusively until now.

  • But we're also looking at YouTube and Facebook chat today, so if you wantto toss questions in both of those chats, will try and pluck them off.

  • Definitely jar attention to them if we miss them, but I say we wait, cut straight to your computer here and we can talk about what the sandbox and start by way of a demo.

  • Let's do that.

  • So everyone's welcome to play along at home.

  • In fact, we can type into the chat here sandbox dot CS 50 dot io Sandbox is also a term of art.

  • You might have grown up with one outside, like, literally a box of sand that you can play in and build things in a sandbox.

  • And computer science is typically some kind of environment where you can only do certain things and you are sandbox from that is protected from other users, and that's in the education system.

  • The sandbox programming environment that you can spawn and create for yourself is just for you, and you have administrative or root privileges you install.

  • Software removes offer, but it's just your own until we then throw it away Eventually.

  • No one else theoretically can access that unless you proactively allow them to do so.

  • So it's a nice, secure environment in theory for programs, I said this is great because it's just right in the Web browser eye on any computer, a chromebook, even something with minimal resources.

  • could go in here and using someone else's server online, tap into some pre configured programming and back.

  • Exactly.

  • And we have a support now for Bunches of languages, and the very first thing to do is to go to that your l sandbox dot CS 50.

  • Don't I owe you?

  • May ultimately be prompted the log in via get, huh?

  • But most everyone on this stream probably has a get hub dot com account.

  • If you don't sign up for one for free at get hub dot com, we could pay set in his wealth.

  • And that account just allows you to use the same tool, even though it itself doesn't use Get up.

  • We do use their authentication mechanism simply to ensure that we know whose sandbox belongs to who.

  • So here we have the main menu, and there's really very few questions asked of you initially.

  • Let me go ahead and just click on these environments, and you can actually see the languages and the tools that are available in the system.

  • So most any language you could think of these days can you program in and CS 50 sandbox Well, you see and python html Java script and so forth Sequel Light.

  • But there's other languages as well.

  • And if there's something you'd like to use and you don't see on this list, just email us insisted Men start CS 50.

  • Sorry, Assistant mints, AK, CS 50 The Harvard Review And we're happy to figure out if we can install it for you as well.

  • And you were even telling me.

  • I mean, we update this pretty consistently.

  • We just recently added a couple new environments in three.

  • Hot off the press as of this morning is now support for Erlanger.

  • Go Haskell and Pro Law by request of one of our friends are in Amsterdam.

  • Who's University uses those languages in their courses as well.

  • I'm gonna keep bugging you, but no closer.

  • No, but I only asked me for closure support about an hour.

  • So So when you get here on the main menu, the default tab is called Create Sandbox because presumably that's the default behavior that you want, and we pre check what we presume are the most common options in this Web programming environment.

  • You probably want a terminal window, and in fact you have to have a terminal window do anything useful with it, and we presume that you also want a text editor with tabs you can actually create or innit files.

  • What's this thing called an ex window?

  • Yes.

  • On Linux or UNIX based systems, you can have a graphical user interfaces or gu Ys, even though you might be more familiar nowadays, with a command line interface to those systems.

  • X Windows is the software that you can run on such an operating system in order to add graphical support.

  • Essentially a piece of server software that just sits there waiting and listening for clients to connect to it, so is to display their interfaces.

  • We can mimic this in the browser.

  • It's a little slow, and it's good, really, for very slowly interactive programs, buttons and menus, but not for animation.

  • Not really for games, because you have an entire Internet between you and the servers that are running this environment, you're making network requests.

  • It makes it.

  • Send your coat over, and then they have to send you back.

  • Sort of the visual changes.

  • Take it up with a lot of bits.

  • Yeah, um, it looks like we're the cattlemen's asking.

  • So is this free and better than Cloud9.

  • It is free and different from Cloud nine.

  • I would say it is a subset of the features that Cloud nine and Interns is with.

  • The idea provides, that is, by design.

  • Among our goals was to create an alternative to CS 50 idea that students wouldn't use day today for their problem sets.

  • But instead, if they want to just try out an idea, they want to do a demonstration.

  • They want to share their code in an interactive way with someone else and in the case here on campus at Harvard and Yale and elsewhere.

  • We wanted to make it easier for our teaching fellows or teaching assistants who helped me and pulled him with the course to be able to just quickly do demonstrations in class and do it in a uniform environment.

  • If you use CS 50 I D.

  • Or any idea you're probably used to creating projects and folders, you probably want to keep them organized in the file, browser and such, and that's fine.

  • But that's a lot for new programmers.

  • We really want to get the tool out of the way and enable students to focus on the code and the compiler and eventually the bugger.

  • But here we have really the first of those two, and I mean, we've been used this on stream a couple times where we want to just really fast get someone's code and just tweak it a little bit or test something out.

  • Just yesterday in the code reviews, they have asked this way for me to pull up a programming environment, Mistress, do you see in the sandbox?

  • And a couple people, by the way, are saying that they're impressed with hair dressing up.

  • So have ignite says that you dress up like a real professional, for sure.

  • But it's really just a coincidence, because lately in the mornings have been teaching a course at Harvard Business School, which is for the MBA students there for Rich.

  • I dress up a little more fancy, take the fun out of it.

  • I mean, I dressed up just recalled, All right, why don't we Why don't we fire one up?

  • I'm curious to see what they look like if you'd like to play along at home and you're at sandbox, etc.

  • Etc.

  • Etc dot io literally.

  • The first thing you could do is hit enter or click create to get the default settings.

  • And what you'll see is after a few seconds, is a pretty simple environment than indeed, that's by design.

  • We wanted to get rid of his much visual clutter is possible to focus on Lee on the problem at hand, which is presumably commands and code right?

  • And indeed, that's all you see at the bottom half of the screen.

  • Here you see a familiar terminal window.

  • The gooey or user interface looks a little different in sandbox, and it doesn't cloud nine because these were different tools.

  • But same idea.

  • The file browser and code editor or a little different, but hopefully pretty straightforward.

  • I have no files initially, so if I click on the folder icon, there's nothing there.

  • But if I click the plus icon, I get a little dialog window where I can create or upload a file.

  • If you've already got some code, you can drag and drop it or click the upload button.

  • Or you could just type out a file like hello dot see if I want to write a program and see, but it doesn't have to be proceed.

  • Could be hello dot pie or hello dot Go or any number of other languages as well.

  • Um, you be f w t y z three.

  • I'm not sure how to actually pronounce that.

  • I'm saying that it's little bit like if you're watching on Twitch, we are streaming to youtube dot com slash CS 50 and also on Facebook, where you can get a lower bit rate there and more watchable stream and above ignite actually asked an interesting question.

  • How is this different from CS 50 labs?

  • We're gonna get there today.

  • CS 50 laps is a super set of the sandbox.

  • It essentially is a environment for proof, presenting lessons, tutorials on programming in bedding, CS 50 sandbox is part of it, but adding to it instructions on the left hand side, which you might have seen in sense of x 2019.

  • We introduce this republic that one and two in the first couple of weeks of the class and then von Dingle.

  • I'm not sure if you just answer that.

  • But when did Sandbox become available in CS 50 September of 2000 18?

  • Nice just a few months ago, So I will say I do like very much how this is laid out the color scheme.

  • Somebody mentioned that it's dark fame and they're a fan of it.

  • But having just the editor and the terminal, I think we were just talking about this today.

  • It's a kind of an ideal minimalist development environment.

  • Yeah, it is.

  • And much of the why that you're seeing on the bottom portion of the screen is thanks to our friends at code of all now called Next Op Tech.

  • We met them just about a year ago and began this collaboration to make this tool available to see 50 students.

  • So the interactive code window, the file browser and the terminal window eyes provided by next Tech, which is running on top of Google's cloud.

  • And they're providing a very similar feature that Cloud nine on Amazon provides for scenes with the I D.

  • Nice.

  • The truth.

  • Denise is asking how temper and you might be talking about this, but how temporary is the sandbox we create?

  • And can we show the link to a created sandbox to somebody else?

  • Short answer.

  • Yes, on both accounts.

  • In fact, if you go back to see us of these main sandboxes, main menu, you can click on the tab called Recent Sandboxes, where you can see the past.

  • I think we've hard coded into the the past 50 sandboxes that you've created.

  • We haven't really decided how long we're gonna keep him around.

  • The design of city sandbox for the tag line here is that these were meant to be temporary.

  • So more than a day, maybe less than a month, we're going to see what the usage patterns are exactly like, sort of figure this out as we go to really decide what the best use cases for now we're saying temporary, which you should assume is maybe a month, give or take.

  • But you shouldn't plan long term CS if the idea is meant for long term persistent software.

  • I do.

  • I am getting a little bit of a bootstrap vibe from that landing pages that happen to be written in boots.

  • Well, I'm very good with Booth.

  • No bootstrap, if you're unfamiliar, is a popular CSS library.

  • If you want to go to get bootstrap dot com on the streams, it's freely available.

  • Originated a twitter some time ago, and it just is a nice set of widgets and CSS properties that you can use to make your websites look nice.

  • Hopefully without having to figure out how you make tabs and nice looking buttons and all about yourself.

  • It's nicely responsive, so all this will collapse Nice.

  • Mostly nicely when your browser get small.

  • Isaac.

  • Nice.

  • Bootstrap takes care of you for us.

  • Andan Also the sharing of sandboxes eso sharing is possible and this is not gonna be a very interesting sandbox.

  • But let's go ahead and do this real quick.

  • Let me go ahead and whip up the simplest of programs in see here.

  • So includes standard io dot age into main void and you'll notice that syntax highlighting like six of the idea, is providing that feed back to me visually.

  • Hello, world semi colon.

  • So here is very simple See program.

  • And if you all would like to now get a copy of the sandbox, it won't be interactive.

  • You'll get a snapshot in time.

  • I could go ahead and click the share icon.

  • You'll notice that I see a bit lee you around.

  • If Colin wouldn't mind pasting this into the chat.

  • If you go to Billy Flash to G Q.

  • V Capitals lower his B p l.

  • I think Let me confirm that that is correct.

  • Try B P I.

  • BP Capital.

  • I sometimes that the girls are hard to read, even though they're easy to click, this one's doing work.

  • Okay, so that holds about the paste it into the chat.

  • If you go ahead and click the Bentley Link, you're about to see, you'll have a copy of my sandbox and you can pick up where I left off.

  • So the use case here is in one of our on campus classes or sections, as we call them.

  • If a teaching fellow we're teaching assistant is in the front of the room de Maling, some program, and here she wants their students to start playing with the code or maybe find some bug in the code or fix some bug in the code they could just share or write on the blackboard or white board that you are well and let everyone get a copy of it.

  • Let's go.

  • 11.

  • Yang Yang, 77 Y M.

  • C M Benny and Head Hunter.

  • Thank you very much for the follows as well.

  • Um and oh, I guess you might have touched on this but fatty deal Mac is asking, was the difference between the I T.

  • E and the sandbox.

  • So, Sister, the sandbox is a lighter weight version of CS 50.

  • Idea does not have a the bugger it does not have built in chat functionality.

  • It doesn't have a collaboration in real time, but it does have the ability to share sandboxes by making copies off and presumably because it's so much more lighter weight.

  • Is it a more performance and easier to spin up instances?

  • It's faster to start.

  • It probably takes lives to 10 seconds.

  • Where is the I D?

  • May take 5 to 60 seconds because it's a longer term environments that your files or persisted on opportunity, and sometimes they even shut your instance down a little bit.

  • They have to sort of re firing Stan.

  • She hated that can take time indeed, to save time and costs on the Cloud M.

  • Foreign Jews asking is interactive i d.

  • On the cards, which I'm not entirely sure what that is asking.

  • Rephrase that.

  • If you could not sure what you mean and the true Guineas.

  • Thank you very much for the follow as well and So now if folks try to go to this length that we just pasted in all of the chat girls, will we see their changes in real time?

  • We will not.

  • They will get their own copy of this.

  • And indeed, if they look at the U.

  • R.

  • L, they will now be at a different you are Elvin.

  • I say they've been sent to their own sand Boca so kind of forks it and her end rehashes that girl.

  • It is.

  • If you're familiar with get Hub.

  • It's like a fork, but with no ability to merge your changes later.

  • That is by design.

  • Okay, Tux man asks an interesting question.

  • Mrs kind of related.

  • I want to start a coding club to introduce younger kids to command lines and text editor programming.

  • Could they use CS 50 sandbox or do you prefer to reserve it for CS 50 and CS 50 X?

  • Everyone and everyone are welcome to use it.

  • We have some support from our friends at Google.

  • Kindly helped us make this available to students more generally.

  • So tux man 29 please feel free to use it.

  • Just keep in mind that it's a new tool, and it's evolving on again.

  • The environmental meant to be temporary.

  • You see, it's with the I V E.

  • If you want a guarantee that the students work persists day after day after day after day and then back ignites, asking the same question that I just asked and then send So touched.

  • Three.

  • He was asking, How long are the copy stored on?

  • And you said that That's kind of a variable length of time.

  • You're saying assume a month or less?

  • Yeah.

  • Assume some number of days where we haven't decided yet.

  • I mean, anything is possible.

  • We just have to figure out first just what the sweet spot is and what people want to use it for.

  • Cool.

  • Awesome.

  • Just making sure that we have caught up on the chat across all platforms here.

  • Oh, I see Nathan on YouTube has asked, Couldn't David do hello dot Hi.

  • Yes, he could do that as well.

  • Let me go ahead and do hello dot pie.

  • And if I do this prince.

  • Hello, world.

  • There you go.

  • All done with hello.

  • And so there's a file system present here.

  • So if you click on that folder, then I'm presuming that you'll get a little sidebar Indeed.

  • Now we'll see two files.

  • Hello dot c and hello dot And you'll notice.

  • Or maybe you didn't notice with my fingers here.

  • I never once went to file save.

  • I didn't hit control as her command us everything in this environment, actually, auto saves additionally, by design so that students were programming for the first time don't have to think about with their code maybe being different in the browser from what it actually is in the terminal window.

  • When they're trying to run her, compile it, and then you can presumably create folders and things like that as well.

  • Yeah, you could do that in a couple of ways.

  • So one we could do this with make dirt, M k d I r.

  • If you're familiar with that command or we can also do that.

  • Uh, by Can we do this here?

  • Let's try this.

  • No, you have to do it at the command line right now.

  • Okay.

  • And this at the moment is by design that we could perhaps try to make that a little easier, the goal being that we don't really expect students to creating hierarchies of files and folders because again, these were meant to be quick and dirty environments where there's really no notion of a file system.

  • There's just a collection of files that you were currently using, however, underneath the hood, and you can see this if you hover over the files.

  • That's technically in a folder called slash root slash sandbox slash hello dot C, and we can actually see this here.

  • If we print working directory PWD, you'll see where you actually are.

  • And so how much of a Lennox environment are we getting through the center?

  • This is a complete installation of a bunch of 18.4 You can see this if we do Cat FC issue, which is a file that shows us a little something about the underlying system.

  • You want to see the colonel.

  • You can see that as well.

  • Running full fledged Lennox here and underneath the hood is using containers, which is a technology similar spirit to virtual machines, but a little lighter weight and cloud based in this case.

  • So all of you have access administrative access to your own container, and you can do things even like act, get install, fortune or some such program you could do.

  • Pip installed.

  • You could do Jem install Those changes won't persist because again, these air temporary programming environments.

  • But while you're working on a project or program, you can install anything you want.

  • Um, why Emcee and Benny was asking, Can we upload from CS 50 cent box to get hub or download a repo?

  • I'm guessing we probably do have get installed or can download get yet.

  • There's no gooey for that, but you can absolutely run any command.

  • You'd have to be comfortable, though, with command line interface.

  • So get clone, get pulled, get fetch and so forth.

  • Cool.

  • Awesome.

  • Make sure all caught up with everything, which it looks like we're doing pretty well.

  • What's the deal with everyone using Mac books because of Terminal um in higher education, at least in the US Max are actually very popular.

  • PCs are much more popular globally, but this has long been the case that Max within education tend to be a bit more popular, not everywhere.

  • But that's definitely the case that harbored.

  • It's crazy, but it's probably the case that in CS 50 on campus, 80% of students or Maur.

  • I would say more on my observation that would be even higher.

  • So that's just been the trend, especially in recent years, especially as the iPhone got popular here as well.

  • Uh, Boss is asking, Will there be any sessions on machine learning in the future?

  • Probably we have one already on Binary Classifier is with Nick Wong.

  • So if you go back to our bodies go twitch playlist on YouTube, you'll see one of Nick's.

  • Actually, next first dream was a machine learning introduction and fatty dilla.

  • Mac, I'm not sure where you got that you are.

  • Well, that's one of the temporary or else to what?

  • Your redirected.

  • That won't work.

  • It's only temporary.

  • Go to CS 50 dot io Perseus of the I d o.

  • I need outside.

  • Okay.

  • Interest.

  • Don't bookmark that.

  • Rarely, should you.

  • Book market and ugly looking linked like that.

  • You almost always meant to be temporary.

  • Yeah.

  • All right.

  • So if for those of you are curious as to what else is on in CS 50 sandbox, let me go ahead and do this.

  • There's actually an open source public rebo, which we can paste into the chat.

  • Sure.

  • Get, huh?

  • dot com slash CS 50 slash sandbox And this isn't all of the code for CS 50 sandbox itself, but it is the code for the underlying container to which you have access the underlying installation of a bundu.

  • And some of this is here for our own administrative purposes.

  • But you can see in this file CS 50 dot age All of the commands that we were have run in advance for you on top of a default installation of a bundu.

  • So essentially our friends that next op tech are simply while creating these containers running a bunch of and they're running this script for us than installs additional software.

  • And so this is what happened.

  • Most recently, we had a go pro log and Haskell and adjusted the sea and pike on PHP and Ruby and job and so forth.

  • So if you're curious to go through that file called CS 50 dot h, you could just see all of the linens commands that we run for you in advance before you even have to access the sandbox in order to ensure that you have all of the programs and files that we would want you as a student or teacher toe have available to you.

  • And so when someone selects, for example, go or Haskell Erling or whatever environment they happen to want at that moment in time, there's some conditioning here or something that changes how the script is laid out.

  • No, not even the same script is used for all of those environments.

  • So if you are at sandbox dot CS 50 dot io, as of a few weeks ago, you just have to click a radio button and select a specific language that is no longer the case.

  • They all map to the same exact image, and technically, they always did.

  • But we prompted the user for an additional choice.

  • Now you can use any of these environments in any sandbox, I say.

  • So they all come.

  • Okay, so you just use the command line.

  • Whatever you want.

  • It's already pre installed for you.

  • Everything is there, so it's a big image.

  • It's several gigabytes, but it does have everything in it.

  • So all you're configuring at this main menu really are some of the gooey options.

  • Okay?

  • And he said it's using doctor, so I'm guessing the actual footprint of each one of these isn't in the gigabytes.

  • It's a suds, a small portion of whatever the user's individual file system happens to correct.

  • You know, there's not crazy redundancy there, but it's actually we're using doctor to test things.

  • But underneath the hood, Google is not using doctor, but they are using container ization.

  • Got some of some other version of that Somebody has to question Ren Ron.

  • Lonnie Otto is asking.

  • Is CSU?

  • Did Annette removed?

  • Seems like it has been changed to CS 50 that harvard dot edu Yeah, run Lonnie Otto.

  • You're among the few that remember that domain name?

  • Yes, it doesn't redirect anywhere anymore.

  • We have been standardizing for several years now on CS 50 dot harvard dot That was a remnant from many years ago.

  • Even though a few of our applications are still sub domains in siesta, what is the tech stack?

  • Says J.

  • L 97.

  • So it's Bon Dieu is the underlying operating system.

  • It's Alexi, which is a container ization technology underneath the hood that's running on top of Google Computer, Google's cloud service and beyond that gooey that you're seeing for CS in the sandbox like the user interface and the buttons and the form that you're submitting here in the log and mechanism.

  • All of that is implemented in python by us and a flask in particular.

  • Um, Babak was asking, Is this a bash script and to your S h file earlier?

  • Yes.

  • CS etc dot s agents.

  • Just a basket that we use for you in advance before giving you a sandbox to configure that sandbox in a uniform way.

  • Can this be used to set up in a bun to a deaf environment and doctor on my local machine?

  • Short answer.

  • Yes, but what you're looking at is overkill.

  • I would actually refer back to our doctor stream from a couple weeks ago now where we started, really?

  • At the beginning.

  • So I would start there.

  • If you want to learn about Doctor, not with this dream.

  • Because since you can just install that on your own consumer operating system, Your consumer machine indeed.

  • Um, thanks to Walter Weasel shelling borrow 111 Alfred.

  • So an agent flame.

  • Um, appreciate all the hard work that goes into making this for us is why emcee and Benny.

  • So thank you for coming into the hold.

  • The stream.

  • Taxman 29.

  • Just create a sandbox installed, Lou five point through through Apt.

  • And sure enough, it doesn't simply work.

  • The text editor highlights.

  • Look.

  • Oh, it doesn't.

  • Not only does it work, but the text editor also highlights little code.

  • I'm impressed.

  • Thank you.

  • We didn't do that part, but But if that's a genuine interest in you want to keep using Lulu?

  • Uh, actually, what version of Luis we have installed any?

  • No, we never installed it.

  • So someone actually brought a prior 0.1 of the messages saying that we didn't have a little configuration.

  • What we could do that So do send us a note assisted minutes.

  • That's Harvard.

  • And we're happy.

  • Let's try to split that into the image.

  • Some of Dr Melons lectures has got you white.

  • Refer to the man page.

  • Where can I find that man?

  • And then the key word.

  • So man stands for manual in the linens and UNIX environments and Mac os as well.

  • And if you know a command or function that you want to learn more information about, you can play man in the name of that program and you'll see an old schools or black and white user manual for that program, since he has doesn't see anybody have a rapper for the man pages.

  • Was that was that in development Project?

  • Do we have something called reference dot CS 50 dot net, which is only for standard see libraries, but this presents the same information in a slightly more graphical way up.

  • But it's alternative to the man, and this is parsing the Man Page database.

  • It did.

  • Yeah, we dumped the Whole Man Page database, which comes freely with Lennox and parsed it and presented it as HTML instead.

  • Nice.

  • That's really cool.

  • Um, just make sure we're all caught up on chat because we've got a lot of questions.

  • Um oh, Navid was saying doctors kind of member heavy for his PC, has got only a four gigabyte PCs.

  • You understand that small these days for stuff like this virtual ization container is Asian cool.

  • I think we're pretty caught up on the on the questions.

  • All right, so why don't we take a look at what we're using underneath the hood to build this?

  • Sure.

  • So here on the main menu recalls where we started and you can choose your various gooey features.

  • But there's a few other features.

  • If I actually click configure here, you'll see some hidden or more advanced options, and this is really not necessary to use.

  • But if you as a teacher or even us a student, want to run some number of commands before the sandboxes created.

  • So, for instance, it was tux man, you mentioned installing Lewis.

  • If you wanted to distribute a sandbox for your students.

  • With Lou already installed and you didn't want to have to write instructions on the board or in an e mail as to how to install Lula, you could actually do it here.

  • Apt to get install.

  • And I don't quite know the command you use, but maybe it's Lou 5.3.

  • I'm just guessing if that's indeed the command, you can type that into this form here.

  • And then if you preview the u.

  • R L, you'll actually see a special U R.

  • L hear that's read only that you can copy and paste your students in an email or any mechanism like that, and you'll see that embedded in the http parameters is the command.

  • You want every sandbox to run automatically.

  • You could just automate this process as well.

  • That's cool.

  • I actually didn't realize this is the future of the sandbox prior to the stream.

  • Thank you.

  • This this part I did that I like.

  • I like that.

  • That's really cool.

  • And you could see some other information.

  • The means by which we're getting a text editor is because we have a window equals editor parameter and window equals terminal means we're getting a terminal window as well, and you can go one step further.

  • Suppose that you want to create a sandbox, that it doesn't use Louis, for instance.

  • But maybe you just want to teach students about interactive python, and therefore you don't want them to even see a linen shell bash shell, so to speak.

  • You can literally just type python here as the command to run in the sandbox is terminal window.

  • You'll see here that the default command now is gonna be python, so this would happen as soon as it starts up.

  • Yeah, so let's try.

  • Let's click, create now, or just visit that you are l buy copy paste and you'll see the same environment.

  • But watch the terminal window this time instead of seeing a dollar sign with our bash prompt, which is the default shell that clinics typical uses.

  • We will instead now see once our Internet here cooperates A and you said it's 5 to 10 seconds, usually sometimes a little longer.

  • Toe in Stan, she ate a sandbox Indeed.

  • Sometimes, though, it may be for the more custom ones.

  • Do you think maybe it's doing a little bit more work since that it doesn't have as much pre cash?

  • No, this is not expected.

  • Okay, I should not be happening.

  • Let's go ahead and reload.

  • When in doubt.

  • Reload.

  • Worse case re boot.

  • Although that's okay.

  • It was up there and you can see it's immediately running Python.

  • It's not actually running bash or Olynyk shell.

  • That's really cool.

  • That saves so much headache, I concede potentially, especially like you said in the context of teaching high schoolers.

  • Or, you know, even younger students trying to learn our folks that is simply not used to this environment.

  • Want to get right to the coding and python?

  • Yeah, and let's get rid of the text editor because you're using the directive terminal.

  • You probably aren't working on a file, so let's turn off the text editor.

  • Let's go ahead and configure again and run python instead of the default bash created.

  • You get a new sandbox throwing away deliberately the one I previously had, and now you'll see I only have a terminal window instead of the text editor on top and the terminal window.

  • So now the student can focus on that, and only that this almost feels like scaffolding towards something else entirely.

  • How's about a little bit?

  • Uh, this'll level of customize ability almost, um, lends itself very nicely towards the idea of the labs, which, oh, what a nice teaser.

  • It's about just a little bit.

  • Let me just make sure that we're all caught up.

  • I know the tux man was saying Stop.

  • I couldn't love the sandbox that much.

  • So he's a He's a fan of the features as well.

  • Im just monitor all the other platforms were on which I think we're all caught up on comments once three computers in the room monitor different channels today, all the questions you know, this is great.

  • Having them all on Twitch primarily makes a little bit easier, but some folks are definitely timing in on YouTube, which is cool, but I think we're all caught up awful.

  • All right, well, let's go ahead and just open my chat windows there.

  • Let's go and get rid of that sandbox.

  • And that's what I mean by temporary.

  • Once you're done with it after close the window and it will eventually disappear on you, let's go ahead and look at some of the underlying technology's not for labs.

  • That was an accidental teaser, but for what we're using underneath the hood here.

  • So you'll notice that we're using Bentley somehow to share the Urals, and that's just to make them shorter.

  • Technically, you could go to this crazy long You're l.

  • That's in my browser's bar here.

  • This is what's known as a U U I D or sometimes a G u I.

  • D.

  • Which is a globally unique identifier.

  • It's all based on probability and statistics.

  • This is 128 bits, but presented its hexi decimal because it looked crazy if it were just zeros.

  • Yeah, and so it comes in the standard format with a few hyphens, and we just use thes you your i d s o that on Lee.

  • It is incredibly unlikely that anyone the Internet is gonna guess your your i d and therefore be able to see your files.

  • It's possible, but the odds of it happening are astronomically low.

  • And so this is very common paradigm when you want to give unique your L's for something, but with very low probability, let other people access it.

  • It's like Google docks or Google spreadsheets.

  • If you share a u.

  • R L with the world and you give people view on Lee access, the only way you'll find that is by knowing the URL or in YouTube you've ever uploaded an unlisted video on Lee by knowing the the parameter can anyone else access that video is effectively the same way that we will, not the same exact way we do it, but similar and spirit how we hashed passwords and things like that to prevent people from guessing them?

  • Yes, and in this case we're really just leveraging probability.

  • Now, of course, I have zoomed in on and highlighted my secrets of value.

  • So anyone there watching now could go to sandbox that csonto slash 035 d f e eight four dash and so forth.

  • But that's crazy.

  • Like no teacher is gonna want to write that on the blackboard in class.

  • And so we use bit Lee in order to shore in that same your oh, so they're the same.

  • But Bentley is just a lot easier to write and not always to read as we found ourselves, but to at least write down when you want to share it with someone else.

  • So one we're actually using bit please, ap I because we are not certainly manually going in copying and pasting these long you earl's intimately bit l wise website.

  • We're using their p r to generate that.

  • And if you recall when I logged in well, if you recall when you logged in, you were probably prompted to use get hub on, you had authorized the app even we're using get hubs a p i for actually authenticating users.

  • So why don't we take a quick look at those?

  • Yeah, let's do that.

  • And then also thanks to amateur a i d.

  • Etienne Frosties ium for the follows.

  • And I think maybe a couple people had questions.

  • Babak was asking r Z z show official available in the city.

  • So look, I don't know about fish.

  • I've never actually used that Z She?

  • Uh Nope, not at the moment.

  • But send us a feature of requests and we can try to add that.

  • Just email assistant mints at CS 5900 I gave you.

  • I don't know about fish, so I'm gonna guess the commander's fish, not there, but we don't think it would be anyway.

  • And then the so shake was asking, Do we have a GP you access?

  • Not necessarily.

  • I don't actually know what containers air being what types of containers are being used underneath the hood.

  • Most likely not cheap.

  • You usage in the cloud would typically be more expensive.

  • And this is meant to be a very lightweight, inexpensive mechanism.

  • So I think that's very unlikely.

  • The case right now with the underlying cloud service, I think we might have some aspiring bit Quinn minors in our chat.

  • It's not gonna work in big corn.

  • Mining will get detected anyway and shut down by Google.

  • Would says Ron Lonnie Otto, Would people be able to guess the bit Leora to gain access to the sandbox?

  • Yes.

  • So that is the price you pay by using any girl short ner.

  • If you're using Bentley or tiny URL or the light, they use a smaller address space.

  • It's not as big a 128 bits, usually, which means, yes, people can guess it with higher probability.

  • Sin Virtuoso seven was saying.

  • I've been enjoying the cease fire.

  • Came Deb lessons.

  • Awesome.

  • Well, thank you very much for tuning in for those good things.

  • Okay, so let's take a look at Get Hab a p I and bit Lisi.

  • I just your sense of what's going underneath the hood because that's what's nice about sandbox.

  • I mean, as much as it is CS 50 sandbox.

  • Most of the environment is thanks to our friends at Next up Tech and Google.

  • And most of the features were using for authentication come from get help.

  • Most of the sharing features come from Billy, and so this is what's actually, I think, a lot of fun about programming these days.

  • Once you understand the fundamentals, you could build a really cool applications.

  • I just kind of stitching together metaphorically different AP eyes and different service is in building your own idea.

  • But standing on the shoulders of really smart other people.

  • And I mean, this is the sort of motivation behind See issued his own mash up pieces, right?

  • Yeah, indeed.

  • So busy 50 mash up for that piece.

  • That was all about taking Google maps and Google News and building something of your own on top of a kind of an illustration of don't reinvent the wheel leverage with the work that other people have.

  • Oh, yeah, I mean, this would have taken us a year or Maur, probably to build every single component.

  • And that's just probably not a good use of time.

  • Yeah, when there's so many other pieces you can use off the shelf thinks the other's Patrick Machado is saying that terminal usability is awesome.

  • And then Bab ignite asked.

  • CS 50 has ceased 50 that l y is well right.

  • Is it just a rapper of Billy?

  • I used to be something else.

  • Why we use for shortening some your l's.

  • It used to be a rapper for Billy.

  • We actually found it too time consuming to use Bentley's Web based Do I for shortening your l's on.

  • So now we just re implemented Bit Lee in our own Web application, using flask s O that we just actually edit.

  • Get Hub Repo when we want to add a short u R L Only a few of us do this, and we tend to do it longer term, so it's not any arduous at all.

  • Cool.

  • All right, so let's go ahead and just Google something.

  • Get hab authentication Not failed, although that's apparently in F A.

  • Q A P I and you'll see here.

  • Here we go.

  • Basics of authentication.

  • Let's start there.

  • There's a few steps involved whenever using get hubs own authentication.

  • That is to say, You don't wanna have users come up with their own user names and passwords on your website.

  • You don't even necessarily want a database for those things.

  • But you do want users to authenticate.

  • But ideally against someone else, the catches its good get hub or someone else is gonna authenticate your users.

  • You need to be able to talk to get hub securely so that get up and say, This is Colton, who's just logged in.

  • You want to know not his password, but his identity is user name his user I D number or something like that.

  • So there's a few ways to do this would get hub.

  • I mean, there's a few steps involved.

  • You have to register your application after signing up for a free account, following instructions like these.

  • But I'm gonna go ahead and try to scroll down to something familiar here after authorization.

  • Looking for key word here, One of the really docks.

  • This isn't quite the page I want.

  • Let me go, Thio.

  • They almost look if they're using Bootstrap is Well, uh, they have their own CSS library.

  • Let's go ahead and go.

  • Go Get up.

  • Oh!

  • Oh, there we go.

  • So it turns out that oh off or version two of O off is a very popular protocol for authenticating users against other websites.

  • But getting back securely a response like Colton's user name and his user i d.

  • So, frankly, we just kind of followed the instructions here.

  • We registered an app.

  • We got what's called a client i d and a client secrets and few other details, and then using some code in python and using the documentation from get hub.

  • Did we write some code such that if you go to sandbox dot CS 50 dot io slash log in your actually redirected.

  • To get hub dot com, you're prompted to log in there and wants to authorize the application.

  • They then redirect you buy a TV back to us.

  • We then check essentially a security token that they sent to us over https.

  • And if all looks well, we decide.

  • Yes, you are in fact, cold.

  • And in this way we don't need a database of users.

  • We don't need usernames, passwords or anything.

  • We could just rely on our friends over there, get up to duel again.

  • Recycling are not recycling but re using other people's tunnels and technologies.

  • And I think the other motivation for that is not just a safe time, but none of us wants to sign up for get another darn like user name and password on another website.

  • If I've already got a get of account, maybe just let me use that.

  • If I've got a Google account of Facebook account, let me use that.

  • And so that's why you see a lot of websites offering third party Loggins and its investing a lot of trust in the large companies who surely have thought through a lot of these corner cases and have, you know, a lot of investment in the security of their websites.

  • Well, especially when it comes to F adversaries out there sort of people with way too much free time that air, trying to misuse your service is get Hub, unfortunately, probably gets a lot of people trying to create fake accounts all the time or denial of service attacks and such, and that could become something we're vulnerable to.

  • If the wrong person takes an interest and we're in the business of educating, we're in the business of trying to create course content and connecting with students.

  • It's arguably not the best use of our time.

  • Also have to think about all of those problems as well.

  • So to the extent that we can lean on our friends at get Hub or any third party service to do that hard thinking is a good things that we could each focus on what we're hopefully all good at.

  • An M four was asking, Is this a privacy tradeoff?

  • Absolutely.

  • We get home knows that you are logging into our CS 50 application.

  • We do disclaim, insisted these problems.

  • That's him, for instance, that if you're uncomfortable that that's fine created a dedicated and count a different account that doesn't use your own name like mine is de Malin.

  • I probably shouldn't use that if I want to stay private.

  • But you can create another account so that they know that a different user is accessing CS 50 sandbox.

  • But not necessarily that it is you.

  • Thanks to the carny.

  • Now, Bish K M F d m 12 and rock for the follow.

  • Um, havoc was asking Is this buggy Facebook?

  • Third party app breaks Facebook.

  • I don't know what that means, but eyes this buggy No, this is not.

  • But whatever we're doing, I'm not sure on that case, Stark asks.

  • Can I run lightweight Web server and access it across the Internet?

  • You can not for very long because these air temporary programming environment So the inten

All right.

字幕と単語

ワンタップで英和辞典検索 単語をクリックすると、意味が表示されます

B1 中級

ブーザーで無料コーディング!- CS50 on Twitch、EP.38 (FREE CODING IN THE BROWSER! - CS50 on Twitch, EP. 38)

  • 1 0
    林宜悉 に公開 2021 年 01 月 14 日
動画の中の単語