Say we have two types:
Using these types, I'll look at the similarities and differences between:
Say we have two types:
Using these types, I'll look at the similarities and differences between:
Recursion is so powerful. Even with a seemingly small change to the code, the results of a recursive function can be wildly different.
When working with recursive functions, you have a choice of processing a graph top-down, or bottom-up.
Let's look at these two functions. They both traverse through a linked list and print the value of each node.
The following example gives a component multiple animations within its animation
style prop, resulting in an animation
prop that looks something like this:
animation: 3000ms ease 0s infinite normal none running fade-in, 3000ms ease 0s infinite normal none running slide-up, 3000ms ease 0s infinite normal none running fade-out;
The above is essentially three separate animations with all animation properties set, each running infinitely. The animation duration (3000ms
) is dynamic based on the interval
prop passed to the component. It would be easy to make other animation properties dynamic as well.
Save this as an html file and open in the browser.
<!DOCTYPE html>
<html lang="en">
<head>
Quoted from Tutorialspoint:
It moves all the bits in its first operand to the left by the number of places specified in the second operand. New bits are filled with zeros. Shifting a value left by one position is equivalent to multiplying it by 2, shifting two positions is equivalent to multiplying by 4, and so on.
Taken from the Python Requests docs:
The Session object allows you to persist certain parameters across requests.
s = requests.Session()
This can be useful for working with cookies (maybe tokens, too).
The sed
manual describes sed
as a "stream editor" (stream editor). It is capable of filtering text and even has regex support.
As an example, we can create a mock file called example.txt and add text to it.
example.txt
Rust doesn't have classes like other object-oriented languages. The impl
(implementation) keyword in Rust acts kind of like the class
keyword would.
Functions can be defined inside implementations (example taken from docs.rust-lang.org):
impl Example {
fn boo() {
println!("boo! Example::boo() was called!");