OIM3640 - Problem Solving and Software Design

2025 Spring

Session 22 (4/15)

contain

Today's Agenda

  • Welcome/News/Announcements
  • Collaborate with Git/GitHub
  • Web App Development
    • Flask
    • How Web Works
  • Working on Assignment 3

Welcome/News/Announcements

  • Assignments/Project
    • Assignment 3 - Flask Webapp
    • Project: I will send invitation to schedule meeting with project groups.
  • Remaining Sessions:
    • 4/17: I/O, File Handling, and Data Persistence
    • 4/22: No in-person class, work on your project
    • 4/24: Web Scraping and Data Analysis
    • 4/29: Semester Wrap-up and Final Project Demo (not mandatory)

Collaborate with Git/GitHub

  • Make your First Contribution (OIM3640/oim3640-first-contributions-2025spring):
    • Fork the repository to your account and clone it to your computer.
    • Create a branch add-<your-name> (or feature/bugfix in real projects.)
    • Add your name and Github link to Contributors.md, and commit.
    • Push the changes to GitHub.
    • Open a pull request from your branch for review and wait be merged.
    • Repeat above with a new branch for a new contribution (e.g. new .py file.)
  • As a Project Owner/Maintainer
    • Manage contributions by reviewing and merging pull requests, maintaining project branches, and addressing issues.
  • Recommendation: Step-By-Step Team Workflow with GitHub Desktop

What we have learned so far...

  • Fundamental Concepts
    • Variables, Expressions, Statements, Functions
    • Pseudo-code, Error Handling, Debugging
  • Data Types: int, float, string, boolean, Nonetype, string, list, dictionary, tuple, set
  • Control Flows: Conditionals, Iterations
  • Advanced Programming Concepts
    • APIs
  • Applications
    • NLP
    • Building Web Application using Flask
      • HTML & CSS

Flask Resources

Flask Practice: Building a Weather Page

  • In your helloflask project/folder, add a new web page, weather.html
  • In app.py, add a route that allows user to enter a US city name and display the current temperature.
  • Discussion:
    • How would you handle an international city?
    • What if the city name is not found?
    • How would you handle multiple cities?

Flask Exercise: API Integration

Working on Assignment 3 - MBTA Web App Project

  • Read project instructions
  • Work in groups or individually:
    • Discuss your approach
    • Define project scope
    • Ask any questions
    • Start coding

Front End/Back End/Full Stack Web Development

--- # Feedback on Assignment 2 - Text Analysis Project - **Data** - What is the **goal** of your project? - API selections - **Data cleaning** - Choose proper **data structures** - **Analysis** - Basic statistics - Have you excluded `stopwords`? - Visualizing the data (histograms, word clouds, ...) - Other NLP libraries or techniques (e.g., `spaCy`, `gensim`, openai api, ...) --- # Feedback on Assignment 2 (cont.) - **Reflections** - What else have you **tried**? What else **can** you do? - Writing in **Markdown** format - Protect sensitive data (e.g., API key). **Please send it privately to me**. - **How to improve** - Break down your program into **smaller and self-contained functions** - Write docstrings and proper [comments](https://github.com/OIM3640/resources/blob/main/misc/To%20Comment%20or%20Not%20to%20Comment.pdf) - Ensure the code can be run from `if __name__ ==` in `main.py` (or `app.py`). - If user input is needed, you should provide clear and understandable prompts. --- # Assignment 2 - Text Anaysis Project (cont.) - Submission does not mean the end of the project! - What to do next? - Improve code - Add more analyses - Optimize project file/folder structure - Modify write-up using real Markdown