The moment with the DDB was hands down my favorite moment so far in these lectures. So relatable and David’s reaction was honestly adorable 😅 so he is human too…
i was an absolute beginner when i started cs50 and i think that if you care about the subject and are willing to put in the time and effort, then you can do it! it’s bound to be hard, but just keep going yk?
after every lecture i watch, i tend to think to myself how i would've coped if i was a complete beginner. even with a year of coding, this course is hard
I was a complete beginner when I took this course 2 years ago. I don't think it's that hard. In fact because of it, I fell in love with Computer science and now I'm half way through my degree.😊
6:36 This is actually a very good definition for a so-called "framework" that I never really thought about before. It's not just third-party code. But it's third-party conventions as well. Which means you may have to learn a whole new syntax, etc.
~1:23:00 That was very rich. I admire David's humor and candor in that moment, and appreciate how I'd have done exactly as he did- Googling then Ducking for an answer!
If you are following this at home your won't have access to the same environment as David. Advisable to create virtual environment in 'hello' and run flask that way. Django would have been nice but DM's teaching is world class.
Using the CS50 duck was nice... But I'm surprised I haven't seen more use of the built-in help function? I don't think it's even been mentioned once? Could be wrong though. Very easy to use, for example, in the terminal just use >>> help(print) at the prompt. Will tell you everything you need to know about the print function and all its parameters. Same thing for any other object such as a class, function/method, module, list, dict, str, int, etc. Plus, there's code completion in VS Code or simple dot notation with documentation pop-ups. Has all of that been disabled? Knowing how to access and read documentation is a skill every developer or programmer needs to know.
There are two problems with the code presented in the lecture in the froshims section. Firstly, David's code uses request.form.getall which does not work in the current CS50 ide. You need to use request.form.getlist instead. Secondly, "Ultimate Frisbee" gives an error when a loop is used to check the sports with {{sport}}. To make it work you need to use "{{sport}}" instead.
i faced some trouble with the cart app, the session["cart"] is that holds the list containing the id's of books added to the cart isn't working, after debugging and printing the values i always find myself passing an empty list to the cart.html, i tried to figure what's going on and found out that the Sqlite command to books = db.execute("SELECT * FROM books WHERE id IN (?)", session["cart"]) didn't want to work, it seems that the syntax somehow wrong and even chatgpt told me that maybe sqlite is expecting multiple "?" to process the list and not only one "?" to use the list, but for professor David it's working fine, note: i didn't implement the logic manually i literally downloaded the file src9, any idea guys ?
i found the solution, i will post it here if someone got stuck with this problem, after debugging and adding another list of my own, like this : if book_id: session["cart"].append(book_id) list_test.append(book_id) , i noticed that session["cart"] didn't add all the id's appended to it but list_test had all the values in it, so it was a problem of consistency from session["cart"], the solution after explaining the issue to duck debugger was to add this line : session.modified = True | after appending to the session["cart"] , it seems that this line just tells flask that the session got some new changes. i'm using flask on my local machine and running the server on my windows not codespace so probably that's the issue.
I faced the same problem. Another way to solve it is to change this line of code from: session["cart"].append(book_id) to: cart = session["cart"] cart.append(book_id) session["cart"] = cart It's not the best solution, but it works
Strangely, I had the same error and chat gpt gave me the same answer as "Flask only tracks changes if you reassign the modified list back to session["cart"]." but my error was writing : if cart not in session: instead of if "cart" not in session: Now it works like in the course
Can anyone please tell me why cs50 thought of teaching Flask rather than Django? Do more people use Django nowadays? Are there any frameworks better than flask and django, and was this just to teach the basics? Anyways, I really enjoyed the class
flask is a microframework and is simple than django. i think cs50 opted flask so that it doesnt overwhelm the students but teaches the fundamentals, get the job done. tbvh for me this was very intense, imagine how it would be for django. and also coming to frameworks which are better is a subjective topic ig!
Really wish you would've introduced the label tag, instead of using the placeholder-attribute, which is kind of terrible for multiple UX and accessibility reasons 😟
I have a question about the last bit of this lecture. Since he got rid of the template search.html and just returned the jsonified list of shows, at what point does the json file get iterated over and converted into a list with the titles of the movies? I'm assuming version 3 of shows has an extra piece of code at index.html that does that, right?
Yeah, i had to download the src material to see that on index.html these lines are added inside of the for loop (it sanitizes the title to prevent HTML injection) : let title = shows[id].title.replace('
app = Flask(__name__) Is this calling a function or creating an object from the class Flask? Can someone explain this, please? (on minute 12:22 more or less)
Ok I found this so now I understand that better: In Python, classes can be callable, which means they can behave like functions when called. When you use Flask() in Flask, you're actually calling the Flask class, which acts as a constructor function to create a new instance of the Flask application. So, to clarify, Flask() is both a class and a function. It's a class because it defines the blueprint for Flask applications, and it's a function because you use it to instantiate objects of that class.
Unless I'm mistaken, it's because Flask uses Jinja as a template engine. Jinjas syntax uses double brackets while python only singular. But double check the jinja documentation so im not lying to you lol
I also suspect that a little bit. Because they are so prepared for everything, like every tiny detail to be mentioned is included in the slides and the code. Even the mistakes are intentionally designed so that David can teach the process of improving code instead of impossibly trying to get it perfect the first time. So, I have no reason to believe that they hadn't actually worked it all before and it accidentally was mistyped in his printouts. But still can't rule out the other possibility cuz we are all humans. (Somebody ask CS50 staff. I am curious!)
I also think the same. Even though there exist so many platforms where you could debug errors, the team wants us to use the duck instead of other platforms which would limit taking help everytime. That was pre-planned for sure !
Seeing David use the duck made me realize I’m not alone. Such a real moment Love this course so much.
when does he do that?
@@ProgrammerPenguin 1:22:42
@@lintz_lin thanks for replying so quickly and also that's funny as hell.
I know right, students need to see you are both godlike and with human flaw, for them to be inspired.
The moment with the DDB was hands down my favorite moment so far in these lectures. So relatable and David’s reaction was honestly adorable 😅 so he is human too…
This is the big reckoning, so much is connecting together. My head hurts but I am not giving up this far.
This is the way.
I just looked at Problem Set 9 Finance and it truly does all come together. Quite overwhelming
Keep it up and enjoy every minute of it...❤
great class... definitely not for beginning beginners but more for advanced beginners
i was an absolute beginner when i started cs50 and i think that if you care about the subject and are willing to put in the time and effort, then you can do it! it’s bound to be hard, but just keep going yk?
At. 1:22:47 LOL. He is Human!!! I have never loved him more than at that moment! Thank you for what you do, David!
Duck >> Stack Overflow > glance at the audience for help
If something like "this is a lot to process" hits you after watching the lecture, I can say, assertively, you are not alone.
it may seem like a 3 hr video but actually it's so long when you start watching
Thank you for that.
This man is a legend and the best teacher that I found till now...
Lots of love and respect to prof. David J. Malan and the entire team of CS50
It was nice to see the maestro get flustered but gracefully demo his googling / prompting. That hunch and deep breath was not giving staged 😂
🎉 completed. This is awesome intro for flask begginers. THANK YOU 🙏🙏
after every lecture i watch, i tend to think to myself how i would've coped if i was a complete beginner. even with a year of coding, this course is hard
this course is really easy
just no@@prcvl
I was a complete beginner when I took this course 2 years ago. I don't think it's that hard. In fact because of it, I fell in love with Computer science and now I'm half way through my degree.😊
@@prcvlthis was a productive and positive comment. this is the kind of comment that makes people value your input and become your friend.
i came from the odin project - the insight this course provides is the difference between blind flailing and planned execution
The real Flask course!
"Let me go ahead and PROPOSE that...." Bingo! Classic David. I wish we had Profs like DM when I was at school.
David is so good that even when he messes up, people still like it
Thank you team @CS50
ok this really fried my brain. Thank you for the efforts, will need to let that sink in.
I’m really thankful for this class. It really feels like I am part of the class and that duck debugger moment get so relatable
6:36 This is actually a very good definition for a so-called "framework" that I never really thought about before. It's not just third-party code. But it's third-party conventions as well.
Which means you may have to learn a whole new syntax, etc.
Thanks once again for an amazing and helpful content. Cheers to 2024 🎉
Every lesson fulfills my brain with so much information and this is no exception.
~1:23:00 That was very rich. I admire David's humor and candor in that moment, and appreciate how I'd have done exactly as he did- Googling then Ducking for an answer!
Awesone Video . Simultaneously coding helps to understand the concept
Do you use fuel monitor.
Excellent course quality aside. Is anyone else obsessed with the soundtrack (intro)?
present
love cs50 flask
Here i was thinking that i was doing crazy stuff with bootstrap last week.
That’s the lecture here. A lot but interesting ❤
hardest part of the all lecture imo
So much energy! Thank you.
Почему так много людей пишет, что курс сложный?!) Я программирую пару месяцев и этот курс выглядит максимально понятным и доступным для всех!
Another high quality lecture🙏🏽
"RALLRIGHT, any other questions this far on this...?" some of David's phrases just stick in your head lol thanks for this course!!
If you are following this at home your won't have access to the same environment as David. Advisable to create virtual environment in 'hello' and run flask that way. Django would have been nice but DM's teaching is world class.
I got a little lost in this episode, I think it was the Jinja stuff. The duck saving the day was amazing.
I love the moment of David with DDB 😂 He was honest and adorable and It's what all devs do when they get stuck 😂
1:22:40 Love it. 🦆
Just....Awesome!!
Many thanks
Using the CS50 duck was nice...
But I'm surprised I haven't seen more use of the built-in help function? I don't think it's even been mentioned once? Could be wrong though.
Very easy to use, for example, in the terminal just use >>> help(print) at the prompt. Will tell you everything you need to know about the print function and all its parameters. Same thing for any other object such as a class, function/method, module, list, dict, str, int, etc.
Plus, there's code completion in VS Code or simple dot notation with documentation pop-ups. Has all of that been disabled?
Knowing how to access and read documentation is a skill every developer or programmer needs to know.
Profesor is hilarious 😂
Cheers !
Something weird happens at 50:27
AI generated David!🤣
I knew he would be an alien or sum cause my teachers didn't teach as he does.
Finally got here, thanks god!
Привет из Ленинградского государственного университета 🤙
I'm going to make it 🔥🔥🔥🔥🔥
There are two problems with the code presented in the lecture in the froshims section. Firstly, David's code uses request.form.getall which does not work in the current CS50 ide. You need to use request.form.getlist instead. Secondly, "Ultimate Frisbee" gives an error when a loop is used to check the sports with {{sport}}. To make it work you need to use "{{sport}}" instead.
This is helpful ❤
Thank you.
Understood++
This was the last one? great content, btw
4th comment? also thanks cs50, amazing course from which I have learned a lot
i faced some trouble with the cart app, the session["cart"] is that holds the list containing the id's of books added to the cart isn't working, after debugging and printing the values i always find myself passing an empty list to the cart.html, i tried to figure what's going on and found out that the Sqlite command to books = db.execute("SELECT * FROM books WHERE id IN (?)", session["cart"]) didn't want to work, it seems that the syntax somehow wrong and even chatgpt told me that maybe sqlite is expecting multiple "?" to process the list and not only one "?" to use the list, but for professor David it's working fine, note: i didn't implement the logic manually i literally downloaded the file src9, any idea guys ?
i found the solution, i will post it here if someone got stuck with this problem, after debugging and adding another list of my own, like this : if book_id:
session["cart"].append(book_id)
list_test.append(book_id) , i noticed that session["cart"] didn't add all the id's appended to it but list_test had all the values in it, so it was a problem of consistency from session["cart"], the solution after explaining the issue to duck debugger was to add this line : session.modified = True | after appending to the session["cart"] , it seems that this line just tells flask that the session got some new changes. i'm using flask on my local machine and running the server on my windows not codespace so probably that's the issue.
I faced the same problem. Another way to solve it is to change this line of code from:
session["cart"].append(book_id)
to:
cart = session["cart"]
cart.append(book_id)
session["cart"] = cart
It's not the best solution, but it works
Strangely, I had the same error and chat gpt gave me the same answer as "Flask only tracks changes if you reassign the modified list back to session["cart"]." but my error was writing :
if cart not in session:
instead of if "cart" not in session:
Now it works like in the course
Continuing the lecture I see he fixed the request.form.getlist problem, but the second problem remains.
My last week 🎉🎉🎉🎉😂
这个教程真的很牛逼
Can anyone please tell me why cs50 thought of teaching Flask rather than Django? Do more people use Django nowadays? Are there any frameworks better than flask and django, and was this just to teach the basics? Anyways, I really enjoyed the class
flask is a microframework and is simple than django. i think cs50 opted flask so that it doesnt overwhelm the students but teaches the fundamentals, get the job done. tbvh for me this was very intense, imagine how it would be for django. and also coming to frameworks which are better is a subjective topic ig!
🎉🎉🎉🎉 feeling happy finally got finance done and got 21 /21. Thanks @david J.Malan
the DDB moment was so damn funny hahah
Really wish you would've introduced the label tag, instead of using the placeholder-attribute, which is kind of terrible for multiple UX and accessibility reasons 😟
very great
And I thought week 8 was tough...good lord.
Its hard, Its useful to make projects and use every new thing that you learn in this week. Practice everythig ;)
I have a question about the last bit of this lecture.
Since he got rid of the template search.html and just returned the jsonified list of shows, at what point does the json file get iterated over and converted into a list with the titles of the movies? I'm assuming version 3 of shows has an extra piece of code at index.html that does that, right?
Yeah, i had to download the src material to see that on index.html these lines are added inside of the for loop (it sanitizes the title to prevent HTML injection) :
let title = shows[id].title.replace('
@@usuariodefectuoso4046 Yeah, I was able to find the answer in the notes as well!
01:40:00
done
1:03:55 can't you use base64 and assign an id to get Sports in hex and css the id tag?
Coming here to prep for my interview next week for django web dev. I know im gonna learn alot and be entertained.
hopefully you know this by heart if you're going to apply for a webdev job :S
How did it go?
how did it go?
@@kidzeeplier2468 guess OP lost all hope and moved into the wilderness.
@@Hillgrov and..he was never seen again.
01:22:00 wow. I can estimate the amount of sweat drip down his back while his code is not working in front of hundred of students.😅
👍👍👍
had to watch this at 0.9 speed LOL 😅
1:10:58 As soon as you put a web application on the internet, bad things will happen to it! 😂
So true!
in my virtual workplace " flask run" give me an error in a web page 🙄
Yup me too
2:05:35 not working for me. Any solution!
I wonder if Yale will add the term "boilerplate" to their Bingo card
app = Flask(__name__) Is this calling a function or creating an object from the class Flask? Can someone explain this, please? (on minute 12:22 more or less)
Ok I found this so now I understand that better:
In Python, classes can be callable, which means they can behave like functions when called. When you use Flask() in Flask, you're actually calling the Flask class, which acts as a constructor function to create a new instance of the Flask application. So, to clarify, Flask() is both a class and a function. It's a class because it defines the blueprint for Flask applications, and it's a function because you use it to instantiate objects of that class.
42:00
❤❤
If only there was a language that could do this kind of server side rendering lol
Anyone know how to open a terminal after I accidentally close all the terminal?
Click Open in integrated terminal after u right click any file in ur vsc.
@@boncoderz1430 Thank you!!
How come in the shows part, the html placeholder is {{show}} while in the app.py file the variable is show(singular) and it still works?
Unless I'm mistaken, it's because Flask uses Jinja as a template engine. Jinjas syntax uses double brackets while python only singular. But double check the jinja documentation so im not lying to you lol
Help me i don't know what i need to remember
1:01:16 his voice xD
2nd comment?
Why they using flask ? Why not FastApi
Flask is better
Flask is simpler for students to understand as many of us are beginners who are taking CS50 as their first course.
It's always strange when people act like they know more then the teacher. The entire course curated the way it is for a reason.
What a good duck. 😄
But... CS50's staff is smarter than this. I'm sure it was all made up just to show the AI off. 😂
If that's the case, David deserves an Oscar. It was the most believable acting I've ever witnessed...
(stop it. humans make mistakes.)
I also suspect that a little bit. Because they are so prepared for everything, like every tiny detail to be mentioned is included in the slides and the code. Even the mistakes are intentionally designed so that David can teach the process of improving code instead of impossibly trying to get it perfect the first time.
So, I have no reason to believe that they hadn't actually worked it all before and it accidentally was mistyped in his printouts.
But still can't rule out the other possibility cuz we are all humans. (Somebody ask CS50 staff. I am curious!)
I also think the same. Even though there exist so many platforms where you could debug errors, the team wants us to use the duck instead of other platforms which would limit taking help everytime. That was pre-planned for sure !
40:05 what happen with these people, they dont ask question having the opportunity of be with this guy face 2 face........