 All right. Welcome back to Computer Science E1. Tonight is our final lecture. This here is an iPad. It's not quite as wireless as you would like when we have to tether it to the room here. But we're actually doing this as a test. Both of us were a little disappointed to discover, as were many people online, that even though this thing comes with what's called a VGA adapter or dongle, one of these silly things that you have to connect to many laptops these days, it actually, the iPad does not have native support for projecting to projectors, which is to say, I tried like 10 of the apps that came with this thing. None of them actually project. But we did find one. We found that Safari, when you play a YouTube video, does actually project up there. And as luck would have it, we have a wonderful YouTube video from 2006 from our own Dan Armandara. So we thought we would begin with this YouTube clip here. Wait, wait. I didn't make this video. I'm just in it. Just clarify that. My name is David Mannlund, and I'm the instructor for Computer Science E1, Understanding Computers on the Internet at Harvard University's Extension School. You're watching one of our videos of the week. For more such videos or information about this course, visit us on the web at computerscience1.org. Enjoy the show. I forgot about that part. Should have paused it. Take it away. OK, so, hello, everybody. Hello, everybody. Welcome back. Oh, so OK. I know what we're going to talk about. So exam two, we graded most of it, except for the distance exams. We still have to do those. We'll do those very soon. And we noticed that the vast majority of people got tripped up on some specific questions. And so I just figured that we'd spend just a little bit of time to talk about those. And specifically, we are looking at the ones that involve the snippets of code, so the pieces of pseudocode. And unfortunately, this seems to have a lot of people seem to have moved their iPad doohickey. And this computer on the monitor is not on yet. OK, so I just figured that we would quickly go over some of these sticky keys. Incidentally, this is an example of a bug. When you unplug a cable and then the computer just freezes with an Apple logo on front, this is an interesting outcome. So buggy software. I'm stalling. You're not supposed to focus on me. Stalling for what? I had this up and ready. I was ready to start talking. Right when I start, you should be installing this whole time. And I'm like, oh, let's talk about this. OK, anyways. So there were three pieces of code, and you were supposed to find the error in each that was preventing it from doing whatever it said you were supposed to do. So for example, this first one, it said that the following code should print 10 asterisks. And the code was let i equals 0. The second line is while i is less than 10. And then you were supposed to print an asterisk. And so I realized that this is way too small. We will fix that. Let's see. All right, bigger. 36 sounds good. OK, everybody can read that, I hope. OK, so this was the code that you were presented. So what's wrong with this? Why doesn't this work? So keep in mind that what's important here is that we're not using any specific language. You don't have to know Java, see any of those other languages that we showed examples. But really, you're just supposed to read this and understand the concepts that we had talked about in the programming lecture, specifically the loops, the if statements, variables, et cetera, and use those to try to figure out why this pseudocode might fail. So does this code print 10 asterisks? No, what does it print, if anything? A ton, in fact, infinite. It's an infinite loop. And why is that? Right, because 0 is always less than 10. We don't have an incrementer. So i always remains at 0. At the very first line, we set it equal to 0, and we test in this y loop, if i, if 0, in other words, is less than 10. And that is the case. But because we don't have another line that says i plus plus, or in other words, i equals i plus 1, then i never increases. So i never actually reaches the value 10. So for this reason, it's always going to be run. And this is an example of an infinite loop. And so it was that, just this i plus plus, that you were supposed to do to correct this problem. That was it to fix this specific one. All right, so this one was let j equal to 0. And let's see, while j equals 100, if j is even then print j, j plus plus. All right, and so this one says that the following codes count even numbers from 1 to 100. What? What are you pointing at? OK, typo. Yes, this was not in there. Let j equals, OK. So this was the code. And so what happens in this case? So it's supposed to print even numbers. But what actually happens here? What does it print, if anything? 100. I'm sorry? 100. Why 100? OK, so good. That's one way of interpreting this, is that you were doing here another assignment. And so in other words, you're setting j equal to another value, 100. But we could interpret this another way in that we're saying that this is actually a test. So while j is equal to 100. And so either way is fine, because it still leads to the same end result, the same end fix. But if we interpret this as a test in that manner, then we say, OK, let j is equal to 0. So that's the first thing. While j is equal to 100, is j equal to 100? No, it's not. So the contents in this loop, these lines of code are never run. So nothing is printed whatsoever. So what's the fix in order to have this code operate as we expect? So OK, so the first two lines are doing two different things. So the first one is creating a variable called j. And it's assigning that variable of value of 0. So that when we look in memory, we have this space in memory that we're calling j. When we look at its contents, it represents the number 0. And this second line is a loop. And it's going to perform the code, this code here that's indented, so long as the condition, so long as this Boolean statement is true. And so in this case, we have to ask the question, is the value j equal to 100? In this case, because we had set it equal to 0, it is not. So because this evaluates the false, it's not true. Therefore, these lines of code will not be run. The loop will just be ignored. So if this goes back to the first, if we look again at the first example that we had, let i equal to 0, while i is less than 10, print asterisk. And then we had the fix i plus plus. What we're saying here is that this is the same thing. The very first line, we are creating variable called i. We're setting it equal to 0. And then we perform a test. Is i less than 10? And it is, because 0 is less than 10. Therefore, the lines of code within the loop will be run. But that is only true if i is equal to 10, for example. Or if i is equal to 11, then that condition up here becomes false, and these lines are no longer run. OK. So up here now, we're saying let j be equal to 0, while j is equal to 100. And so we figured out that as a result of this, it's never going to be run. So what can we do to fix this? How can we actually cause this loop to print out the numbers from 1 to 100, and the even numbers specifically? Yes? Right, so while j is less than or equal to 100. Because in this case, now what we are saying is that, OK, j, if j is equal to 0, then we will allow the contents of this loop to be run. If j is even, then it will print j. Then it increments j, goes back up to the top, performs the test again. Now j is equal to 1. Is j less than or equal to, or is 1 less than or equal to 100? Yes, these lines of code are run, so on and so forth, all the way up to 100. Is that clear? That change? OK. Now the last one, you'll have to bear with me because it's a little bit longer to write. So this one you have to loop forever. And let's see, I'm just going to indent a little bit less, because it'll be a little bit easier to read. So now we have another variable called k, random number, from 1 to 10. Let's see if I can make this bigger. All right, so now if k is less than 4, then we're printing out print to low. Else if k is equal to 5, print got it right in program. Else if k is greater than 5, print to high. All right, so what this is supposed to do is this code will guess a number by picking a random number from 1 to 10. If it guesses the number 5, then it is guessed correctly and it will quit. If it's any other number, then it will say whether the number is too low or too high and then it will loop. So it will pick another number and perform the same thing. It will then test again to see if the number is 5, if it's too low, if it's too high, and it will print out appropriately. But there is a problem with this. What is the problem with this code? Why is this not being printed out? Yes. It says end program before the last else if. So that's a good point. But you might recall from if and the else block, this code within an else block or an if block is only run if that condition is true. So only when k is equal to 5 will it print out the words, got it right, and then it will end the program. In all other cases, it will just ignore that end program statement and it will continue along. If we were feeling evil and we did something like this where we removed the indentation, then you might have a better case because then you're saying, OK, well, is that end program statement actually belonging to that else if block? But in this case, we didn't want that ambiguity. So we just remained that statement or we kept that statement with that else if block. So the program would have meant? Right. In the case of this pseudocode, we're using indentation to figure out what blocks of code belong to various structures. So this else if statement, for example, we're saying that everything that's indented underneath it belongs to that else if. Just like all of this code that is indented from the loop forever belongs to that loop forever. So all of this code belongs to the same block of code. So we're just using indentation to remark what is a block of code belonging to which specific if statement or which specific loop. Sometimes, and you might recall, some programming languages will use some character to make it more specific. So sometimes you'll see this in curly braces, for example, to truly make specific, OK, the two lines of code between the open and closed curly braces actually belong to this else if. But in this case, we're not using syntax like that. We're just using indentation. OK, so other ideas. Yeah. What if the number is 4? That's a good question. So if the number is 4, let's see what happens. So let's say k picks random number and that random number is 4. Is k less than 4? No. Is k equal to 5? No. Is k greater than 5? No. So nothing happens. It goes back to the beginning of the loop, picks another random number, and it continues. And so this actually goes against what we were saying. It picked a random number, and it didn't tell us what that number was in relation to the number that it was supposed to pick. So this means that we have some problem with our if statements, with our conditions that 4 is just being ignored. So what's a potential fix that we can do to get this working? To include 4. k is less than 5. Very good. So rather than k is less than 4, we could just have k is less than 5. We have covered all of our bases. Is there another way that we could fix this to do the same thing? Less than or equal to 4. So in either case, you really just have to change or add one character in order to get this program to function properly. Any questions on that? Right. So what we are saying is that with this loop forever, we are not necessarily saying that, well, we do need a way of getting out of this loop. Because otherwise, it's an infinite loop and that could be bad. There's obviously a point, at least in this specific case, that we want to actually quit out of this loop. And we can say loop forever and have it loop forever. But in this case, we did just want to quit after some point. And the reason that we say loop forever rather than some other structure was that, well, what if it just doesn't pick k being 5 for, I don't know, 20 times or something like that? Then it's hard to guess that. So it's hard to have a loop that tries to guess the number of terms that we would need. So in this case, we're just using loop forever to make sure that this code is run enough times before we actually find the k that is appropriate. Any other questions? All right. So one of the goals tonight is to tie up some loose ends and also to make sure that certain messages, consumer-oriented messages in particular, sunk in so that when you exit this place and no longer, for instance, have a room full of classmates to turn to with technical questions or what if questions, you feel nonetheless prepared to make your way in the world of tech. So what do we mean by that? Well, suppose that one of your first stops after a course like this is to purchase your first computer in, let's say, a while and you have some input to the IT people when it comes to getting your new work laptop. And you tell them for the sake of discussion, and we'll do it both ways quickly, that you want a Mac. And they say, all right, well, you go ahead and pick from any of the desktop models. And in fact, this is something I myself just went through recently with my sister, since we helped equip my mom back home with a new Mac. And she was transitioning as an aside from PCs to Mac, but we'll do the other direction in just a moment. So it looks like the model of interest to us is this thing here. If only because it clearly has a monitor and it has a stand. There are these things called Mac Pros, but $2,400 as a starting price is a little beyond my comfort zone. So I'm going to go with the thing that comes with a built-in monitor. So now you come here, and this is where you, the E1 graduate, should hopefully have at least some new instincts with which to guide your next click. So it looks like we have a menu of at least four options here. Where to even begin? Or perhaps put yourself in these shoes. Now you're no longer the purchaser, but now that people know that you took this computer course at Harvard Extension, it's now people who are turning to you to actually ask you for some counsel here. So where do I begin? I am a hapless, non-technical person who knows at least how to check my email, but I need a new computer. So where do I even begin? What should jump out at me in these listings? Yeah. OK, and let's see. Right here. So good. So if we zoom in on the two left-hand options, it looks like one of the first most striking differences is that the guy on the left has a 500 gigabyte hard drive, and on the right, one terabyte. And what's the factor difference between these two? Just to be clear? So it's twice as much. 500 gigabytes plus 500 gigabytes gives you one terabyte. So in fact, you get twice as much storage space on the right-hand side. But let me push back. It looks like they have the same amount of memory, though. So four gigabytes of memory, four gigabytes of memory. So what then is this difference between hard disk and memory? Damn, kind of give it away. Because a lot of people, maybe even yourselves, up until a course like this, conflated the term memory with different types of memory, which are clearly in the computer. So which is meant by which of these numbers? What do we have four gigabytes of? OK, so RAM. And in a sentence, the difference between RAM and, say, hard disk space is what? So storage, and what do you mean by that? OK, perfect. So the hard disk is for long term or persistent storage so that when you shut down, pull the plug, move the computer physically, your data, unless you've really jostled it or broken it, is still there intact, even though there's no flow of electricity to the device. RAM, by contrast, is volatile memory, which is just the fancy way of saying lose power and those contents are gone. But RAM is useful, yes, in the short term, why? What is RAM used for precisely? Someone in the middle section, if I may. If everyone can say one thing today, we'll have achieved our goal. If we can set an arbitrary goal. What is RAM used for? Why bother with it at all? Yeah, I'll take even the hesitant hand up. Perfect. So for current processes, things you're doing right at the moment, hard disks, as you may recall, are pretty slow. Anything mechanical on a computer is relatively slow. And there's not even that many mechanical parts. We have the hard drive. We have the fan. But that's about it these days. And they are, in fact, the slowest parts, so it makes sense intuitively, hopefully, that if you actually want to run your computer quickly and run your programs and interact with them, you want those programs stored inside the faster type of memory, which, in fact, is RAM. And as we discussed when we just depicted the pipeline of sorts on the Blackboard long ago, there's even faster types of memory than just RAM called L1 cache, L2 cache. And those things start to get a little lower level at you as the consumer. Probably don't really have to care as much about that. But typically, more is better. But there are certainly limits. But it's usually a function of which CPU you get. It's not a user-configurable dropdown menu. Yeah. OK. OK, so that's a perfect mindset. So if especially the end user who's going to be using this thing is fairly non-technical, but they want a computer with which to check their mail, write documents, print things, and that sort of thing, what is, in fact, the most obvious difference someone like that is going to notice, well, maybe eventually they would notice the differences in hard disk space as their hard drive filled up. But you plant those two things side by side on a desk, or you take them to the store with you, and yes, as you know, they're probably going to notice the disparate screen sizes. The two ones on the left are 21 inches, diagonally, and the two on the right are 27 inches. So that's a very reasonable starting point to sit this person down and say, well, which size do you prefer? Yeah. OK, true. So there are ways to mitigate even these decisions that we necessarily have to make right now in the short term before we pull the trigger. But hey, if we run out of disk space down the road, you've all probably seen or at least heard of external hard drives. You can plug them in with the USB cable. They're relatively cheap. And the funny thing is, when your friend runs out of hard disk space a year hence, they're going to be even cheaper, most likely, and bigger. So you can kind of ride that curve unless you need it right now. Yeah. OK. OK, so that's an interesting point. And let me just plug out one of the buzzwords there, so cores. So what does it mean if a computer has multiple cores? Processors, yeah, and there's a bit of a difference. So a CPU is not quite the same thing as a core, because a CPU can have multiple cores. But for all intents and purposes, if a CPU on the left has one core and the CPU on the right has two cores, it's almost as if you have two CPUs here and one CPU here. In other words, twice as many cores means you effectively have twice as many CPUs. And in real terms, recall now our discussion of Scratch a couple of weeks ago. That means if you have two CPUs or two cores, the computer can literally, not figuratively, literally do multiple things at once. And by figuratively, I mean, if you just have one CPU or one core, clearly your computer seems to be doing all sorts of things at once. You're typing a document. You're receiving instant messages, emails being downloaded. But recall from many weeks ago, that's really just an illusion. That's because your computer is so darn fast it is toggling between all these various programs really fast, really fast, really fast, doing smidgens of work here and there, creating the illusion to us slow human beings that, in fact, everything's happening simultaneously. But when you start to use more intensive programs like Photoshop or if you're trying to watch a movie while doing work, which I've been guilty of, you actually want to be able to throw CPU cycles, so to speak, at those additional tasks and having multiple cores can help with that, so which is perhaps, obviously, the most souped up model here in this menu of four options. All right, so the quad core. And that's where they're trying to upsell you, or at least entice you. And the top right there, there's that little blue icon that says quad core. So you can just infer from that basic definition, quad core, pretty much means this is though this thing has four CPUs. But then the E1 graduate and you should start to kick in. Now, wait a minute, I am just a relatively slow moving human being. And yes, I might multitask and hit Alt Tab or Command Tab a lot. But the reality is a normal person is probably checking their email, browsing the web, writing documents, printing things, maybe watching a movie. But if you're not using Photoshop or developing movie content and editing videos like the one we began with tonight, you might very well be overpaying. So you have to try to find, at least intuitively, that fine line. If money is no object, then by all means, go with the highest end model possible. But you have to realize, too, that if you ride that curve of technology all the way to the right, getting the latest and greatest, the reality is six months from now, Apple's going to release something even better or whatever the company happens to be. So you're paying that premium here. Well, if we toggle over for just a moment now to the first thought process that you might have for a PC, I picked Dell. It's a popular PC company. In this case, I'm going to want a laptop. But I want one of these new fangled things that I keep hearing so much about called netbooks. What is a netbook? Yeah, so it's a smaller PC, a laptop form factor that's generally used to go on the internet. And the funny thing is, in my own personal opinion, this is a stupid new term. It just means small laptop. And we've had loptops for ages. But now you slap a new buzzword on it. You market it at a different price point. And you can call it something new. But the reality is these are still devices that have maybe 1 gigahertz of power, maybe 1.3, 1.5 gigahertz of CPU power. If your needs are relatively humble, even though you propose using it for internet and email and the like, you can absolutely write an essay on something like that and send documents to a printer and look at photographs. Watching movies, you might get some buffering and some stagnation when you're trying to play the movie. If you're trying to develop movies, probably not the right device. But the beautiful thing is that if you click through to these kinds of devices, if I go down here to, let's click on shop now, what's really compelling is my god. Like the starting price points of these things tend to be $200, $300. And what you get, actually, this isn't even the right one. These are normal PCs. Those are normal laptops. Let me go to mini notebooks. So now we get to the price points of like $279, $299. So I actually have one of these little toys. It's a Dell Mini 9, which means 9-inch screen. There is one gotcha to this. And the problem with buying things online, whether it's for at least Apple, you can go to the store. Dell doesn't really have storefronts. You can sometimes find them in Best Buy and the like. What's the problem, potentially, just intuitively with a netbook? So yes and no. So you can't multitask. You kind of can. You can certainly hit Alt-Tab or equivalent and run multiple programs at once. If your system, if your task bar is starting to get 10 and 12 icons, you're going to notice a slowdown. But you can absolutely have, say, a browser open, word, your instant messaging. Because frankly, if you think back four or five years, we probably were all doing that four or five years ago. And our CPUs probably were not even as fast as these things have. Now if you want to run the latest and greatest software like Windows 7 and the like, then that costs you cycles for other reasons. But that's fair. There's certainly going to be a limit. And I think you are inclined to propose another limit. It drives me nuts. I actually don't use my little netbook because it's too annoying to type on for very long, whereas small laptops, historically, for me, small, but at least I don't feel constrained. I mean, this one I literally am like this, and I just can't do it. But maybe other people can. But certainly for using just checking your mail or tossing something in your backpack cheaply and quickly, it does perhaps make sense. Though if you read the media, these things called iPads are acclaimed to be taking a bite potentially out of that market. So we shall see. All right, so another scenario. So you now walk into Starbucks. Now you already own a laptop, or this is your friend, and they are now a little bit paranoid because of things you've told them about all of these threats out there. So you walk into Starbucks, you own a laptop, and this Starbucks is advertising free Wi-Fi or, frankly, maybe Harvard University across the street has free Wi-Fi, and you're trying to patch into it. So what should be going through your mind? Like, what are the gotchas? OK, security, and what do you mean by that? OK, good. So if you are on a wireless laptop, and by this we mean you are using that protocol called 802.11a, or b, or g, or n, you need to be cognizant of the fact that there may very well be people with too much free time or malicious intent watching everything you do, not over your shoulder, but just wirelessly by sniffing the traffic. Now there are technologies that mitigate this. What were some of those buzzwords or technologies that mitigate that concern? OK, so using a VPN, a virtual private network. Unfortunately, the normal person off the street doesn't generally have access to a VPN unless you have a corporate network or a university affiliation. But if you do have those connections, you can usually ask the IT folks for some free software or software they've paid for so that you can use it. You have a username and password. And this lets you have an encrypted tunnel over an otherwise insecure connection. Now that's good for keeping away the annoying people who are trying to observe what you're doing there. It does not stop who from seeing what you're doing. Well, hackers it would, I would argue. Most hackers it would stop because all they would see is scrambled nonsense. Zeroes and ones that look random because your boss. Exactly, right? Someone there's going to be, the buck stop has to stop somewhere. And if you're VPNing into your corporate network or university, surely the people at the other end of that tunnel, so to speak, have the ability to see what you're in fact doing. What are some other buzzwords? So you don't have a VPN. What at least could you expect in a public space or certainly in your home for security's sake? OK, so using a firewall. And a firewall is something that comes built into a lot of operating systems these days. Or it can be a physical device that protects you from getting hit by any form of inbound traffic by only allowing outbound traffic. Encrypting your hard drive is a way to obviate toward a physical threat or just nosy employees if you hand something over to Geek Squad or the like. So encryption on your laptop. And where else could there be encryption? HTTPS. OK, so using HTTPS to shop on Amazon or some otherwise sensitive site where you're giving private information. And what about wirelessly? What are the protocols you're hopefully using at home if you have any wireless at all? WPA and? WPA. OK, so that's good. WPA, you might see it. WPA2, which is a newer variant. The bad one to avoid, or at least if you only have it, you should probably spend $20, $30 to get a new router before long. WEP, so WEP. And it's actually interesting. There was just one or more articles published recently about how some manufacturers in China, I think, have been getting clever about manufacturing dedicated devices that you allow them to listen to some wireless traffic and they crack WEP keys for you and then allow you to connect wirelessly to someone else's network. I mean, it is relatively that easy. And they're now just packaging it up various companies to save you the dirty work. So you have all of these means of encrypting your traffic. But what actually happens when you bring your laptop to Starbucks and you connect it? So you might recall that we have this alphabet soup of all of these acronyms of all these various services that are responsible for bringing a computer online and allowing you to connect to the internet and start browsing the web. So let's say I bring my computer to a Starbucks and I connect through, maybe they probably don't have WPA protection, but just assume that I'm connected to their network. What has to happen? How does my computer start to send data? How am I actually able to type in a URL into the web browser and get a web page back? What's the sequence of steps? What's the first step, arguably, that my computer has to accomplish in order for this to even begin happening? So bring my computer. I set it down. And what do I need in order to allow my computer to start communicating on the internet? Yes? OK, great. So I need an IP address. And so typically, an IP address is not something that my computer just has. So how do I get an IP address from the air? What happens? OK, so my computer, when it connects to the router, it actually contacts what's called the DHCP server. And so this DHCP server is most of the time it's built into the router. So what we are calling these home routers that David was mentioning earlier, they might include their own firewall. It might have WPA protection, all of these things, but actually includes a variety of services. And one of them is DHCP. And DHCP provides a variety of information to my computer when it's requested, including the IP address and including some other servers known as DNS servers. So these DNS servers are IP addresses that my computer connects to to do what? Right, so the other way around. So it translates, so given a domain name like cnn.com or computerscience1.net, for example, it will translate that into the IP address of the server that my computer needs to connect to in order to communicate and to be able to send data to and from to receive a web browser or to receive a web page itself. Okay, so now my computer has received this information and so I'm able to start typing in a domain into the web browser. And when I hit enter, what typically happens to this data? Well, recall that usually this information is sent. It's broken down into various little packets and it's sent along the router, along the wire from router to router. And recall that what we're calling the router is it has a lot of stuff packed into it, like I mentioned before. It has all of these servers packed into it, but it does also serve as a router. And the purpose of a router is to retrieve these packets of information, try to figure out where to send it next. So it knows, okay, well, IP addresses in this range should go this way, IP addresses in this range, the packet should go this way. So it figures out where to send the packets next and sends the packets to the next router until ultimately those packets will be received by the server, reassembled, and then the message will be received. And typically these messages, especially with web servers, or when we're trying to view websites, will operate over the HTTP protocol. And so using HTTP that the computer, as you might recall, asks the server for, let's see what you do with the chalk, here it is. So it asks the server to get some information, in this case, a slash. So what does this slash typically mean? When we're talking about HTTP, so there's the computer request get slash, what is it asking for from the server? So I've typed in a website like computerscience1.net, I've hit enter, and all of my requests has been broken down in a packet, sent over the wire from router to router, reassembled on the server and it's this message. So it's asking to receive a web page from the server, and the web page that it's asking for is this slash, and what is this slash represent? Right, the home page or the default page that's provided by the server, and typically that translates to that index.html, and recall that HTML is different from HTTP, so don't get the too confused. HTTP is the protocol through which the computers and servers communicate to send web pages and to request web pages, whereas HTML is just a mark of language, it's just a way of formatting text that the computer or the server sends to the client computer, to my computer, that the web browser reads and then interprets into an actual final web page. So it's two distinct things and it's important to keep the two separate. Okay, so as soon as my computer has requested the slash or the index.html, the server sends that data back to my computer and then I'm able to display that web page on my computer. And so recall that we can have a variety of problems that can exist through this. So let's say, for example, that I'm no longer able to connect to the domain name server, so I can no longer connect to DNS and I type in a domain like computer science one.net, I hit enter and it says that it can't resolve the information. Well, sometimes there's ways around this and troubleshooting problems like this, it really becomes an issue of, well, where is the problem occurring? Is it because I actually cannot connect to any web servers on the internet at all? Is it that one of these services is down? Is it that the DHCP server is down that I'm not actually receiving an IP address? Is it that the DNS server is down and I can't translate domain names into IP addresses? And it's typically very different things that can happen. And if you are able to figure out which one it is, then sometimes you can get around it. The DHCP server is down, it's probably a little bit difficult to just guess an IP address and have it operate. But if the domain name service is down, then maybe you can give it a separate domain name server to operate on and be able to translate your domain names into IP addresses. All right, so that's a look back at where we began with hardware, transitioning to networking and security. What are the kinds of trends that are useful to be cognizant of as you step out beyond computer science E1? So there's this really popular buzzword de jour these days which is called cloud computing. Does anyone know what is meant by cloud computing? Actually, step back. Has anyone heard this expression before? Okay, so you've almost all heard it. So what is it? Yeah, okay, okay, good. Cloud computing is all about storing your data and even running your programs in this newfangled thing called the cloud. The reality is this is really just a new word for outsourcing, frankly, and that's a bit of an oversimplification. But this is just yet another one of these buzzwords that everyone likes to jump on the bandwagon for and start touting it as a newfangled technology. When in reality, all people are beginning to talk about or beginning to do is relabel things like Gmail. Where do you keep your email? Well, I keep it in the cloud. Well, a year or two ago, we just called that the web or gmail.com. Now, there is a greater sophistication touting, or there is a greater vision behind cloud computing. And that idea is that no longer, before long, will you have to run programs only on your own CPU, on your own hard drive, in your own RAM, rather when you wanna write a document, you instead pull up the address of some server and start typing away. Those of you who already use Google Docs or Google Spreadsheets, these kinds of web-based applications are already using this thing called the cloud. And now Microsoft, just this week, is beginning to release what they call Microsoft Office Online, which is similarly a free suite of tools, whereby you have a word processor, a spreadsheet, and even a PowerPoint-like or slideshow-type software available to you for free. And when you actually save your data, similarly, is it not stored locally on your own laptop or desktop, but rather where? Yeah, so on one of their servers. So now the flip side of this is that if you are, say, an employee at a company that is no longer paying $300, $500 per copy of Microsoft Office, which is ridiculously expensive, albeit quite popular, and are instead using a relatively cheaper service, like Google Docs or Google Apps, you can actually, long story short, pay someone like Google to host your website, davidmailin.com, but that actually lives on Google servers and all of my employees can go to davidmailin.com and write documents there, write letters, they can make their presentations, they can store their spreadsheets. So you have this nice illusion of owning the software or owning the domain name, even though someone else is actually hosting the software. But what happens at 2.30 PM if you really have to bang out this letter to an important client and bam, something bad happens? What could be that something bad in this scenario? Yeah, perfect. So you can have internet connectivity problems. Maybe it's Google servers that are having issues that's certainly been known to happen. Maybe it's something silly like your router got unplugged. Maybe it's something a little more beyond your control, like Verizon is having an issue with their network or Comcast is having an issue with their network. Long story short, you are now SOL. You cannot use that software because it's in this so-called cloud. So that's sort of the flip side of what otherwise is a cost-saving measure. Now, in fairness, if there are things that can plague our computers these days, even if we don't even have this thing called the cloud, there's no hosted applications, we're just using Microsoft Word on my own laptop or PC, what can still happen in this day and age that could go wrong? Just think about reality. What could go wrong in this current scenario? Yeah? OK. So that's quite fair too, right? Right now you are very vulnerable to physical damage or just circumstantial damage like your hard drive just gives out. It's defective and bad things happen. Well, the reality is there might be some value to paying, even if it's only a few dollars per year or per month, people who are more technical than I or more interested than I in actually solving the problem of data backup. So right now we have this problem. This might have merely rated. But what about the electricity going out in the office? Well, I'd argue that, frankly, you still can't send that or write that important letter if you have these real-world constraints. But long story short, this is at least a technology, if you will, to be cognizant of because more and more are we, humanity, likely to transition more stuff away from our own client machines, as we'd call them, to the so-called cloud or really just to a server environment. Yeah? Absolutely. Absolutely. So now it becomes a much juicier target if your stuff and your confidential information is stored along with all sorts of other more interesting information. But now you're in the same bucket as all of these other folks. Frankly, and we even talked about it a bit in this class, encryption, frankly, is a pretty decent solution to these problems whereby, yes, all my email, all my documents may very well be stored on servers owned by Google. And they don't quite offer this feature across the board yet. But the reality is in a few years, once people begin to expect this level of support and CPU cycles are such that we can spend those cycles on more and more encryption, a lot of those problems can be mitigated by having even per-company keys, encryption keys, so that your data, even if it's in the same place, can be encrypted in a different form than someone else's altogether. But there's this other feature that's related to this that we thought we'd introduce you to just a taste of because it's actually lets you experiment yourself. So when computers first began to get popularized, they were pretty dumb devices. They were dumb terminals or thin clients is another expression for this, whereby you had a pretty basic, pretty bare bones machine on your desk. But when you started typing, you were actually doing real work on some server elsewhere. And that's kind of where the world is trying to get us back to. Over the past 10, 20 years, we've migrated to this world where you buy shrink-wrapped software or download it, install it on your computer. You have anti-virus computer. All of us are independent computing entities. And any number of things can go wrong with our computers. And frankly, I hate this reality. I think the fact that so many of us struggle with IT issues and technical issues and for those of us who actually own multiple computers, whether it's a phone, a laptop, a desktop, just keeping all of those things in sync is a complete nightmare. And it's not an interesting problem to solve. So there are some consumer-oriented values to this thing called the cloud. But the cloud, as it's called, is ultimately the result of advances in what's called virtualization. And this is another sort of buzzword du jour, but it actually describes a real technology. The upside of our having so many CPU cycles at our disposal and, frankly, so many cores is that we, at the moment, don't really know what to do with all of these cores, especially larger companies that have big servers that have four or eight or 16, 32, 64 cores inside of a 1 and 1 half inch tall computer. What you do with those is increasingly less clear. And so because, long story short, we are not very good at writing software that takes advantage of that many cores, of that many CPUs. We really write software typically that just needs one CPU, maybe two, to do something, to get real work done. So what the world has started to do is chop up these physical servers and all of their cores and see the illusion of multiple servers, whereby you can buy one server, have a lot of RAM in it and a lot of cores, and then you can rent space on that server to 10 different clients. And to each of those clients, you give two cores and maybe a gigabyte of RAM. Now, how do you do that? You don't have to give them accounts on that system. You can instead of what's called a virtual machine software, virtualization software. And this is special software that creates the illusion that one physical computer is actually multiple other computers, each of which has its own administrator account, each of which has its own choice of operating system. You can run Windows XP, you could run Windows 2008, you could run Ubuntu Linux, you could run Run Hat Linux, all physically on the same server. So long as before you install any of those operating systems, underneath it all, in a sense, you put some special software called a virtual machine that creates the illusion that one physical box is multiple servers. And the cool thing is, and this is where we're getting to, you can do this yourself these days for free, even on your own laptop, on your own desktop, especially if, for instance, you're a Mac user. And you'd actually really like to have a PC for just occasional applications to use. Or conversely, you are running Windows, and you'd actually really like to learn a bit more about this OS called Linux. But you don't want to delete your whole hard drive and start fresh. You don't want to do this thing called dual booting. Because if you're like me, you're never going to reboot your whole computer just to change operating systems. It'd be much nicer if it's just another operating system running in a window in your own comfortable environment. So there's this program, which we would encourage you after this course, just to Google for download for free and poke around. It's pretty good in terms of documentation and tutorial videos. But the one I have up here is called VirtualBox. It's made by a company called Sun Microsystems, which was just acquired by a company called Oracle. It's still free software. And what's beautiful about it is that it exists for Macs, PCs, Linux computers, other Linux-based operating systems. And it looks the same across all of them. So it's nice from a familiarity standpoint. And what it lets you do is create the illusion of a machine computer. I just click the New button. I'm going to ignore this boring text here, because the next questions I'm going to be asked are, what do you want to give the name of this virtual machine? I then tell it what operating system I plan on installing. I'm going to put Windows XP on here. I click Next. I then tell this program how much RAM do I want to allocate for the operating system I want to install on top of macOS. So right now, I'm going to treat my laptop as though it's one of these servers with lots of cores. Now, this would be kind of ridiculous, because this is not a very fast computer, this air. So I'm going to be a little reasonable. Click Next. I can create a new hard disk. This is a software-based hard disk. So it's really the illusion of a hard disk. It's not a physical device. And if I click Next again, I'm going to skip a couple of these details. How many gigabytes do you want to allocate to this virtual machine? I mean, I'm really creating a computer in software. And the end result is going to be an icon, much like this one here, whereby if I click Windows XP, Service Pack 3, a window is going to open. And I did this previously, so it's waking up, essentially. And I was actually amused to discover that the last time I used this virtual machine was on a plane. So I could play a game from the 1980s called King's Quest. And I did that because I really wanted to play this game. I only had a Mac at the time on the plane. And I did have a virtual machine running Windows XP. So as stupid as this is, this is what graphics were like in the 1980s. And yeah, so this is King's Quest. Wonderful game. But you can't play it on modern computers. In fact, you have to kind of slow them down so that the guy doesn't tear across the screen. But I am going to go ahead and just quit this for a moment so that you see underneath this is Dost thou truly wish to cease our adventuring? Yes, quit. And what you see here is Windows running on my Macintosh. And that's the takeaway. And what I also have in another window here, if you'd like to be even more of a geek and experiment with another OS altogether, this is what Ubuntu Linux looks like. This is a free operating system. You can download a CD or an image, therefore, and install it into another virtual machine. And voila, your Mac is now running Windows. It's running Linux. And slowly, if I'm doing all these things at once, but this, again, all takes advantage of the technologies we've been talking about thus far. I feel like a hand was about to go up. Yeah? Any issue with licensing? Any issue with licensing? Yes. You have to own that copy of Windows that you install on this computer. And we have a site license for it at Harvard for that purpose. Ubuntu and other Linux flavors are generally free. So it's not so much an issue. And just FYI, Apple does not allow legally people to virtualize Mac OS. So if you own a PC, you can't, quote, unquote, run Mac OS in a window on your computer. But people have figured out how to do this. So I think it's time to come full circle tonight with a look at programming. I think Dan has volunteered in advance to help us out with this. And we need just one other volunteer. We can take a second and a moment to change tapes as we set up a little table. But we need one volunteer who's very comfortable being on camera and who's going to help us execute the very last computer science E1 program. Ian, come on down. All right, now before we reveal what's in the bags and what Ian has to do with you is let's go ahead and actually, we kind of did this in the wrong order. And the student will figure out preemptively what we're about to do. No, that's OK. Why don't you go on up awkwardly to the front there? And let me go ahead and open up just a little program. I can do that if you want. Do you want to be the one over here? I got it. You sure? All right. So before Ian and Dan do battle wits here, we need to get some little audience participation. So the goal at hand, I'm really hungry. I didn't really have lunch today. So I would really like a peanut butter and jelly sandwich. But we're going to ask the audience here to help teach us, the computer teachers and Ian, how to make a peanut butter and jelly sandwich. And then we will execute that program. And hopefully, there will be no bugs. And I will get my sandwiches output. All right. So with that said, you guys don't get to talk just yet. We're going to ask the audience. And I'm going to document this. And then you guys will do the execution. This is sort of a weird abuse of Microsoft word. But I really just need someplace to type, since it's kind of boring to write it all down on the board and change my margins. All right. So step one in my program, and you may assume the following. We apparently have some bread, came prepared. We have some jelly. We have some peanut butter. And we have some knives and some paper towel. So hold that thought for a moment while we go ahead and change out tapes. And think to yourselves for the next 60 seconds, how do I actually make a peanut butter and jelly sandwich? And that's all we have? That's all we brought. So that's all you have. We're going to be sort of like, what's on the table? Yes, you may assume you have this as input. Well, we shall see. We shall see. All right. Step one. Tell me what to type. And then they will execute. Open up. All right. Wow, you're really taking big bites at this problem quickly. All right. So open bread. So don't execute yet. Why don't we write down a few steps and then we'll execute. Open bread, peanut butter, and jelly. OK, someone else. Step two. Yes. Hold the knife. OK? Step three. OK. Oh, wait. Here. Tear off one square of paper. Tear off one square of paper. Tear off. This will be a real good group activity here. OK, yeah. Lay paper on table. This is going to be fun. All right, lay paper on table. Step five. Someone else? Get the bread. I look forward to seeing that precision. OK, next. This is going to be quality. Scoop two slices of bread. Scoop two slices of bread. Remove two slices of bread. OK, remove two slices of bread. OK, step six. Sorry? Place on the paper towel. Place on paper towel. Few more steps. Scoop peanut butter with knife. OK, spread peanut butter on one slice of bread. Actually, put on both sides. On both sides? OK. Oh, on both slices. OK, both slices. Whoops, let me kind of shrink the font. OK. Spread jelly on second slice. Can you make it again? Yeah, we'll do two versions. Take us home, someone. Put knife down. Yep, next step. Put slices together. Put in jelly. Put peanut butter and jelly slice. OK. Loop three times. OK, all right, so this is pretty good. We seem to have some form of output here. Let's go ahead and execute. And then for version two and final, we will see if we can't improve. So just to clarify, we're sort of doing this in parallel. So I do this and he does that. If he does something, I don't consider it done until I do it. Correct. So I will recite the instructions. And I would do your best to put blinders on, not look at what Dan's doing, lest he lead you astray or vice versa. And you must only do what we tell you to do. You're a computer, right? When computers are told what to do, they do it. They don't assume or make guesses or fill in the blanks for you. They're not that smart. So step one, open bread, peanut butter, and jelly. And don't look at that. Oh, right. Isn't that your silver mark? Yeah, but it's not here. Yeah, I think one of the computers is taking some liberties here. It says open jelly. All right, very good. Hold knife. Oh, crap. Good, that too is imprecise. Tear off one square of paper. That's a rectangle. What do I do with it? Well, we're waiting for your other computer. OK. All right. Lay paper on table. This paper has hearts on it. That's nice. Get the bread. All of it. The. Remove two slices of bread. Scoop, peanut butter, no, no, no. Place on paper towel. Place what on paper towel? Place on paper towel. You know, this will be the video we're showing on YouTube three years from now. Scoop, peanut butter with knife. Scoop, peanut butter with knife. We seem to, well, spread peanut butter on one slice of bread. I think Ian's right. We never told you to put the bread down. We said, get the bread. What? We said, get the bread. No, you said put place on paper towel. But you also didn't specify which bread I was supposed to put it on, so I just used the on paper towel. You used the two slices or the entire piece of bread. That's true. All right, let's forge ahead then. All right. Actually, put on both slices. It already is. There's another piece of the knife over there. All right, spread jelly on second slice. Yeah, that jelly was there when we came in. Put knife down. Put peanut butter and jelly slices together. OK, not quite edible. Shall we take one final stab at this? All right, so let's assume things are in as pristine a condition as possible, but we'll take some liberties now. Let's go back to the drawing board here and see if we can't fix where we want to stray. So step one, please. On loaf of bread, OK? Remove cap from peanut butter and jelly. Yeah, OK. OK, so we'll allow you to go back to the same step, but not further. So unscrew caps from peanut butter and jelly. Yeah? Remove two, I'm being a lot less reckless this time, it seems. Step three. This could be boring. Now open the slices. Sounds vetoed. That actually looks pretty good. Tear off one rectangle of paper towel, place rectangle on table, on top surface of table. Any naysayers yet? All right, next step. Yep, remove two slices of bread. Take off two slices of bread. Take out two slices of bread. From, good, we're learning. Open end of bag. OK, so this side's been quiet, yeah? Place the bag back on the table, that's for Ian there. Put the slices. OK, place the, OK, side by side on paper towel. OK, I think we got that one through. Pick up knife. Peanut, break it. Pick up unbroken knife. Good, thank you, from Handel. Next, of knife into peanut butter. I'm going to push back. I claim there's a bug here. Yeah, so what do we do in step one, step two? Yeah, so that's kind of, yeah, so remove caps from PB and jelly, how about? All right. Place caps on top of table. How are we holding the knife? Where do we pick up, pick up knife? Oh, yeah, yeah, with hand. That's fair. OK, bring us home, almost there. What's that? OK, no, that's my form from, thank you. All right, what else? Lift, scoop, do you understand scoop? I don't understand scoop. Insert blade of knife into peanut butter. What do you want to do? Scoop out, we want to assume that you know what scoop means. Tablespoons of peanut butter. With knife, all right, that's pretty good. Next, spread, oh, come on, it never works out well when you say it so succinctly. OK, spread peanut butter on one side. OK, good, top side of bread, one slice. Spread evenly. OK, shrinking the font yet again. All right, a couple more steps before this gets even more awkward. Peanut butter side up, back on paper towel. Oh, OK, well, you can spread it on the table, with the bread on the table, right? OK, all right, so it seems we don't need this one. What's next? Clean the knife. Yeah, everyone's leaving with a peanut butter and jelly sandwich tonight, so we better start being hygienic. Clean the knife. Better hope you get bread from that one, too. There's plenty more sandwiches to go. All right, clean the knife and, all right, a little copy paste job, blade of knife into jelly, jelly. OK, so on one on top side of the slice with no peanut butter. OK, and finally, match up jelly touch. In the center. Evenly. Evenly. So that the edges match. Loop twice. All right, anything else? Is that it? All right, here we go. Your exciting conclusion. Untwist tie on loaf of bread. Fix the knife. Untwist. Untwist tie on loaf of bread. All right, we'll improvise. All right, unscrew cap from peanut butter and jelly. You guys are boring. No fun. Didn't say remove. What? Didn't say remove. Tear off. Oh, and jelly. And jelly. Tear off one rectangle of paper towel. Go ahead. Well, they just wanted one. They didn't say one. There, that's one rectangle. That is one rectangle. That is one rectangle. Place rectangle. Wait a minute, you're jumping the gun. Now place rectangle on top of surface of table. On top of surface of table. There. On top surface of table. Yeah, done. Take that sentence is not grammatically correct according to Microsoft Word. OK, take out two slices of bread from open end of bag. Oh, out. Place the two slices. No, place the bag back on table. Place the two slices side by side on paper towel. Gently. Is that the thing? Gently. Pick up unbroken knife from handle with hand. That's not fair. Well, I fixed mine, so see, not broken. Do not break it. Not broken. Remove caps from peanut butter and jelly. You guys didn't leave me a free hand. You were supposed to unscrew it, though. I did unscrew it. It was unscrewed. It's just there. Wait, it didn't say OK. Place caps on table. Insert blade of knife into peanut butter. Here we go. Oh no. Well, that was up there. You didn't tell me not to. I hope you're getting this. Scoop out two tablespoons of peanut butter with knife. That actually makes a pretty good spoon now. Spread evenly peanut butter on top side of one of the two slices. They were. Well, I placed them side by side, but due to physics they moved elsewhere. OK. OK, clean the knife. Almost done. Clean the knife, how? Four steps till we put you out of your misery. Oh god, no. It's E. coli. Clean the knife. Insert blade of knife into jelly. Scoop out two tablespoons of jelly with knife. Spread evenly jelly on top side of the slice with no peanut butter. See, it's nice like this, where distance ed is really looking better, isn't it? All right. And finally, match up slices so that peanut butter and jelly touch in the center evenly so that the edges match. So that the edges. Oh. All right. Well, a big round of relieved applause, however. All right. Do your thing, where you say hello everybody, and we wrap up. Good night, everybody. We will be in touch via email with the course's conclusion grades and all of that. But certainly, do feel free to linger if you have any questions tonight or want to chat. And many thanks to our volunteer tonight.