Individual Code

Please see the GitHub Issues named “modules and import data not working + get user input for class”, “New API and Model to handle Player, Update Model and try to post a List”, and “Error Maximum Recursion Depth Exceeded” on repository JARMIRAMJI for what I mainly worked on.

  • “Modules and import data not working + get user input for class”: This was the first issue and big thing that we as backend tracked. This was after the Flask server was up and running and we had already tried making an API (with all the functions defined) but there were a few errors. This logged the issue we had (attribute and name errors) and gave more information and potential solutions. Then after we fixed it by correcting the modules imported, we updated the issue with what was wrong and how we fixed it. Then we included what we were doing after that, which was trying to incorporate user input with class and planning how to get it to work with frontend, then experimenting with finding a way to send the whole data set over. This GitHub Issue was left there because after this, we discovered SQAlchemy and experimented with that and found that it was much more efficient than what we were currently doing, presented the data in a nicer way, and was better suited for the needs of our project, so we swapped to that and this issue didn’t apply to that anymore. Personally, I was the one who tracked this issue with the requests, elaborated on the error and potential fixes, and eventually did fix it by correcting the imports.
  • “New API and Model to handle Player, Update Model and try to post a List”: First off, this tracked the progress backend has completed with the new API and data model needed to handle a separate “player” class the frontend wanted. This had to be separate from the original data model with the class data since frontend wanted to add unique information (such as name, gender, age, etc.) that the other classes did not. So, we created this API and data model by essentially taking our one we made for the preset classes is the issue above, then altering it to fit this purpose. We had to alter the names and thus the imports, add arguments to add for the new entry, establish new endpoints, and run and debug as usual. Personally, I was the one who worked on the data model, so I was the one tweaking which new pieces of information were going to be initialized and accepted into the data model, the data types it would allow, and setting new properties. I also experimented with how the player data model would be initialized and communicated with frontend, since I could either just have a completely empty data model OR have placeholder values. We decided that there wouldn’t be any difference since frontend would POST new data and override it anyways, so a completely empty data set can potentially avoid any issues with the request. Later, when also communicating with frontend, they told us that they wanted an inventory property for the player as well. So I worked on adding the new value into the data model and found something to potentially work on. This and everything else is explained more in detail in the actual issue, but a quick summary is that the API can handle a list (instead of string) but the data model can’t. This isn’t program-breaking but would make the data look neater and make frontend’s job easier and is something to keep looking into.
  • “Error Maximum Recursion Depth Exceeded”: Issue where we got the error “Maximum Recursion Depth Exceeded”, which was completely new. This occurred with the PUT request if multiple values in the data table are updated in the same request. This isn’t program-breaking since multiple PUT requests can be sent, each changing one thing, but fixing this error would make the frontend’s job much easier. This is here to track progress and prove that these projects will always be continuously developed, tested, and improved upon. The issue has more in depth information about the error, screenshots, and potential ways to fix. I was the one who found the error, tracked and logged it, and proposed potential fixes.

GitHub Analytics: I have been continuously working and committing, as proven by having commits for most days and definitely multiple per week. Here is my GitHub profile!

Key GitHub commits:

Individual Blog

Code in blog

  • Student Lessons (see right in explorer in VSCode) name all changed to include “SL” in the beginning to indicate that they are student lessons. All of them are also on the TimeBox.
  • All hacks and questions completed. The homework questions I am most proud of are Iteration extra credit, list and search binary search question, and list and search extra credit.

Usage of blog

  • See TimeBox! Everything has been continuously logged with daily plans and hacks. A big use of this blog was for student lessons as you can see from the hacks, and the key student lessons that I thought were personally the most helpful are marked with an asterisk.
  • Part of the Passion Project was also included onto the blog by adding a reference for the various syntaxes for the different requests we can send to the data model.

Psuedo-code notes

  • Uses “<–” instead of “=”
  • Has “MISSING CODE” or “MISSING EXPRESSION” within <> to denote missing code
  • Uses “IF” (or “IF ()”), “ELSE”, “OR”, etc. in all caps + no elif equivalent
  • Has indents to indicate what code is within what statement/condition like Python but no “:”, and also uses different shading to indicate it as well
  • Uses “REPEAT (insert number) TIMES” (or “REPEAT UNTIL (condition)”) and “{ (code) }” + or has “REPEAT UNTIL (variable) (operator) (number)”
  • Also has “FOR” or “FOR EACH _ IN”
  • Has “RANDOM x, y” to pick a random number between x and y instead of importing a library and “random.randint(x,y)”
  • For functions/procedures, uses “RETURN” in all caps
  • Uses “DISPLAY (insert what to display)” instead of “print(insert what to display)”
  • Uses “PROCEDURE __ ()” instead of “def __()” and “{}” instead of “:”
  • Robot commands: CAN_MOVE (left/right/forward/backward), ROTATE_RIGHT(), ROTATE_LEFT(), MOVE_FORWARD(), MOVE_BACKWARD(), GoalReached
  • Uses “INPUT ()” in all caps
  • Uses “LENGTH” instead of “len()”
  • Sometimes uses boxes instead of () to indicate the variable
  • Modulu is “MOD” not “%”
  • Includes “Max” as a built in procedure
  • Has subscripts and superscripts, not like “^”
  • 1 based counting and says “position” not “index”

Collegeboard Quiz Notes (Questions with corrections are bolded)

  • Question 3, Citizen science: Which of the following would be the best use of citizen science? An experiment that requires data measurements to be taken in many different locations. Citizen science is research conducted using the general public’s participation. Essentially getting the public to be a part of research by gathering data, analyzing data, sorting data, and more.
  • Question 6, Internet Engineering Task Force (IETF): Which of the following best describes the role of the Internet Engineering Task Force (IETF)? Developing standards and protocols for Internet communication. The Internet Engineering Task Force is a standards organization and they make the standards for the Internet’s protocols. No formal membership or requirements, and all participants are volunteers.
  • Question 12-13, 32: Shows data and need to interpret trends, can use logic
  • Question 15, asks about the Internet and can use logic: Which of the following is a true statement about Internet communication? Every device connected to the Internet is assigned an Internet protocol (IP) address. IP addresses are unique addresses that identifies each device on the Internet or local network.
  • Question 8, 16: Has a user do something and asks about what data can be found, what consequences, etc. about using new technology or innovations.
  • Question 17, digital divide: The digital divide is the gap between people with affordable and reliable internet services and those without it.
  • Question 21, 26, 31: Robot question!
  • Question 23, redundant routing: Failover/Redundant routing is a networking arrangement where there are several “paths” between a sender and receiver, so even if one path fails, there are other paths. Multiple paths = redundant routing. Single path = no redundant routing.
  • Question 24, lossy vs. lossless: These are two types of data compression. Lossy compression is where a file is reduced by permanently removing some data and CAN’T be perfectly reverted back to original. Lossless compression is where a file is reduced by removing some redundant information and it CAN be perfectly reverted back to original, but the downside is that compressed files are still large and slower to compress.
  • Question 33: Flowchart.
  • Question 35, copyright and no-rights-reserved Creative Commons license: Creative Commons license is a public copyright license that allows the free distribution of something that would have been copyrighted. Used when creator wants to give others the right to use something they made. “No-rights-reserved” means that anyone else is allowed to use that work, so the creator reserves no rights.
  • Question 42, IPv4 (32-bit binary number) and IPv6 (128-bit binary number): Each bit multiplies the possibilities by 2. So by going from 32-bit to 128-bit, 128-32 = 96 so the possibilities are multiplied by 2 96 times, so times 2^96. IPv4 has 2^32 possibilities and IPv6 has 2^128 possibilities (2^bits).
  • Question 43, algorithm runtime: An online retailer uses an algorithm to sort a list of n items by price. The table below shows the approximate number of steps the algorithm takes to sort lists of different sizes.

    Based on the values in the table, which of the following best characterizes the algorithm for very large values of n?
    I picked “The algorithm runs, but not in reasonable time”, but the answer was “The algorithm runs in reasonable time”. I thought that since the number of steps increases exponentially, it would be considered unreasonable. However, if the number of steps is a polynomial (steps^2) then it is reasonable. Unreasonable is exponential but not polynomial, such as 2^n.
  • Question 45: Logic gates. See image:
  • Question 51, symmetric encryption: Symmetric encryption, or private key cryptography, is where only 1 key (a secret key) is used to encrypt and decrypt data. Asymmetric encryption, or public key cryptograph, is where two keys (a public key and private key) are used where the public key of the recipient encrypts the data and private key of the recipient decrypts the data after they get receive it. Asymmetric is newer and has no need to share a private key with recipient, but takes longer. Symmetric is better for larger data sets.
  • Question 53, purpose of machine learning: Machine learning is process where a computer analyzes data and learns, becoming at better at predicting data and make decisions based on data trends.
  • Question 58, Internet enabled crowdsourcing. Which of the following are true statements about how the Internet enables crowdsourcing? I, The Internet can provide crowdsourcing participants access to useful tools, information, and professional knowledge. II, The speed and reach of the Internet can lower geographic barriers, allowing individuals from different locations to contribute to projects. III, Using the Internet to distribute solutions across many users allows all computational problems to be solved in reasonable time, even for very large input sizes.
    I picked I and III only based on an educated guess, since my logic was that crowdsourcing is probably something where one sources data from a crowd and connects a group of people, so I thought that it would give more people access to tools (I) and send solutions to more people (III). This is incorrect however since there exist problems that can’t be solved in a reasonable time despite a distributed approach, so III is incorrect. II is correct since it lower geographic barriers to potential participants since physical interaction is limited by geography while the Internet is not.
  • Question 60, abstraction: Abstraction is generalizing details to simplify the process/algorithm (reduce complexity, more abstract) to concentrate on the main parts. Examples include replacing repeated lines of code with calls to a procedure and replacing multiple lines of documentation with a single list of documentation.
  • Question 64, cloud computing: Cloud computing is the on-demand availability of computer system resources, mainly data storage and power, without direct management. Essentially it’s sending computer services over the Internet so it’s more convenient, flexible, and saves costs. It has enhanced collaboration (since new ways to communicate and collaborate) and created new data-security concerns (newer technology and have to protect user’s data).
  • Question 66, testing the procedure Smallest: The procedure Smallest is intended to return the least value in the list numbers. The procedure does not work as intended.
    For which of the following values of One word, the List will Smallest, open parenthesis, one word, the List, close parenthesis NOT return the intended value?
    I picked [20, 10, 30, 40] and [30, 40, 20, 10], but it was actually [40, 30, 20, 10] instead of [20, 10, 30, 40]. The reason is because of the “RETURN (number)”. RETURN ends the procedure there, so Smallest returns the first number it finds in the list that is smaller than “min” (the first number in the list). So [20, 10, 30, 40] would return 10 which is correct, while [40, 30, 20, 10] would return 30 which is wrong.
  • Last 6 questions have 2 correct answers and must pick both

Trimester 1 reflection

  • Looking back at my Timebox, there were many great memories in this class. In the beginning, the Python Quiz and the Python Hacks really stood out to me. When I entered this class, I only really knew how to code a little in Python and walked in with the goal of expanding my ability to code in Python, so these two assignments really gave me what I was looking for and gave me opportunities to further explore what Python can do. I remember spending a ton of time on especially the Python Hacks to make it fun and personal, all the while learning about how to use libraries, logically set variables and do mathematical operations with them, set logical conditional statements, get used to the syntax, and so much more. The Python Hacks assignment was one of the first assignments I was quite proud of myself in doing. Next, I thought that the Web Programming test was definitely unique and deserved a mention. It was a LOT of work to complete and I remember pouring hours into not only completing it, but getting each section to be personal and outputted correctly (it also didn’t help that VSCode for me kept crashing for me here for some reason). It was also one of my first experiences with Javascript, which definitely broadened my horizons and made me look at what other code languages offered. Something I want to work on in future trimesters is to continue practicing with Javascript and maybe make a separate project if I have the time. I would also like to continue learning more about Python, since even though I did learn a lot this trimester, there is so much more to do, and one example is learning in-depth about the classes and how they work. The API and Passion Project did expose me to these concepts and forced me to somewhat learn them, but I would love to learn them properly in the classroom as well. The Passion Project was and is my most favorite thing we have done this trimester. It really allowed for creativity in what to do, incorporated multiple coding languages, and pushed us to learn things on our own and develop our own methodology of working. While sometimes it was painful and took way more time than it should have, I definitely learned a lot from it. AND I met Rayane :D. Lastly, the Student Lessons definitely helped me with solidifying the fundamentals. Again, I entered this class with virtually no previous experience, so these lessons were very useful in getting the basics down and practicing what I already know and learned. It also really pushed us to learn more about Collegeboard’s pseudo-code and how Collegeboard likes to ask questions, so this definitely helps with knowing what to expect from the AP exam. I also got to connect more with the other students, and teaching the lesson was pretty fun! Throughout the whole trimester, I was working closely with my partner Arthur, and it was very interesting to talk to him about what we were working on (especially since he knows more than I do when it comes to code) and fun to bond over the common issues we faced. I definitely got to know him better this trimester and I hope we have the same CSP period next trimester as well! Overall, a great trimester with many wonderful memories, but I would love to continue deepening my knowledge about Python and getting more familiar with Javascript (and pseudo-code).