COMP1010
5.4 Web Apps: Cookies
What Are Cookies?
Data
Stored on the user's computer
Sent back and forth inside the HTTP header
What Are Cookies Used For?
Session management
Sim Mautner changed 4 months agoSlide mode Like Bookmark
COMP1010
5 Web Application Development
5.2 Web Servers and Flask
Recap
Previously on COMP1010:5.0 Overview: we discussed the role of web browsers and web servers in running a web application.
5.1 HTML: we learnt how to write HTML to create a web page.
But:
Our forms don't do anything.
Sim Mautner changed 4 months agoSlide mode Like Bookmark
COMP1010
5 Web Application Development
5.3 Web Servers and Flask
Recap
Previously on COMP1010:5.0 Overview: we discussed the role of web browsers and web servers in running a web application.
5.1 HTML: we learnt how to write HTML to create a web page.
But:
Our forms don't do anything.
Sim Mautner changed 4 months agoSlide mode Like Bookmark
I've received more questions than I will have time to answer during Friday's lecture. This is great. In order to maximise answers and lecture time, I've separated the questions into 3 main categories:
Quick answers: Questions I can answer quickly and easily in writing in this document so don't need to spend lecture time on them (unless there are follow-up questions).
To address in the lecture: These questions I'll prioritise answering during the lecture on Friday 4th August.
Provide resources: These are often bigger or more vague questions. Or questions I feel have already been answered during the course. For these questions I'll provide links to where it's been covered already in our lectures and/or some external resources to help you find your answers. Any follow-up questions on this material are welcome!
Please note that this document is a work-in-progress. For example, I haven't actually put the resources in the "provide resources" section at the time of sharing this document with students. I will continue to fill it out over the course of Thursday evening and maybe Friday morning too. I will also check back at the questions being submitted and add them to this list.
To submit questions, fill out the form provided here.
Sim Mautner changed 2 years agoView mode Like Bookmark
When installing flask and phytml, I get the error message: "The term 'pip3' is not recognized..." How do I fix this?
Windows: <a class="notion-link-token notion-enable-hover" href="https://www.liquidweb.com/kb/install-pip-windows/" rel="noopener noreferrer" target="_blank">https://www.liquidweb.com/kb/install-pip-windows/</a>
Mac: <a class="notion-link-token notion-enable-hover" href="https://www.geeksforgeeks.org/how-to-install-pip-in-macos/" target="_blank">https://www.geeksforgeeks.org/how-to-install-pip-in-macos/</a>
Sim Mautner changed 2 years agoView mode Like Bookmark
COMP1010
1.1 - Admin - Course Introduction
Who Am I?
Sim Mautner (they/them).
Tutor and lecturer... different subjects... COMP and INFS... since 2008.
Martial arts (Brazilian Jiu Jitsu)
My attempt at drawing from YouTube videos...
drawing drawing
Sim Mautner changed 2 years agoSlide mode Like Bookmark
COMP1010 Lab Book: Web Apps
Assumed Knowledge
Before starting this lab book, it is assumed that you have a solid understanding of COMP1010 Topic 3 (Python and Programming Fundamentals).
Instructions
Unless otherwise specified, the following instructions apply to the whole of this lab book.
All questions must be implemented using Python in Flask. It is recommended that you use PyHTML, but not essential.
You may not use render_template.
Every file submitted must include your name and student number in a comment at the top of your file above your import statements.
Sim Mautner changed 2 years agoView mode Like Bookmark
COMP1010
Git - What is it and why do we use it
It is a distributed version control system.
It saves each change to a folder (or select files and folders within it) online.
For each change made to the project, it allows us to see:exactly what changes were made (which lines were added, removed, altered)
the date and time that the changes were committed to the system
who made the changes
We use it in COMP1010 because:
Sim Mautner changed 3 years agoView mode Like Bookmark
COMP1010
4 Python in the Real World
Moving away from Colab
To make our own websites, we need a bit more flexibility than Colab can give us.
Set up your computer by following the instructions in the course notice.
Example
You can convert any of our programs so far.
Crochet example
Sim Mautner changed 3 years agoSlide mode Like Bookmark
Installing Python
For the latter part of this course, we will be building more complex programs than can't be written in Python Notebooks. For this reason, you will need to have a Python interpreter and a source-code editor installed on your computer. Fortunately, both of these things are available for free and can be installed relatively easily.
For this course, we recommend using the Python interpreter available from python.org and Visual Studio Code as a source-code editor. However, if you have gotten a Python interpreter from somewhere else, or a have different source-code editor you prefer, you can use them if you wish. We encourage you to do whatever you are comfortable with.
Overview
These instructions describe generally what needs to be done to install Python and Visual Studio Code. In most cases, we expect them to work as is, but it always possible that there is something particular about your computer that causes them not to work properly. If you have any problems you can post a comment below or talk to your tutor during your lab.
Windows
Download <a href="https://python.org/">Python 3.9.7 from python.org </a>. If you hover over the 'Download' button in the menu, it should give you a button to download the right version of Python for your operating system.
Sim Mautner changed 3 years agoView mode Like Bookmark
COMP1010
1.1 - Admin - Course Introduction
Quick Announcement: Class Sizes
Move to the Tuesday 3pm if you can.
(Until the numbers in each tutorial are more equal. You can check class sizes here.)
Smaller class sizes means more tutor-student attention.
Quick Announcement: Catch Up Lectures
Extra lecture(s) on Thursday 10am-12pm and maybe 2pm-4pm.
Who will be able to come?
Sim Mautner changed 3 years agoSlide mode Like Bookmark
books
keep track of books you've read
books you own
books you'd like to read
suburb you live in
connect with others who might have the specific book(s) you're looking to read
keeping track of who has whose book(s)
maths
Sim Mautner changed 3 years agoView mode Like Bookmark
Installing Python
For the latter part of this course, we will be building more complex programs than can't be written in Python Notebooks. For this reason, you will need to have a Python interpreter and a source-code editor installed on your computer. Fortunately, both of these things are available for free and can be installed relatively easily.
For this course, we recommend using the Python interpreter available from python.org and Visual Studio Code as a source-code editor. However, if you have gotten a Python interpreter from somewhere else, or a have different source-code editor you prefer, you can use them if you wish. We encourage you to do whatever you are comfortable with.
Overview
These instructions describe generally what needs to be done to install Python and Visual Studio Code. In most cases, we expect them to work as is, but it always possible that there is something particular about your computer that causes them not to work properly. If you have any problems you can post a comment below or talk to your tutor during your lab.
Windows
Sim Mautner changed 3 years agoView mode Like Bookmark
Please put your questions in the chat!!
Completed
nesting part 2 from practice exam --> try using this: https://www.scaler.com/topics/find-function-in-python/
Staying on the same page --> check your e-mail (is it the "record added successfully"? I did that after 9:30am. it should be there by now. Also availabel here: http://www.cse.unsw.edu.au/~cs1010/22T2/content/lectures/form-submission-confirmation.zip)
Upload files from last Thursday <-- Those should be updated now.
Why the big deal about tabs vs spaces? They look the same. --> Answer: They look the same on your computer, but not when they change to someone else's computer.
Are there likely to be 4 questions in the coding section? Or less? --> Answer: Unlikely. Probably only one or two.
regarding alternative data structure for qu 4 it was hard to visualise within 3 hours. Like current we are using list of dictionaries? could it be tuple as alternative or set not sure and did not have much practice also on that. --> Answer: To get more practice on this, come up with practice questions for yourself. (You can share on the forum too.)
Sim Mautner changed 3 years agoView mode Like Bookmark
COMP1010
Data Structures, JSON, etc
Student Request
Saving data in json
Displaying summary data, then more details about that upon request (clicking)
Sim Added
Sim Mautner changed 3 years agoSlide mode Like Bookmark
COMP1010
2.2 Spreadsheets Revisited
Demo 1: Splitting The Bill
Demo 1: Splitting The Bill
Try as many things as possible: Sienna, Vivian, Nick, Hayden, Evan, Gabby, Emily, SandeepVegan: Bart, LukePlain flavours only: Sim, Cliff
Sim Mautner changed 3 years agoSlide mode Like Bookmark
Appropriate use of elements (eg date, text, radio buttons).
Makes it quicker to use (entering with radio buttons rather than typing answer in as text)
Helps in error reduction (so they type an accurate date etc, don't make spelling mistakes)
Changing text size and colour
Readability - makes it quicker to find the information we are looking for (eg headings bigger and bolder)
Shift the user's focus
Sim Mautner changed 3 years agoView mode Like Bookmark
COMP1010 Lab Book: Web Apps
Assumed Knowledge
Before starting this lab book, it is assumed that you have a solid understanding of COMP1010 Topic 3 (Python and Programming Fundamentals).
Instructions
Unless otherwise specified, the following instructions apply to the whole of this lab book.
All questions must be implemented using Python in Flask. It is recommended that you use PyHTML, but not essential.
You may not use render_template.
Every file submitted must include your name and student number in a comment at the top of your file above your import statements.
Sim Mautner changed 3 years agoView mode Like Bookmark