{ "video_id": "CxGSnA-RTsA", "language": "en", "language_probability": 0.9993522763252258, "segments": [ { "start": 0.0, "end": 3.92, "text": "Computers make no sense, throw some metal in a box, and boom!" }, { "start": 5.92, "end": 7.2, "text": "What the heck is going on here?" }, { "start": 11.14, "end": 13.86, "text": "Inside your PC is a central processing unit or CPU." }, { "start": 13.86, "end": 18.02, "text": "It's basically just a piece of silicon with billions of microscopic switches called transistors." }, { "start": 18.02, "end": 20.42, "text": "Depending on the flow of electricity they can be on or off," }, { "start": 20.42, "end": 23.7, "text": "kind of like a light bulb, which gives us two states, one and zero." }, { "start": 23.7, "end": 26.1, "text": "The value out one of these switches is called a bit." }, { "start": 26.1, "end": 29.62, "text": "One bit by itself doesn't really do much, but put them together and" }, { "start": 30.5, "end": 35.7, "text": "A group of 8 bits is called a byte and can have 256 different combinations of zeros and ones." }, { "start": 35.7, "end": 39.38, "text": "Congratulations, we can now store information by counting in a system called binary." }, { "start": 39.38, "end": 43.38, "text": "Every bit represents a power of two, one meaning the power is included and zero meaning it's not," }, { "start": 43.38, "end": 47.7, "text": "so this number has one times 64, one times 4 and one times one, which adds up to 69." }, { "start": 47.7, "end": 50.82, "text": "This is nice, but for humans, hexadecimal is even better." }, { "start": 50.82, "end": 54.82, "text": "It's often denoted by the 0x and is simply a more readable format than binary." }, { "start": 54.82, "end": 57.62, "text": "For binary bits can take any value from 0 to 15." }, { "start": 57.62, "end": 61.22, "text": "Hexadecimal uses 0 to 9 and A to F to represent those values," }, { "start": 61.22, "end": 64.5, "text": "so a group of 4 bits can be replaced by one hexadecimal digit." }, { "start": 64.5, "end": 68.26, "text": "Okay, now that we can store numbers, we just need the computers to actually, you know," }, { "start": 68.26, "end": 69.38, "text": "do something with them." }, { "start": 69.38, "end": 73.3, "text": "Using transistors you can make logic gates, which are electronic circuits that encapsulate logical" }, { "start": 73.3, "end": 76.82, "text": "statements. You can think of it as a light bulb with two switches, where the light only" }, { "start": 76.82, "end": 80.82, "text": "turns on under certain conditions, for example, only if A and B are on." }, { "start": 80.82, "end": 84.5, "text": "By combining logic gates in a clever way, you can build circuits that perform calculations" }, { "start": 84.5, "end": 88.9, "text": "according to Boolean algebra, which is a system formalizing mathematical operations in binary." }, { "start": 88.9, "end": 94.02, "text": "But even though computers understand zeros and ones, for humans, it's not really all that useful." }, { "start": 94.02, "end": 98.02, "text": "So, using a character encoding like ASCII, we can assign a binary number to each character." }, { "start": 98.02, "end": 101.3, "text": "When you type any on your keyboard, it gets translated into this binary code," }, { "start": 101.3, "end": 103.46, "text": "and as soon as the computer sees this, it says," }, { "start": 103.46, "end": 106.82, "text": "Ah, yes, that is a capital A, and slaps it on the screen." }, { "start": 106.82, "end": 109.86, "text": "How these devices fit together is handled by an operating system kernel," }, { "start": 109.86, "end": 113.22, "text": "like Windows, Linux, or Mac, which sits between computer hardware and applications," }, { "start": 113.22, "end": 116.58, "text": "and manages how they all work together, for example, with device drivers." }, { "start": 116.58, "end": 119.86, "text": "Input devices allow you to give the computer instructions with a press of a button," }, { "start": 119.86, "end": 123.14, "text": "but at the lowest level, computers only understand instructions in machine code," }, { "start": 123.14, "end": 126.66, "text": "which is binary code, telling the CPU what to do and which data to use." }, { "start": 126.66, "end": 130.26, "text": "When it comes to following these instructions, the CPU is kind of like a genius." }, { "start": 130.26, "end": 133.38, "text": "Just with the memory of a demented goldfish, it can handle any instructions," }, { "start": 133.38, "end": 138.02, "text": "but it cannot store any data, so it's only really useful with random access memory or RAM." }, { "start": 138.02, "end": 141.46, "text": "You can imagine it like a grid, where a box can hold one byte of information," }, { "start": 141.46, "end": 146.26, "text": "which can be data or instructions and has an address so the CPU can access it in four steps." }, { "start": 146.26, "end": 150.66, "text": "Fetch for memory, decode instructions and data, and finally, execute and store the result." }, { "start": 150.66, "end": 154.42, "text": "This is one machine cycle. Since a program is basically just a list of instructions" }, { "start": 154.42, "end": 158.98, "text": "in memory to run it, the CPU executes them one by one in machine cycles until it's complete." }, { "start": 158.98, "end": 161.62, "text": "Oh yeah, did I mention that this happens like really fast?" }, { "start": 161.62, "end": 165.78, "text": "Modern CPUs can do billions of cycles every second, which are coordinated and synchronized" }, { "start": 165.78, "end": 169.54, "text": "by a clock generator. The speed of this clock is measured in gigahertz, and people often" }, { "start": 169.54, "end": 174.34, "text": "overclock their CPUs to improve performance, which is nice, but might just set your PC on fire." }, { "start": 174.34, "end": 178.66, "text": "What's even crazier though is that a CPU has multiple cores, which can all execute different" }, { "start": 178.66, "end": 183.38, "text": "instructions in parallel, so at the same time. Each core can also be split into multiple threads," }, { "start": 183.38, "end": 187.86, "text": "which allows every single core to handle multiple instructions concurrently, so switch between them" }, { "start": 187.86, "end": 191.94, "text": "really quickly. Okay, that's cool, but it doesn't matter how powerful a computer is," }, { "start": 191.94, "end": 194.5, "text": "if you have no way to give it instructions in the first place." }, { "start": 194.5, "end": 198.66, "text": "Typing machine code by hand would probably make you go insane, but luckily you don't have to." }, { "start": 198.66, "end": 202.5, "text": "The kernel is wrapped in a shell, which is just a program that exposes the kernel to the user," }, { "start": 202.5, "end": 205.86, "text": "allowing for simple instructions in a command line interface with text inputs." }, { "start": 205.86, "end": 209.14, "text": "But the best way to make a computer do something useful is with a programming language," }, { "start": 209.14, "end": 212.98, "text": "which uses abstraction, so that instead of this, you can write code that looks like this," }, { "start": 212.98, "end": 215.46, "text": "which is then converted into machine code for you." }, { "start": 215.46, "end": 219.46, "text": "Some languages like Python use an interpreter, which directly tries to execute the source code" }, { "start": 219.46, "end": 223.94, "text": "line by line. Other languages like C or Go use a compiler, which converts the entire program" }, { "start": 223.94, "end": 227.14, "text": "into machine code before putting it in a file, the CPU can execute." }, { "start": 227.14, "end": 230.74, "text": "Now, every programming language has different syntax, but there are some basic tools almost" }, { "start": 230.74, "end": 235.06, "text": "all of them have. The most basic way to use data is with variables, which assigns a value to a name" }, { "start": 235.06, "end": 239.78, "text": "which can then be reused and modified. Depending on the value, variables can have different data types." }, { "start": 239.78, "end": 243.38, "text": "For text, there are single characters and strings of multiple characters. For numbers," }, { "start": 243.38, "end": 246.74, "text": "there are integers which can also be signed if they're negative and floating point numbers for" }, { "start": 246.74, "end": 250.42, "text": "decimal values. They're called floating point because the decimal point can float around to" }, { "start": 250.42, "end": 254.42, "text": "trade off precision with range. This is possible because they use scientific notation," }, { "start": 254.42, "end": 258.02, "text": "it's some number times the power telling you where to put the decimal point, which is exactly" }, { "start": 258.02, "end": 261.78, "text": "what they look like under the hood. The actual number is stored with binary fractions." }, { "start": 261.78, "end": 265.86, "text": "Some fractions, like one third, can only be approximated in binary with an infinite sum." }, { "start": 265.86, "end": 269.7, "text": "But since memory is not infinite, you have to cut it off at some point which leads to rounding" }, { "start": 269.7, "end": 274.26, "text": "or is causing pretty weird calculations sometimes. If these are not enough, long and double use twice" }, { "start": 274.26, "end": 278.74, "text": "the amount of memory to double the range of instant floats. Some languages like Python automatically" }, { "start": 278.74, "end": 282.74, "text": "figure out which type of variable is, but in a language like C, you have to explicitly declare" }, { "start": 282.82, "end": 286.5, "text": "the type of a variable. The value of a variable is stored at some address and memory." }, { "start": 286.5, "end": 290.66, "text": "Pointers are variables whose value is the memory address of another variable, which is denoted" }, { "start": 290.66, "end": 294.82, "text": "by this ampersand. So really, a pointer is just some chunk of memory pointing to another chunk" }, { "start": 294.82, "end": 298.9, "text": "of memory. Since the memory address is just a number, you can add and subtract from it to navigate" }, { "start": 298.9, "end": 302.58, "text": "through individual bytes of memory. This is called pointer arithmetic. In some low-level" }, { "start": 302.58, "end": 306.58, "text": "languages like C, you have to manually allocate and free up memory once it's no longer used." }, { "start": 306.58, "end": 310.02, "text": "This all happens in the heap, which is a part of memory that can dynamically grow and shrink as" }, { "start": 310.18, "end": 314.34, "text": "the program demands, which allows for more control but makes it incredibly easy to completely break" }, { "start": 314.34, "end": 318.02, "text": "your code. You could touch memory or not supposed to or that simply doesn't exist, which is known" }, { "start": 318.02, "end": 321.94, "text": "as a segmentation fault. But also if there's some chunk of memory that's no longer used and you" }, { "start": 321.94, "end": 326.1, "text": "forget to free it or you have no way to access it anymore, that memory is no longer usable." }, { "start": 326.1, "end": 329.86, "text": "This is called a memory leak and can cause the program to slow down and eventually crash." }, { "start": 329.86, "end": 333.46, "text": "To avoid this mess, high-level languages like Python have built and garbage collectors that" }, { "start": 333.46, "end": 337.7, "text": "manage memory for you. Different data types take up a different amount of memory. Integers are" }, { "start": 337.7, "end": 341.86, "text": "most often four bytes of memory. A single character is most often one-byte of memory and a string is" }, { "start": 341.86, "end": 345.94, "text": "just multiple character bytes with a null character to signal the end of the string. Storing multiple" }, { "start": 345.94, "end": 350.34, "text": "items in a contiguous chunk of memory like this is the idea of an array. More generally, it's a list of" }, { "start": 350.34, "end": 355.14, "text": "items with the same data type, with each item having a numerical index most often starting at zero." }, { "start": 355.14, "end": 359.14, "text": "Since the items are next to each other in memory, by knowing the address of the first item, you can" }, { "start": 359.14, "end": 363.78, "text": "quickly index to any item in the array by using pointer arithmetic. Arrays are what's known as a" }, { "start": 363.78, "end": 368.02, "text": "data structure, which is just a way to organize data to make it easier to work with. Retrieving" }, { "start": 368.02, "end": 372.66, "text": "values from an array is blazingly fast, but the size of an array is often fixed on creating it, so when" }, { "start": 372.66, "end": 376.58, "text": "it's full, you can't add anything, and if you don't use all of it, it's just wasted memory, so" }, { "start": 376.58, "end": 381.38, "text": "more flexible option is a linked list. It uses nodes containing a value in a pointer to the next node," }, { "start": 381.38, "end": 385.14, "text": "which allows them to be spread apart in memory. Also, it can grow and shrink dynamically as you can" }, { "start": 385.14, "end": 389.62, "text": "add and remove any node, and you can reorder it by simply rearranging the pointers. This is great," }, { "start": 389.62, "end": 394.18, "text": "but they can be impractical as you have no way text us the last node, except a future verse every single" }, { "start": 394.18, "end": 398.9, "text": "one before it. But still, both the raisin linked lists are useful as they allow you to create cues and" }, { "start": 398.9, "end": 403.7, "text": "stacks. A stack falls the last and first out principle, just like taking a pancake from a stack." }, { "start": 403.7, "end": 407.38, "text": "Practically, just imagine a pointer that always points to the item that was last added to the" }, { "start": 407.38, "end": 412.34, "text": "structure, then you can pop, so remove the last item which increments the pointer back. A queue falls" }, { "start": 412.34, "end": 416.26, "text": "the first and first out principle and uses two pointers, one for the first item that was added and" }, { "start": 416.26, "end": 420.5, "text": "one for the last. Any new item gets added after the last pointer, which is then updated and" }, { "start": 420.5, "end": 424.98, "text": "decoing starts at the first pointer. Another useful data structure is a hash map, which is just a" }, { "start": 424.98, "end": 429.62, "text": "collection of key value pairs. It works kind of like an array, but uses a hash function to take a key" }, { "start": 429.62, "end": 433.62, "text": "and assign it to an index, where its values then store it. But sometimes, two different keys" }, { "start": 433.62, "end": 437.3, "text": "can map to the same index, which is called a collision. There's different ways to deal with this," }, { "start": 437.3, "end": 441.22, "text": "but one way is to create a linked list at that position in the array, which makes it a little" }, { "start": 441.22, "end": 445.46, "text": "slower to look at that value, but still, hash maps are incredibly useful because you can define the" }, { "start": 445.46, "end": 450.18, "text": "keys the pointer every value, and since they're based on arrays, retrieving them is blazingly fast." }, { "start": 450.18, "end": 454.02, "text": "For many problems, it can be very useful to represent the relationship between different data" }, { "start": 454.02, "end": 457.94, "text": "points as a data structure. If you take the nodes of a linked list, but allow any node to point" }, { "start": 457.94, "end": 462.18, "text": "to any other node, you get a graph, where the nodes are connected by edges that can be directed," }, { "start": 462.18, "end": 466.82, "text": "undirected and can even carry a weight, which can stand for any metric such as distance or cost." }, { "start": 466.82, "end": 470.74, "text": "Graphs are useful for analyzing groups inside networks or finding the shortest path between two" }, { "start": 470.74, "end": 474.74, "text": "points, for example in Google Maps. There's two main ways to search a graph, but the first" }, { "start": 474.74, "end": 478.26, "text": "search starts at one node who moves that layer by layer until it finds the target node for the" }, { "start": 478.26, "end": 482.66, "text": "first time. Depth first search expose every single path fully until it reaches a dead end," }, { "start": 482.66, "end": 486.26, "text": "then it backtracks to the last node with a different path and continues from there in the same" }, { "start": 486.26, "end": 491.14, "text": "way until it finds the target node. A graph where any two nodes are connected by exactly one path" }, { "start": 491.14, "end": 494.9, "text": "is called a tree, and represents a hierarchy, for example, the file system on your computer." }, { "start": 494.9, "end": 498.82, "text": "A tree starts at the root and branches out into subtrees, which end in leaf nodes." }, { "start": 498.82, "end": 503.3, "text": "Parent nodes can have any number of child nodes, but oftentimes binary trees are the most useful." }, { "start": 503.3, "end": 506.98, "text": "For example, a binary tree where all the values left of any node are smaller and all the values" }, { "start": 506.98, "end": 511.14, "text": "right of it are greater is called a binary search tree, which makes finding specific values super" }, { "start": 511.14, "end": 515.06, "text": "fast. If you want to find a target value, just start at the root. If the target is smaller than" }, { "start": 515.06, "end": 519.14, "text": "that node, go left, if it's greater, go right, and repeat this until you find the target." }, { "start": 519.14, "end": 523.3, "text": "What we just used is a very simple algorithm, which is just a set of instructions that solves a" }, { "start": 523.3, "end": 527.62, "text": "problem step by step. The simplest way to write an algorithm is in the form of a function. It takes" }, { "start": 527.62, "end": 531.78, "text": "inputs, does something with them, and returns an output. Just like variables, you can then call a" }, { "start": 531.78, "end": 535.94, "text": "function by its name and pass in different arguments. When calling a function, the function call gets" }, { "start": 535.94, "end": 540.26, "text": "pushed onto the call stack, which is shorter memory used for executing code, and as the name implies," }, { "start": 540.26, "end": 544.58, "text": "it's based on a stack data structure, which means last in, first out. To implement algorithms," }, { "start": 544.58, "end": 548.26, "text": "you often have to compare two values, which you can do with operators like greater than or" }, { "start": 548.26, "end": 553.3, "text": "equality and logical expressions, such as and or and not. Expressions like these are simple. They" }, { "start": 553.3, "end": 557.54, "text": "can be true or false, which are the possible values of the Boolean data type and allow you to write" }, { "start": 557.54, "end": 562.66, "text": "conditional statements. If some condition is true, do this, else do that. Booleans can also be used" }, { "start": 562.66, "end": 566.9, "text": "to loop over loop over loop over certain parts of code. One way is with a while loop. While this" }, { "start": 566.9, "end": 570.82, "text": "condition is true, this code will execute. Another way is with a for loop, which can iterate over" }, { "start": 570.82, "end": 574.82, "text": "every element inside a data structure like an array, but can also loop for a specific number of" }, { "start": 574.82, "end": 578.98, "text": "iterations by setting a starting value, incrementing it after each iteration, and setting an upper" }, { "start": 578.98, "end": 583.38, "text": "bound with a condition. Functions can also call themselves, which is known as recursion. This is" }, { "start": 583.38, "end": 587.22, "text": "useful when a problem can be broken down into smaller identical problems, such as calculating" }, { "start": 587.3, "end": 591.22, "text": "five factorial, which is just five times four factorial, which is just four times three factorial," }, { "start": 591.22, "end": 595.3, "text": "which is just, but by default, our recursive function will just keep on calling itself forever." }, { "start": 595.3, "end": 599.14, "text": "This means that it keeps pushing more function calls onto the call stack until stack memory is" }, { "start": 599.14, "end": 603.78, "text": "exceeded in a stack overflow. That's not optimal. To stop this, you have to add a base condition to" }, { "start": 603.78, "end": 607.94, "text": "our recursive function, which defines when to stop. Only then will the function calls be executed" }, { "start": 607.94, "end": 612.74, "text": "without crashing your PC. Recursion is cool, but it can be pretty expensive time and spacewise," }, { "start": 612.74, "end": 616.74, "text": "so to minimize the amount of computations needed, past results can be saved in a cache," }, { "start": 616.74, "end": 620.1, "text": "so if they come up again, the computer doesn't have to recompute them from scratch." }, { "start": 620.1, "end": 624.02, "text": "This is called normalization. Speaking of performance, to judge how good an algorithm is," }, { "start": 624.02, "end": 628.02, "text": "you can look at time and space complexity, so how much time or space is required to run it." }, { "start": 628.02, "end": 631.46, "text": "This is measured in bigot notation, which describes the relationship between growth of" }, { "start": 631.46, "end": 636.02, "text": "input size and number of operations needed to execute the algorithm. For example, adding one to" }, { "start": 636.02, "end": 640.58, "text": "every number inside an array is o of n, because the number of operations increases in a linear way" }, { "start": 640.58, "end": 645.06, "text": "as the array grows. What's relevant is not the exact number of operations, but rather the trend" }, { "start": 645.06, "end": 649.78, "text": "as the input size goes to infinity. You see, something like n factorial grows way faster than" }, { "start": 649.78, "end": 654.18, "text": "any linear function ever could, so as long as the time complexity is some kind of linear relation," }, { "start": 654.18, "end": 658.82, "text": "it's simplified down to o of n, and the same thing goes for any other group. When writing an algorithm," }, { "start": 658.82, "end": 662.42, "text": "there's always different approaches. A brute force approach would be to simply check every item" }, { "start": 662.42, "end": 666.42, "text": "until we find a target in a list, but if you want your program to run faster than a garden snail," }, { "start": 666.42, "end": 670.42, "text": "you need a more sophisticated approach like divide and conquer. For example, in binary search," }, { "start": 670.42, "end": 674.5, "text": "you repeatedly check the middle element to see on which side the target is and keep searching in that" }, { "start": 674.5, "end": 678.58, "text": "half until you find it. Also, there's different approaches to writing code in general, which are" }, { "start": 678.58, "end": 683.46, "text": "called programming paradigms. Declarative programming describes what the code does, but not how exactly" }, { "start": 683.46, "end": 688.02, "text": "the computer should do it, whereas imperative programming explicitly describes how the computer should" }, { "start": 688.02, "end": 692.74, "text": "achieve a result with detailed instructions. An extension of imperative programming is object-oriented" }, { "start": 692.74, "end": 696.66, "text": "programming, where you can define classes as blueprints for objects, which are single units" }, { "start": 696.66, "end": 701.22, "text": "consisting of data in the form of properties and behaviors in the form of methods. To code a class," }, { "start": 701.22, "end": 706.18, "text": "you begin by defining the properties as variables and the methods as functions. After encapsulating" }, { "start": 706.18, "end": 710.74, "text": "properties and methods in a class, you can instantiate an object and use the dot notation to work with" }, { "start": 710.74, "end": 715.3, "text": "its properties and methods. Classes make it easy to organize and reuse code, because you can find" }, { "start": 715.3, "end": 720.58, "text": "subclasses that inherit properties and behaviors of a superclass, but can also extend and override them." }, { "start": 720.58, "end": 725.14, "text": "For example, a rubber duck subclass might implement quack with a squeak instead. As a result," }, { "start": 725.14, "end": 729.22, "text": "rubber ducks can be treated as objects of the duck class, but behave differently when quack is called," }, { "start": 729.38, "end": 733.78, "text": "which is the concept of polymorphism. But for some problems, none of these traditional paradigms" }, { "start": 733.78, "end": 738.42, "text": "will work. Let's say you want to make a computer recognize which of these images is a B. The problem is," }, { "start": 738.42, "end": 742.82, "text": "you can't really describe what a B looks like with code. This is where machine learning comes in," }, { "start": 742.82, "end": 747.62, "text": "aka, teaching a computer to do a task without explicitly programming it to do that task." }, { "start": 747.62, "end": 751.38, "text": "First, you need a lot of data, which you can split into training data and test data." }, { "start": 751.38, "end": 755.54, "text": "Next, you choose an algorithm that can change its parameters over time. For example, a neural network" }, { "start": 755.54, "end": 759.38, "text": "where the weights can be updated to achieve a different result. By feeding lots and lots of" }, { "start": 759.38, "end": 763.22, "text": "training data into this algorithm, you can build a model whose accuracy you can then check" }, { "start": 763.22, "end": 767.54, "text": "with a test data. If it's not quite right, the model can improve over time by comparing the output" }, { "start": 767.54, "end": 771.62, "text": "to what it should have been, capturing the difference in an error function and tweaking its parameters" }, { "start": 771.62, "end": 776.02, "text": "to minimize the difference. But no matter how futuristic, bleeding edge blazingly fast and" }, { "start": 776.02, "end": 779.62, "text": "optimized it is, if you want people to actually use the application you wrote, you should probably" }, { "start": 779.62, "end": 783.86, "text": "know about the internet. It's a network of computers from all around the globe connected by wires." }, { "start": 783.86, "end": 788.02, "text": "Like, literally, the internet is just a bunch of thick cables that run at the bottom of the ocean" }, { "start": 788.02, "end": 792.1, "text": "along with facilities like internet service providers that connect you to your destination." }, { "start": 792.1, "end": 796.02, "text": "These computers communicate with the internet protocol suite. Every computer on the network" }, { "start": 796.02, "end": 800.26, "text": "has a unique IP address, and two computers can then transfer data with a transmission control" }, { "start": 800.26, "end": 804.1, "text": "protocol. It breaks messages into a bunch of packets, sends them through a network of wires," }, { "start": 804.1, "end": 807.86, "text": "before the receiving end puts the message back together. If you have a poor internet connection," }, { "start": 807.86, "end": 811.86, "text": "you might have experienced packet loss, which is just if some of these packets get lost along the way." }, { "start": 811.86, "end": 816.02, "text": "If the internet is the hardware, then the web is the software, which you can use with a browser." }, { "start": 816.02, "end": 820.26, "text": "Every page on the web has a URL. When you type it into your browser, it looks up the IP address" }, { "start": 820.26, "end": 824.1, "text": "of the server hosting this website with a domain name system, which is like a dictionary" }, { "start": 824.1, "end": 828.74, "text": "mapping domain names to IP addresses of actual servers. After connecting to it via TCP," }, { "start": 828.74, "end": 833.06, "text": "your browser, called the client, uses the hypertext transfer protocol to send an HTTP request" }, { "start": 833.06, "end": 837.14, "text": "to the server, which then gives a response, ideally containing the contents of the web page." }, { "start": 837.22, "end": 841.54, "text": "The actual website most often consists of three parts, an HTML file contains all the content" }, { "start": 841.54, "end": 845.62, "text": "of a website, and is basically just a collection of elements, which can be text, links, buttons," }, { "start": 845.62, "end": 850.02, "text": "and so on. A CSS file controls the visuals and makes a website look nice, but a website is" }, { "start": 850.02, "end": 855.06, "text": "useless of pressing nice looking buttons does nothing, so a language like JavaScript adds functionality." }, { "start": 855.06, "end": 860.02, "text": "But sometimes, things can go wrong. With every HTTP response comes a response code, which carries" }, { "start": 860.02, "end": 864.26, "text": "information about the status of the response. For example, 200 means okay, and anything" }, { "start": 864.26, "end": 869.62, "text": "starting with 4 is an error, the most famous one being 404, page not found. HTTP requests can" }, { "start": 869.62, "end": 874.34, "text": "carry different methods. For example, get, post, put, and delete, so retrieve, add, update," }, { "start": 874.34, "end": 878.82, "text": "and delete information. These are often used by application programming interfaces, which connect" }, { "start": 878.82, "end": 883.06, "text": "two applications and allow them to interact with each other. For example, store and retrieve data" }, { "start": 883.06, "end": 887.46, "text": "from a database. The most common type of database is a relational database, which uses tables" }, { "start": 887.46, "end": 892.18, "text": "to store data. Columns of a table contain different attributes and rows represent individual" }, { "start": 892.18, "end": 896.98, "text": "data points. Also, each table has one unique attribute called the primary key. A foreign key" }, { "start": 896.98, "end": 901.46, "text": "is the primary key of another table establishing a relationship between the two. In this case," }, { "start": 901.46, "end": 906.02, "text": "each book is connected to an author. With a language like SQL, you can write statements to work with" }, { "start": 906.02, "end": 910.26, "text": "data from these tables. You could look up the titles and authors of all books whose title starts" }, { "start": 910.26, "end": 914.98, "text": "with an H, but for that, we have to join the authors table with the books table on the matching key" }, { "start": 914.98, "end": 919.94, "text": "to combine two attributes from different tables into one giving us this output. These statements" }, { "start": 919.94, "end": 924.26, "text": "are useful, but you gotta be careful, or you might just delete an entire database with one line of" }, { "start": 924.26, "end": 929.3, "text": "code. But don't worry, that's never happened before. Behind every login page is a database with" }, { "start": 929.3, "end": 934.1, "text": "user names and passwords. When a user tries to log in, an SQL query is often used to check if the" }, { "start": 934.1, "end": 939.22, "text": "user input matches with an entry in the database. That's good, but a DBS actor could type something" }, { "start": 939.22, "end": 943.38, "text": "like this, which changes the query by terminating the string early and commenting out the rest," }, { "start": 943.38, "end": 948.1, "text": "which means as long as this username exists in the database, access is granted. This is called an" }, { "start": 948.1, "end": 952.5, "text": "SQL injection attack and it's one of the easiest ways hackers get places they're not supposed to." }, { "start": 952.5, "end": 956.26, "text": "Hearing about these concepts is one thing, but to really learn them, you have to see them in action" }, { "start": 956.26, "end": 959.7, "text": "and use them yourself, which is exactly what you can do with Brilliant, which has thousands of" }, { "start": 959.7, "end": 963.78, "text": "interactive lessons for everything from math and data science to programming in AI. They make knowledge" }, { "start": 963.78, "end": 967.94, "text": "stick with visual lessons and interactive problems, which is not only fun and builds intuitive" }, { "start": 967.94, "end": 972.82, "text": "problem-solving skills, but also proven to be six times more effective than simply watching hours" }, { "start": 972.82, "end": 976.9, "text": "of lectures. I know that making time to learn new skills can be difficult, but Brilliant makes it" }, { "start": 976.9, "end": 980.9, "text": "so easy. You can build valuable knowledge from the ground up in just a couple minutes a day," }, { "start": 980.9, "end": 985.86, "text": "with bite-sized lessons from any device anywhere anytime. You'll go from the basics of data science to" }, { "start": 985.86, "end": 990.18, "text": "analyzing real data sets from Spotify in absolutely no time, which you can supplement with math," }, { "start": 990.18, "end": 994.26, "text": "fundamentals, and programming courses in Python to build one of the most in-demand skill sets of our" }, { "start": 994.26, "end": 998.66, "text": "time. The best part? You can try everything Brilliant has to offer for free for a full 30 days," }, { "start": 998.66, "end": 1003.78, "text": "by visiting brilliant.org slash wacky science. You also get 20% off an annual premium subscription." }, { "start": 1003.78, "end": 1005.78, "text": "Thanks to Brilliant for sponsoring this video." } ] }