Used in rare cases when you need to calculate the distance between elements after an update or do other post-update calculations / side-effects.
useDebugValue
I feel like the docs do a pretty good example of explaining this one. If you have a custom hook, and you'd like to label it within React DevTools, then this is what you use.
Parsing the “server_name” Directive to Choose a Match
Next, to further evaluate requests that have equally specific listen directives, Nginx checks the request’s “Host” header. This value holds the domain or IP address that the client was actually trying to reach.
Matching Location Blocks
Similar to the process that Nginx uses to select the server block that will process a request, Nginx also has an established algorithm for deciding which location block within the server to use for handling requests.
Location Block Syntax
Location blocks generally take the following form:
The modifiers below will cause the associated location block to be interpreted as follows:
(none) : If no modifiers are present, the location is interpreted as a prefix match. This means that the location given will be matched against the beginning of the request URI to determine a match.
= : If an equal sign is used, this block will be considered a match if the request URI exactly matches the location given. = 开头表示精确匹配,只有完全匹配上才能生效
~ : If a tilde modifier is present, this location will be interpreted as a case-sensitive regular expression match. ~ 开头表示区分大小写的正则匹配
~* : If a tilde and asterisk modifier is used, the location block will be interpreted as a case-insensitive regular expression match. ~* 开头表示不区分大小写的正则匹配
^~ : If a carat and tilde modifier is present, and if this block is selected as the best non-regular expression match, regular expression matching will not take place. ^~ 开头对URL路径进行前缀匹配,并且在正则之前。
When Does Location Block Evaluation Jump to Other Locations?
Another instance where the processing location may be reevaluated is with the try_files directive. This directive tells Nginx to check for the existence of a named set of files or directories. The last parameter can be a URI that Nginx will make an internal redirect to.
Any data exists in the form of binary machine code in a computer. The first number is used to represent the positive and negative values: 0 is positive and 1 is negative.
The value represented by machine code is called the original code.
Inverse Code
Inverse code is generally the least useful representation of computer.
The inverse code of positive numbers is the original code itself. The inverse code of negative numbers: the number of the sign bits is the first bit remains unchanged (符号位保持不变), and the rest of the bits are reversed.
For example, if the original code of + 2 is 00000010, then the inverse code of + 2 is 00000010. The original code of – 2 is 10000010, and the inverse code is 1111101.
Complement Code
Complement is one of the most frequently used encoding methods in computer numerical operations.
The positive complement is the original code itself, which is the same as the inverse code. The complement of negative number is the result of it's inverse code + 1. For example, the complement of + 2 is 00000010. The complement of – 2: 11111111101 (counter code) +1 = 11111111110.
Frameshift
Shift code is to add a bias constant to the value. When the number of coding bits is n, it usually shifts to the N-1 power of 2. For example, the shift code of – 2 = the 7th power of the original code + 2 = 00000010 + 10000000 = 10000010, which can be used as the complement of – 2 11111110 Sign bits remain unchanged and the remaining bits are reversed + 1。
Git: How do I force "git pull" to overwrite local files?
Fri, Oct 29, 2021 9:37 AM
Git: How do I force "git pull" to overwrite local files?
Published by undefined at May 18, 2022
How to overwrite
First, run a fetch to update all origin/<branch> refs to latest:
git fetch --all
Backup your current branch:
git branch backup-master
Then, you have two options:
git reset --hard origin/master
OR If you are on some other branch:
git reset --hard origin/<branch_name>
Explanation
git fetch downloads the latest from remote without trying to merge or rebase anything.
Then the git reset resets the master branch to what you just fetched. The --hard option changes all the files in your working tree to match the files in origin/master
These values vertically align the element relative to its parent element:
baseline
Aligns the baseline of the element with the baseline of its parent. The baseline of some replaced elements, like <textarea>, is not specified by the HTML specification, meaning that their behavior with this keyword may vary between browsers.
sub
Aligns the baseline of the element with the subscript-baseline of its parent.
super
Aligns the baseline of the element with the superscript-baseline of its parent.
text-top
Aligns the top of the element with the top of the parent element's font.
text-bottom
Aligns the bottom of the element with the bottom of the parent element's font.
middle
Aligns the middle of the element with the baseline plus half the x-height of the parent.
<length>
Aligns the baseline of the element to the given length above the baseline of its parent. A negative value is allowed.
<percentage>
Aligns the baseline of the element to the given percentage above the baseline of its parent, with the value being a percentage of the line-height property. A negative value is allowed.
Line-relative values
The following values vertically align the element relative to the entire line:
top
Aligns the top of the element and its descendants with the top of the entire line.
bottom
Aligns the bottom of the element and its descendants with the bottom of the entire line.
For elements that do not have a baseline, the bottom margin edge is used instead.
Values for table cells
baseline (and sub, super, text-top, text-bottom, <length>, and <percentage>)
Aligns the baseline of the cell with the baseline of all other cells in the row that are baseline-aligned.
top
Aligns the top padding edge of the cell with the top of the row.
middle
Centers the padding box of the cell within the row.
bottom
Aligns the bottom padding edge of the cell with the bottom of the row.
Negative values are allowed.
2022-02-25 补充
我终于懂了 The vertical-align CSS property sets vertical alignment of an inline, inline-block or table-cell box.
原来是给 行内元素 在行内用的。 块级的就 flex 一把梭