Day 3 - Project Transit Notifier
To Do: Create my routes and/or start outlining my functionsWhat I did: This morning lecture was about PostgreSQL and it made me rethink using PostgreSQL instead of Firebase for my query. There is an option where you and do geo-math which is great for my project since I need to keep track of the geo location changes of my bus with where my user wants to go. I'm going to do research on which would actually be best for my project.At noon I met with my advisor Shilpa via hangout. We went over my project idea and the data flow. She was very interested in my data modeling, but since I'm using firebase I'm just accessing the data in live time. She suggested to be mindful about how I'm going to use bootstrap.I started working focusing in on how my functions are going to work to process the geo location of the user and finding the closest vehicle to the user. Now that I can call the actual lat/lon of the particular vehicle I can do this. I first called all the vehicle in a particular line (I used route 1). With this data, I first thought of writing a for loop and tracking the closest (or smallest distance) based off of the latitude then longitude and then saving that id to the "closest bus" along with its lat/lon. Then I thought, what if the bus has already past. I'll have to do it again, but I'll need to track the difference and if the difference is larger, that means its going away. So I'll need to track my 2nd closest as well. I felt that this would work, but that it wasn't effective. So I asked for support it the queue.Joel came and I explained the logic and he suggested using a list of tuples that so I can sort based on the distance (that way I can have the first, second and third! Then I can just check those items instead of checking all the vehicles. It was beautifully simple. I started to write it, but I hit a wall. My brain knew what to do, but now HOW, but I did, but I didn't. So I took a break.I talked to fellows and ate a little. I went back to work and started, but stopped. Just nope. My brain needed time. So I went to the roof and laid on the bench. It was too cold though. So I went to the third floor and laid on the ground by Xye. I told her that I need to take time to let my brain process this new approach and I started to fall asleep. As I was drifting, I figured it out! I jumped up and ran to my computer.I was able to find a library that calculates the vincenty distance between two geolocation. I hard coded the coordinates of the Powell Station to the moving vehicles. Once I got these items I added it as a tuple into my list. Then I was able to sort my list by the vincenty distance (the smaller the better)! YEAH!At 6pm, I met with Andrew (my mentor). We went over my project's data flow. We talked a lot about project management and how to organize my files and ideas. He complimented that I was focusing on the "meat" of the project with getting my data and doing my functions. I kept asking him for validation on where I am at in my process and he reminded me to keep it simple and if I can do the other items, then I will. If not, I'll at least have a functional project. I starting to recognize a theme thereTo Do Tomorrow: Research firebase's event handler
My Thoughts/Process: It was so much fun. I got stuck for a bit, but I made tons of small victories. I have been working at the stand up desk and I love it. I also worked with the white board and that helped me visualize what I want to do and how I'm going about it. When I was stuck, it was interesting that I was able to figure out how to do it by literally resting my brain. I'll have to keep that in mind for next time. I did receive a comment from Joel that he saw me have at least 3 different success dances at the stand up desk and Ally (a fellow fellow - hehe, did you see what I did there, ha!) totally agreed that I'm very expressive when I work. Today was a very successful day- I felt like an actual programmer.