小编Log*_*Lee的帖子

理解 jq JOIN()

我试图理解JOIN()内置的jq.

来自 jq 手册(https://stedolan.github.io/jq/manual):

JOIN($idx; stream; idx_expr; join_expr):

This builtin joins the values from the given stream to the given index. 
The index's keys are computed by applying the given index expression to each value from the given stream. 
An array of the value in the stream and the corresponding value from the index is fed to the given join expression to produce each result.
Run Code Online (Sandbox Code Playgroud)

我发现如果没有例子这很难理解。

您能否举一些其用法示例来展示其工作原理?

join jq

9
推荐指数
1
解决办法
5263
查看次数

如果在通用选择器中声明,框大小是否会继承?

这是否适用于每个元素?

示例“A”:

*
{
    box-sizing: border-box;
}
Run Code Online (Sandbox Code Playgroud)

我认为 box-sizing 不是继承的?

这是关于盒子大小重置的:

示例“B”:

*, *::before, *::after
{
    box-sizing: inherit;
}

html
{
    box-sizing: border-box;
}
Run Code Online (Sandbox Code Playgroud)

这两个例子会有同样的效果吗?

css reset

8
推荐指数
2
解决办法
4603
查看次数

git ls-files --stage 即使在提交后也显示文件

我正在使用 git 命令来显示当前驻留在暂存区域内的所有文件(与索引相同吗?)。

首先,我从索引中删除了所有文件:

$ git rm --cached *
rm 'newfile'
rm 'os-list.txt'
rm 'remote_stuff'
rm 'removethis'
Run Code Online (Sandbox Code Playgroud)

现在我检查索引中的文件:

$ git ls-files --stage
100644 07e6e472cc75fafa944e2a6d4b0f101bc476c060 0       .gitignore
Run Code Online (Sandbox Code Playgroud)

您可以看到只剩下 .gitignore 文件。

然后我们更改newfile的内容。然后我们将 newfile 添加到索引中。

$ git add newfile
Run Code Online (Sandbox Code Playgroud)

检查状态:

$ git status -s
M  newfile
D  os-list.txt
D  remote_stuff
D  removethis
?? os-list.txt
?? remote_stuff
?? removethis
Run Code Online (Sandbox Code Playgroud)

我们可以看到 newfile 现在在索引中。

现在,当我们提交文件时,我们希望暂存区域为空。

$ git commit -m "TEST333"
[master 0adab53] TEST333
 4 files changed, 1 insertion(+), 13 deletions(-)
 delete mode 100644 os-list.txt
 delete mode …
Run Code Online (Sandbox Code Playgroud)

git indexing stage

3
推荐指数
1
解决办法
1443
查看次数

标签 统计

css ×1

git ×1

indexing ×1

join ×1

jq ×1

reset ×1

stage ×1