小编asf*_*man的帖子

IETF 是否发布包含勘误表的 RFC 版本?

当阅读 IETF 发布的 RFC 时,如果不明确检查勘误表,很难知道哪些内容已被更正。例如,在RFC 7049 第 2.4.2 节中,勘误表中存在以下更正:

diff --git a/rfc7049.txt b/rfc7049.txt
index 5d29907..c7c20e6 100644
--- a/rfc7049.txt
+++ b/rfc7049.txt
@@ -886,7 +886,7 @@ RFC 7049                          CBOR                      October 2013
    and eight bytes 0x00).  In hexadecimal:
 
    C2                        -- Tag 2
-      29                     -- Byte string of length 9
+      49                     -- Byte string of length 9
          010000000000000000  -- Bytes content
Run Code Online (Sandbox Code Playgroud)

但要意识到这个特定的部分已被更正,我必须事先查看勘误表并写下所有有更正的部分。然后,如果我遇到已更正的部分,我必须回顾勘误表并找到特定的更正内容。

那么,为了简化此过程,IETF 是否发布了包含勘误表的 RFC 版本?

rfc ietf

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

Python - 为什么我的列表没有在此方法的范围之外进行修改?我如何修改我的代码,使其成为这样?

我有以下方法:

def instances(candidate, candidates):
    count = candidates.count(candidate)

    # Removing candidate from candidates. #
    list(filter(candidate.__ne__, candidates))
    return {candidate: count}
Run Code Online (Sandbox Code Playgroud)

其预期目的是查找列表中某个元素的实例数,从列表中删除这些实例,并返回 Key:Value表示该元素及其实例数的对。

因此,如果我创建一个列表并调用该函数,它应该执行以下操作:

>>> someList = [1, 1, 1, 2, 3]
>>> print(instances(1, someList))
{1: 3}
>>> print(someList)
[2, 3]
Run Code Online (Sandbox Code Playgroud)

然而,对于最后一行,我得到的是:

>>> print(someList)
[1, 1, 1, 2, 3]
Run Code Online (Sandbox Code Playgroud)

该行list(filter(candidate.__ne__, candidates))返回我想要的正确列表,但它似乎只存在于函数的范围内。如果我修改这一行来代替 read candidates = list(filter(candidate.__ne__, candidates)),由于某种原因,candidates它会被解释为函数范围内的局部变量。我不能简单地返回列表过滤器,因为我需要Key:Value为程序的另一部分返回该对。

我发现很奇怪的是,candidates在这一行中被解释为局部变量,而就在其上方,对的引用candidates被解释为函数的参数。

有人可以帮我理解为什么会发生这种情况吗?如果可能的话,建议一个符合预期目的的解决方案?谢谢!

python scope list filter

2
推荐指数
1
解决办法
1308
查看次数

最有效:在第一个空间后切断varchar?

在第一个空格之后切断varchar的最有效方法是什么'FIRST_STRING SECOND_STRING THIRD_STRING',它应该返回'FIRST_STRING'?这将在数​​千行的潜在数量上运行.

t-sql sql-server varchar

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

标签 统计

filter ×1

ietf ×1

list ×1

python ×1

rfc ×1

scope ×1

sql-server ×1

t-sql ×1

varchar ×1