00:00:25 Karel and Java 00:02:00 Common Errors 00:07:05 Comments 00:11:12 Pre-conditions and Post-conditions 00:13:09 Decomposition 00:19:47 The DoubleBeepers example 00:36:26 Importance of Good Software Engineering 00:39:59 The Right Decomposition 00:44:08 The CleanUpKarel example
This professor is simply amazing. I am using a lot of different resources to learn Java right now, but his approach to teaching, especially with the top-down approach, is so simple and yet so elegant. We are blessed to have this lecture series for free on RUclips.
Thanks Mehran for making this so lighthearted and funner than it should be. You have a great gift for teaching. Programming is the only thing I haven't done with computers and I should have started programming years ago. I'm taking the plunge now (at 44) and I'm so glad I found you and your course. Many blessings to you and your family.
I have not had the time I wanted to do this. With work, toddlers, and attending college online, it is tough. My major is cybersecurity and programming is part of my curriculum, so I will be able to get back to it later. Thanks for asking.
+Invisiblefiyah Nobody would ever do anything if we were all to follow your logic. There are 7Billion people in the world.... a good part of which cannot even read or write.
Respect to Mehran Sahami He teach from basics and makes programming peace of cake, I wish I got lecture like him , ill score "A" in his subjects all students attend his classes should be thankful .
I have started programming without watching this video in the first place. At a result, I spent a lot of time fixing my program over and over. It was a huge waste of time!!!! THanks Prof!!!! This is a very value advice for me
cool i'm new at programming, do i need to download eclipse and write all the codes that were on the video? or do i just have to watch and get the lessons, I'm learning swift.
ummm it li literally impossible to learn without physically doing it. It's like math, you have to write down the problem and solve it in order to understand it. It doesnt matter if you are doing swift, most methods he teaches are used in all of the languages.
I hope when I go to a university I will have a professor like him. He gets the class laughing and he gives them candy for questions :D Not to mention he actually gets the lesson done perfectly.
Great professor that goes around many basic aspects of coding. He creatively utilizes Karole to convey the processes of [hard] to grasp keywords for beginners of Java in ways so linguistically simple. My freshmen professor just teaches theoretical without any practical examples, very difficult to implement.
It would have been interesting to see how I would have turned out if I could understand every second of a lecture from even a few of the classes I took during my bachelors program like I understand this class. It's interesting to be able to understand a class from start to finish. It makes for better learning! If only we didn't lose the emphasis on educating in education nowadays!
I go to the University of Phoenix Axia online and I only wish we had some kind of lecture videos or something like this. I am learning much from these videos! Thanks Stanford U and the Proffesor.
Al-Khawarzmy is an Iraqi scientist. He was born in IRAQ-Baghdad and he established Algebra subject as well as develop many methods in Math. and one of his method calls algorithm, and all his books had been translated from Arabic language to Latin and other languages.
I've just finished assignment 1, and I have to be honest: watching Karel move around his world until he ends up in the right place - one of the better feelings.
Valid question. The idea is to make a method for each, so if he needed to use them more than once for any reason, he could call it as many times as he wanted without rewriting the code every time.
@johnstonmatt it is in the import stanford.karel.* there are many libraries that have pre-defined words to use. It is kinda like a game engine for video games. Video games (provided it is the same engine that is used) have the same code for physics, lighting, ect...There is no point in writing all the code if it is something you are going to use often (with each new game) when you can just call it with the import function.
They are pretty similar although java does some things automatically. For example it has a "garbage collector" which means that it deletes the objects you create from classes automatically whereas in c++ you have to do it manually inside your program.Also c++ uses pointers that point cells in the memory for you variables something that in java is done automatically.
I liked the checkerboard assignment, there was more to it than you would think at first. If you do it, check that your answer works on a 1x1 world. (even tho the assignment doesn't explicitly say that it should, but it does imply it)
in the double beeper function --- Are you doing it this way to iterate the binary base of the math functions? Because it seems to me that the algorithm would be less memory intensive just to count the beepers, spit out a value, call on kerel, get the value of the count, double it, change kerel's number of beepers, move dump them off, move back.
You need to download the assignments as well. Then go to import project under the Stanford menu. When you run the project, you load Karel and its world.
Just a heads up, it's generally considered best practice to capitalize the first letter of class names and to lowercase the first letter of method names.
encounter a problem while run any program...dialup box-workspace doesnot contain a main type(do you have a public void run() method?) how can i handle this problem?
No, any method that is declared private can only be accessed by the class that it's placed in. If he were to move the method moveBackward() outside of the class he would have to mark it public to be able to access it by another class. Hope this helped.
i like how they give microphones to students asking questions, at first when the first question was asked in this video, i thought we just couldnt hear him.
@58kungfu If you click on the assignments page of the course website - its a zip file called assignment1 located near the bottom of the page. That contains karel.
So wait, could you just "move" and then use the for loop to put beeper 5 times and then move backwards? Wouldn't that remove a couple steps, or is there something I am not understanding?
Excellent lecture, but I have a beef with the last example in which cleaning is done in both directions. The completion conditional within the while loop does not always apply, thus necessitating the final "turnAround" command within the inner else{}. One should strive to eliminate such special conditions, if it is reasonably possible to do so, as they can hide bugs. In this example, instead of cleaning in both directions, a better solution would be to return to the west side of the next row.
QUICK QUESTION, I have recently downloaded the file to install karel on my pc. See the thing is is that im expecting to see an executable but thats not it. So i navigate through "eclipse" and direct it to open the folder karel but not having any luck. Am i missing something?
At 23:35 does it matter if he put private void moveBackward(); in the run class? Could he place the method outside of the class and it still be able to use the method?
Lecture 1: 466,768 views Lecture 2: 223,888 views Lecture 3: 115,468 views By lecture 10 there's 43,187 views and the final lecture has only 28,320 views. Hmmmmm...
Ok, so I'd LOVE it if I could follow along, however I have No Idea how to implement the acm package... So when I try compile any one of the projects, I get told that the acm classes are missing etc etc yada yada yada... How can I do an import like "import package.class" but with the acm stuff?
camelCase is standard.. private is for one class only(This is how java can "hide" data), public is for alllll... then you have all sort of classes and classes that abstract, inherit, and extend other classes ;)
is there a big difference between the pdf version of "the art and sience of java" book and the full original version? Will i be able to complete the course and understand all the details with the pdf preliminary draft of the book, or will i miss alot of detail if i don't read the final example of the book?
@ralusek I agree, i've tried other java tutorials like that where they start out with just one class and just the main class...the way this college teaches it, is 10x+ better :)
Eclipse downloads fine from the site, but when I try to open it, I get an error saying "JVM terminated. Exit code=1, /usr/bin/jva, etc. Anyone know what's going on?
Hi I had the same problem. What I did was is download both the Stanford version of Eclipse and the newest version of Eclipse from www.eclipse.org/downloads/ Then I pasted all the files from the features and plugin folders of the Stanford version into the fresh version of Eclipse. I also copied the startup.jar file over. Once you've loaded it up, you might get an error, just ignore that and follow the instructions of K"arel in Eclipse" as usual :)
Or you can download Oracle VirtualBox and create a virtual machine on your computer and load Windows XP SP3 on it. Then install Java 1.6 and the Stanford Eclipse version and just do all your work within the virtual machine. This was the avenue I took as Stanford's Eclipse client is not compatible with Windows 8.1 x64 even using the Compatibility Settings. Took me 30 minutes to go from downloading and installing Oracle VirtualBox to having the OS and programs installed and up and running.
alright, so can somebody please help me out here? in the last program that he teaches, Karel cleans up the last row while it faces East so: 1. the left would be blocked so it already breaks out of the loop and it doesn't go into the Else part of that condition. 2. if the world happens to have one more street then Karel would have to end cleaning the last row while moving Westwards, and then only I notice that TurnAround(); comes into action. So is this program written in more like a generalized manner so that Karel can do the same job in all types of world environment? Because in that specified world the program never goes into that Else statement. Am I right or wrong? Please correct me if I'm wrong I'm a little confused there. Thanks a lot of reading this through. -Sandip.
@Vaughnlesterinoz: I'm new to this this too, and I get top down design a bit, but this guy does some really nice abstractions in that doubleBeepers program. Nothing like I wrote before looking at the solution (mine is more like in the book).
Did you do all the steps described in the "05-downloading-eclipse.pdf" and "06-karel-in-eclipse.pdf"? I recommend you to delete Java and your current eclipse version and try it again step by step with the pdf-guides.
00:00:25 Karel and Java
00:02:00 Common Errors
00:07:05 Comments
00:11:12 Pre-conditions and Post-conditions
00:13:09 Decomposition
00:19:47 The DoubleBeepers example
00:36:26 Importance of Good Software Engineering
00:39:59 The Right Decomposition
00:44:08 The CleanUpKarel example
Thanks
Thanks steve.
thanks
In less than two hours total, my look at programming changed completely: now it all makes sense.
Mad props for Stanford, and the professor!
hey how you doing lol 11 years passed are you a programmer?
This professor is simply amazing. I am using a lot of different resources to learn Java right now, but his approach to teaching, especially with the top-down approach, is so simple and yet so elegant. We are blessed to have this lecture series for free on RUclips.
Thanks Mehran for making this so lighthearted and funner than it should be. You have a great gift for teaching. Programming is the only thing I haven't done with computers and I should have started programming years ago. I'm taking the plunge now (at 44) and I'm so glad I found you and your course. Many blessings to you and your family.
Todd Foster how have you come along in these two years? I'm starting up now myself 😀
I have not had the time I wanted to do this. With work, toddlers, and attending college online, it is tough. My major is cybersecurity and programming is part of my curriculum, so I will be able to get back to it later. Thanks for asking.
Mehran Sahami is my new favorite professor.
It's sad that not all professors at research universities are like this guy. This guy is amazing.
Andrew Mendonca some TEACHERS are lazy!!
c'mon Stanford, we need more Mehran online
seppukusayonara he actually taught me computer programming from my bedroom, when i was eight. Love this guy haha
VivaLaMikey when you were FUKING EIGHT!?!? I'm 20...why the fuk should I even learn programming if you're 8 and you already know more then me....
+Bruce Wayne yeah just give up. youre too late and not worth it
+Invisiblefiyah Nobody would ever do anything if we were all to follow your logic.
There are 7Billion people in the world.... a good part of which cannot even read or write.
checkin for all the 2024 students out there watching these works of art!
After a year of private study, this is my favorite programming video so far.
What do u do now?
Finally, I'm beginning to understand! What an awesome teacher.
Respect to Mehran Sahami
He teach from basics and makes programming peace of cake,
I wish I got lecture like him , ill score "A" in his subjects
all students attend his classes should be thankful .
Man, this professor is amazing!
Funny, knowledgeable, well spoken *and* can present computer concepts in an interesting, fun way!
I have started programming without watching this video in the first place. At a result, I spent a lot of time fixing my program over and over. It was a huge waste of time!!!! THanks Prof!!!! This is a very value advice for me
cool i'm new at programming, do i need to download eclipse and write all the codes that were on the video? or do i just have to watch and get the lessons, I'm learning swift.
Same here. Solved the Checkerboard problem but after a lot of hassle, declaring integers and booleans and what not. Doing it again.
ummm it li literally impossible to learn without physically doing it. It's like math, you have to write down the problem and solve it in order to understand it. It doesnt matter if you are doing swift, most methods he teaches are used in all of the languages.
need an HD VERSION!
I hope when I go to a university I will have a professor like him. He gets the class laughing and he gives them candy for questions :D Not to mention he actually gets the lesson done perfectly.
at 26:00 he is exactly right, I've finally understood that I have to learn fundamentals and I'm screaming inside "THAT FUNCTION WASN'T DEFINED!" XD
Great professor that goes around many basic aspects of coding. He creatively utilizes Karole to convey the processes of [hard] to grasp keywords for beginners of Java in ways so linguistically simple. My freshmen professor just teaches theoretical without any practical examples, very difficult to implement.
While front is clear, keep learning. What a fabulous professor.
Best lecture for learning programming methodology in java !! 5 star :D tysm sir
sahami makes my days happier.
Thank you, Professor Sahami! These lectures are excellent, and still helpful all of these years later, in 2022!
would love it if he was my teacher
Took the words right out of my mouth.
He is your teacher and of million others and even better than going to class because you can rewind.
+danial pun obviously not, do you get candy or not? DO YOU GET CANDY OR NOT? (which was probably meant for someone else)
It would have been interesting to see how I would have turned out if I could understand every second of a lecture from even a few of the classes I took during my bachelors program like I understand this class. It's interesting to be able to understand a class from start to finish. It makes for better learning! If only we didn't lose the emphasis on educating in education nowadays!
agreed!!!!
Prof. Mehran knows how to keep his student focus.....great lecture.
.
I am learning online from other side of the planet And Professor already giving me diabetes , BTW very exciting class.
This professor is amazing. He makes it easy for simple minded people to even understand
I go to the University of Phoenix Axia online and I only wish we had some kind of lecture videos or something like this. I am learning much from these videos! Thanks Stanford U and the Proffesor.
Waw.... This Professer Meharan is Amazing. Thank you Stanford for making it possible for every one. I wanna master Java.
I so wish there was a way to ask questions to Prof. Mehran, or to students/TAs in his class... I wouldn't even mind paying for this.
thanks Stanford for making this possible. Now anyone in the whole world with the internet can view high quality lessons.
thanks to Stanford and to the professor for making wordclass educational sessiosn available for everyone in this world!
Mehran RULES! I was in his class when I was at Stanford (a long time ago)
Best professor in programing so far in my life experience ! Great time watching these
intro to programming and diabetis
Sugar isn't the cause of diabetes but you crave sugar if you are diabetic.
Axl Chavatt LOL.
Oh wow, I just got to the third video and I made a comment on the 2nd video that was very similiar.
@@dg-hughes You're completely ignorant.
This is surely coincidence with you and me for some reason
now that`s what I call a proper professor
Slingshots work great for the back row....just a suggestion.
this guys teaching skills are on point
Al-Khawarzmy is an Iraqi scientist. He was born in IRAQ-Baghdad and he established Algebra subject as well as develop many methods in Math. and one of his method calls algorithm, and all his books had been translated from Arabic language to Latin and other languages.
I've just finished assignment 1, and I have to be honest: watching Karel move around his world until he ends up in the right place - one of the better feelings.
Valid question. The idea is to make a method for each, so if he needed to use them more than once for any reason, he could call it as many times as he wanted without rewriting the code every time.
Very good instructor. He is very knowledgeable and also very entertaining.
@johnstonmatt it is in the import stanford.karel.* there are many libraries that have pre-defined words to use. It is kinda like a game engine for video games. Video games (provided it is the same engine that is used) have the same code for physics, lighting, ect...There is no point in writing all the code if it is something you are going to use often (with each new game) when you can just call it with the import function.
Anybody know why when I try and run my program in Eclipse it can't load a Karel world? Help!
New to programming and this lesson helped a lot in how to approach problems. thanks!
Man i would love su much to be there.... :D
Thank you for this Stanford.
They are pretty similar although java does some things automatically. For example it has a "garbage collector" which means that it deletes the objects you create from classes automatically whereas in c++ you have to do it manually inside your program.Also c++ uses pointers that point cells in the memory for you variables something that in java is done automatically.
anyone found the SteepleChase program?
i only have CheckerBoardKarel, CollectNewspaperKarel, MidpointFindingKarel, and StoneMasonKarel
Great lecture from Professor Mehran. Thanks Stanford for sharing.
I liked the checkerboard assignment, there was more to it than you would think at first.
If you do it, check that your answer works on a 1x1 world. (even tho the assignment doesn't explicitly say that it should, but it does imply it)
I think the difference between specific classes is much bigger than the difference between Netherland and US culture, regarding asking questions.
Great programming in general theory, what an amazing teacher.
in the double beeper function --- Are you doing it this way to iterate the binary base of the math functions? Because it seems to me that the algorithm would be less memory intensive just to count the beepers, spit out a value, call on kerel, get the value of the count, double it, change kerel's number of beepers, move dump them off, move back.
Was thinking the same thing lml
Ng Jit did you finish watching the video? there was a whole section explaining it.
Ya I did
WOW....simply outstanding ! thnx STANDFORD ..
You need to download the assignments as well. Then go to import project under the Stanford menu. When you run the project, you load Karel and its world.
Just a heads up, it's generally considered best practice to capitalize the first letter of class names and to lowercase the first letter of method names.
encounter a problem while run any program...dialup box-workspace doesnot contain a main type(do you have a public void run() method?) how can i handle this problem?
No, any method that is declared private can only be accessed by the class that it's placed in. If he were to move the method moveBackward() outside of the class he would have to mark it public to be able to access it by another class. Hope this helped.
i like how they give microphones to students asking questions, at first when the first question was asked in this video, i thought we just couldnt hear him.
@58kungfu If you click on the assignments page of the course website - its a zip file called assignment1 located near the bottom of the page. That contains karel.
Mehran has the best sense of humour!
He is such a nice professor. I love watching him :)
Do you want to code or build? That pretty much sums it up.
I love watchinghim, too.He is really a good professor
So wait, could you just "move" and then use the for loop to put beeper 5 times and then move backwards? Wouldn't that remove a couple steps, or is there something I am not understanding?
I've tried the first assesment. Problem is, when I want to run it, it says the source attachment does not contain the source for file Karel.class
will it slow down your code if you have too many decompositions?
Excellent lecture, but I have a beef with the last example in which cleaning is done in both directions.
The completion conditional within the while loop does not always apply, thus necessitating the final "turnAround" command within the inner else{}.
One should strive to eliminate such special conditions, if it is reasonably possible to do so, as they can hide bugs.
In this example, instead of cleaning in both directions, a better solution would be to return to the west side of the next row.
شكرا علي هذا الشرح it's very great
QUICK QUESTION, I have recently downloaded the file to install karel on my pc. See the thing is is that im expecting to see an executable but thats not it. So i navigate through "eclipse" and direct it to open the folder karel but not having any luck. Am i missing something?
At 23:35 does it matter if he put private void moveBackward(); in the run class? Could he place the method outside of the class and it still be able to use the method?
When i finish this series, im putting on my resume that i took java from Stanford...
Can we use integers in the MidpointFindingKarel Problem?
Maruth goyal I'm probably a bit too late but you don't need to use integers for that problem. It's possible with an algorithm
O jeito que o professor ensina faz com que o aluno aprenda com mais facilidade.
if every programming institution could teach like this,pple wount be scared to learn programming.
Can anyone tell me the name of the manufacturer that was producing the "infinite loop execution in 2.5 secs" microchips?
Linux
Thank you Mr Sahami.
please help, what handout am i supposed to be on in this video and should i have completed all of assignment 1 already?
42:30 check these things when building a program
These videos need to be remastered!
@Lemon77UG That happens to any video on RUclips that has a series. Also this professor seems chill.
Lecture 1: 466,768 views
Lecture 2: 223,888 views
Lecture 3: 115,468 views
By lecture 10 there's 43,187 views and the final lecture has only 28,320 views.
Hmmmmm...
Oh my god ...this comment is 9 years ago....I wonder what u r doing now..🤔
Me too 😂
Ok, so I'd LOVE it if I could follow along, however I have No Idea how to implement the acm package... So when I try compile any one of the projects, I get told that the acm classes are missing etc etc yada yada yada...
How can I do an import like "import package.class" but with the acm stuff?
camelCase is standard.. private is for one class only(This is how java can "hide" data), public is for alllll... then you have all sort of classes and classes that abstract, inherit, and extend other classes ;)
is there a big difference between the pdf version of "the art and sience of java" book and the full original version? Will i be able to complete the course and understand all the details with the pdf preliminary draft of the book, or will i miss alot of detail if i don't read the final example of the book?
@ralusek I agree, i've tried other java tutorials like that where they start out with just one class and just the main class...the way this college teaches it, is 10x+ better :)
If the lecture was in 3D, then everyone watching this at home would be busy catching those candies
@Jackconner
did you download the assignment zip files?
can not see projector screen from computer clearly.
How can get the handouts that students in this class receive?For study purpose. Studying from home here. thanks
Eclipse downloads fine from the site, but when I try to open it, I get an error saying
"JVM terminated. Exit code=1, /usr/bin/jva, etc. Anyone know what's going on?
Hi I had the same problem.
What I did was is download both the Stanford version of Eclipse and the newest version of Eclipse from www.eclipse.org/downloads/
Then I pasted all the files from the features and plugin folders of the Stanford version into the fresh version of Eclipse. I also copied the startup.jar file over.
Once you've loaded it up, you might get an error, just ignore that and follow the instructions of K"arel in Eclipse" as usual :)
Or you can download Oracle VirtualBox and create a virtual machine on your computer and load Windows XP SP3 on it. Then install Java 1.6 and the Stanford Eclipse version and just do all your work within the virtual machine. This was the avenue I took as Stanford's Eclipse client is not compatible with Windows 8.1 x64 even using the Compatibility Settings. Took me 30 minutes to go from downloading and installing Oracle VirtualBox to having the OS and programs installed and up and running.
alright, so can somebody please help me out here? in the last program that he teaches, Karel cleans up the last row while it faces East so:
1. the left would be blocked so it already breaks out of the loop and it doesn't go into the Else part of that condition.
2. if the world happens to have one more street then Karel would have to end cleaning the last row while moving Westwards, and then only I notice that TurnAround(); comes into action.
So is this program written in more like a generalized manner so that Karel can do the same job in all types of world environment? Because in that specified world the program never goes into that Else statement.
Am I right or wrong? Please correct me if I'm wrong I'm a little confused there. Thanks a lot of reading this through.
-Sandip.
@Vaughnlesterinoz: I'm new to this this too, and I get top down design a bit, but this guy does some really nice abstractions in that doubleBeepers program. Nothing like I wrote before looking at the solution (mine is more like in the book).
Does he still teach at Stanford?
+LifeMushroom Yes he does
+Mizrahy Aquino How about now?
Still does. Not over summer I think
Thanks
How about now?
at ttodhe the video's are available at the stanford website, search standford engineering everywhere
Where can I find the assignments?
my dream is to go to stanford and if teachers are this good i am so going there
Where can we find the handouts and packages if not attending Stanford?
see.stanford.edu/see/lecturelist.aspx?coll=824a47e1-135f-4508-a5aa-866adcae1111
cs.stanford.edu/people/eroberts/courses/cs106a/handouts/
I love the way he refers to infinite loops. I never rationalized the shampoo instructions as an Infinite loop....
Did you do all the steps described in the "05-downloading-eclipse.pdf" and "06-karel-in-eclipse.pdf"? I recommend you to delete Java and your current eclipse version and try it again step by step with the pdf-guides.
One thing I see what differs with my programming classes in the Netherlands is, the students ask more questions in America.