4 Matching Annotations
  1. Last 7 days
    1. for Loops# for loops let us perform an action or a set of actions for all of the items in a list. So, if we wanted to go through all the the users that liked our tweet and display a message for each one, we could do this: for user in users_who_liked_our_post: display("Yay! " + user + " liked our post!") Copy to clipboard 'Yay! @pretend_user_1 liked our post!' Copy to clipboard 'Yay! @pretend_user_2 liked our post!' Copy to clipboard 'Yay! @pretend_user_3 liked our post!'

      The introduction if loops is a a pretty important fundamental to programming. I don't usually use Python but the syntax is very easy to remember and simple to understand. These explanations are also very straight forward.

    1. 5.3.2. Social Networking Services# 2003 saw the launch of several popular social networking services: Friendster, Myspace, and LinkedIn. These were websites where the primary purpose was to build personal profiles and create a network of connections with other people, and communicate with them. Facebook was launched in 2004 and soon put most of its competitors out of business, while YouTube, launched in 2005 became a different sort of social networking site built around video.

      Over 20 years ago these companies were created and yet they are the backbone of what the internet is today. These networking services help connect billions of people and have shown how impactful it has been to the world.

  2. Jan 2026
    1. In addition to representing data with different data storage methods, computers can also let you add additional constraints on what can be saved. So, for example, you might limit the length of a tweet to 280 characters, even though the computer can store longer strings. There are many places these constraints might be used such as: for an age (integer), only allow ages between 0 and 120 for a country name (string), have a pre-set list of valid country names for a legal name (string), disallow emojis

      This is an important thing to consider when choosing how we store data and how we want to represent it. It is unrealistic to for example have someone who is 1000 years old. Another good case is if we only want to include a specific set of data but the user enters invalid characters which may distort our dataset.

    1. Sounds are represented as the electric current needed to move a speaker’s diaphragm back and forth over time to make the specific sound waves. The electric current is saved as a number, and those electric current numbers are saved at each time point, so the sound information is saved as a list of numbers. Fig. 4.12 A computer representation of the sound of Kyle saying “this.”# Fig. 4.13 How sound information turns into an electric signal, which then works with a magnet to push and pull on a diaphragm inside a speaker to create physical sound waves. Microphones do this process in exactly the reverse, the sound waves in the air make the speaker diaphragm go back and forth, making an electric current in the wire which gets measured and saved by the computer.

      I recently worked on a project using sound. All of the sound was stored as numbers like described here. The whole process of measuring physical sound waves is very interesting to learn about.