vidhaganji / my_tri2

Apache License 2.0
0 stars 0 forks source link

Future Plans #4

Open vidhaganji opened 1 month ago

vidhaganji commented 1 month ago

For our final project, we will create a "passport" feature where an individual can log where they have traveled and include pictures, journals, and enter the geographic locations where they have traveled.

Requirements: Loops (Algorithmic) Show specific example of building a List using List Comprehension. Show examples of processing a list using conventional and for each methods. Our project will log all the geographic coordinates the individual has been to. A user can then get the coordinates by typing in the particular location they have traveled to and all the associated entires via the use of these loops.

For Each def get_entries_for_location(location): if location in travel_log: for entry in travel_log[location]: print(f"Coordinates: {entry['coordinates']}") print(f"Journal: {entry['journal']}") print(f"Image URL: {entry['image']}") print("---------") else: print("No entries found for this location.")

Conventional Loop def get_entries_for_location(location): if location in travel_log: entries = travel_log[location] for i in range(len(entries)): entry = entries[i] print(f"Coordinates: {entry['coordinates']}") print(f"Journal: {entry['journal']}") print(f"Image URL: {entry['image']}") print("---------") else: print("No entries found for this location.")

Sorting / Searching (Algorithmic) Show examples of sorting and searching using the backend of your project. FYI, SQLAlchemy allows filtered selections and sorting. Additionally, you have sorting options discussed in tech talk. A search function will be implemented, so that whenever a user types a particular entry, it will iterate through all past entries the user has made and find the most relevant results. As for sorting, the user can sort for geographic locations that are nearest to a default "home" location the user sets.

Search Functionality Code: def search_entries(query, entries): query_lower = query.lower() return [entry for entry in entries if query_lower in entry.text.lower()]

search_query = "Eiffel" search_results = search_entries(search_query, entries) for result in search_results: print(result.text)

Sort Functionality Example Code def sort_entries_by_proximity(home_lat, home_lon, entries): return sorted(entries, key=lambda entry: haversine(home_lat, home_lon, entry.latitude, entry.longitude)) home_location = (40.7128, -74.0060) # New York City coordinates sorted_entries = sort_entries_by_proximity(home_location[0], home_location[1], entries) for entry in sorted_entries: distance = haversine(home_location[0], home_location[1], entry.latitude, entry.longitude)

**still have to implement means of calculating distance, example one used haversian distance

Big(O) Illustrate Space and Time complexity used in your Sorting / Searching algorithm.

We are not sure what this involves, we will ask Mr. Lopez.

2D Iteration Show examples of code that use 2D iteration. This can be anywhere in your code where you are using rows and columns.

Example 2D Iteration Code travel_entries = [ ["Entry 1", "Date 1", "Location 1"], ["Entry 2", "Date 2", "Location 2"], ["Entry 3", "Date 3", "Location 3"] ] for row in travel_entries: for col in row: print(col, end=' ') print()

We can utilize 2D iteration to display travel entries in a grid format, such as a calendar view which makes them more accessible for the user.

Deployment (Full Stack) A complete deployment illustration multiple people using and updating your Full Stack Web Application simultaneously. Our plan for this aspect includes deploying our project as we have previously learned. If successful, users should be able to log various travel entries as well as have personalized accounts. If time permits, we can include a means for users to see one another's records of past travels.