v4l-ctl media-ctl media-ctl.c -p: 打印 device topology $ media-ctl -p --print-dot: 输出 graphviz DOT 格式图形描述。 # 将输出保存到文件并转换为图像 $ media-ctl --print-dot > topology.dot $ dot -Tpng topology.dot -o topology.png -e: 指定某个 entity name, 打印属于哪个 device $ media-ctl -e rtsisp_video0 /dev/video0 --get-v4l2 or --get-format: 查看某个 pad 的格式 # 使用entity ID $ media-ctl --get-v4l2 0:1 # entity 0的pad 1 $ media-ctl --get-v4l2 5:0 # entity 5的pad 0 # 使用entity 名称 $ media-ctl --get-v4l2 '"sensor":1' # 名为"sensor"的entity的pad 1 $ media-ctl --get-v4l2 '"isp":0' # 名为"isp"的entity的pad 0 -r: reset all links to inactive...
Posts
Syntax --- title: Bank example --- classDiagram class BankAccount BankAccount : +String owner BankAccount : +Bigdecimal balance BankAccount : +deposit(amount) BankAccount : +withdrawal(amount) classDiagram class BankAccount BankAccount : +String owner BankAccount : +Bigdecimal balance BankAccount : +deposit(amount) BankAccount : +withdrawal(amount) Define a class class label classDiagram class Animal["Animal with a label"] class Car["Car with *! symbols"] Animal --> Car classDiagram class Animal["Animal with a label"] class Car["Car with *! symbols"] Animal --> Car Define members of a class classDiagram class BankAccount{ +String owner +BigDecimal balance +deposit(amount) +withdrawal(amount) } classDiagram class BankAccount{ +String owner +BigDecimal balance +deposit(amount) bool +withdrawal(amount) int } 区别 attributes 和 methods 的方法是,带()的是 methods。...
Syntax ->> 同步消息,-)异步消息。 sequenceDiagram Alice->>John: Hello John, how are you? John-->>Alice: Great! Alice-)John: See you later! sequenceDiagram Alice->>John: Hello John, how are you? John-->>Alice: Great! Alice-)John: See you later! Participants sequenceDiagram participant Alice participant Bob Bob->>Alice: Hi Alice Alice->>Bob: Hi Bob sequenceDiagram participant Alice participant Bob Bob->>Alice: Hi Alice Alice->>Bob: Hi Bob Actors actor 会有一个人物的标志。 sequenceDiagram actor Alice actor Bob Alice->>Bob: Hi Bob Bob->>Alice: Hi Alice sequenceDiagram actor Alice actor Bob Alice->>Bob: Hi Bob Bob->>Alice: Hi Alice Aliases sequenceDiagram participant A as Alice participant J as John A->>J: Hello John, how are you?...
Lab >>> print('Go') Go HW Q1 A Plus Abs B python3 ok -q a_plus_abs_b --local def a_plus_abs_b(a, b): if b < 0: f = sub else: f = add return f(a, b) Q2 Two of Three python3 ok -q two_of_three --local 返回三个数中最小的两个数。先取 min(i, j)得到较小的一个数,在从 min(max(i, j), k)中得到第二小的数。 def two_of_three(i, j, k): return min(i, j)**2 + min(max(i, j), k)**2 Q3 Largest Factor python3 ok -q largest_factor --local 返回能被整除的最大数。从 1 到 n 遍历,如果 n%i==0 即能够整除,返回最大值。...
Lab Q1 Short Circuiting >>> True and 13 13 >>> False or 0 0 >>> not 10 False >>> print(3) or "" # 首先会打印3,再打印“” 3 "" Q2 High-order Function ...
Lab Q1 WWPD: Lists & Ranges python3 ok -q lists-wwpd -u --local >>> list(range(3, 6)) [3,4,5,6,7,8] >>> range(3, 6) range(3,6) >>> range(4)[-1] 3 Q4 WWPD: List Comprehensions >>> [[1] + s for s in [[4], [5, 6]]] [[1, 4], [1, 5, 6]] Q8 Making Onions HW Q1 Num Eights 计算 n 中 8 出现的次数。 def num_eights(n): """Returns the number of times 8 appears as a digit of n. >>> num_eights(3) 0 >>> num_eights(8) 1 >>> num_eights(88888888) 8 >>> num_eights(2638) 1 >>> num_eights(86380) 2 >>> num_eights(12345) 0 >>> num_eights(8782089) 3 """ if n == 0: return 0 return num_eights(n // 10) + (1 if n % 10 == 8 else 0) Q2 Digit Distance 递归计算 n 各位差的总和。...
Lab 检查所有得分: python3 ok --score --local Q1: WWPD: List-Mutation python3 ok -q list-mutation -u --local >>> s = [9, 7, 8] >>> a, b = s, s[:] # s[:] 是 s 的浅拷贝 >>> s = [3] >>> s.extend([4, 5]) >>> a [9, 7, 8] 注意在 s 重新赋值后, a 和 s 不指向同一位置了. 初始状态: s —-> [9,7,8] a —-> [9,7,8] (和 s 指向同一个对象) b —-> [9,7,8] (独立的副本) 执行 s = [3] 后: s —-> [3] a —-> [9,7,8] (保持不变) b —-> [9,7,8] (保持不变)...
VSCode 配置 python Lab00 python3 ok --help: 查看 ok 提示。 python3 ok -q <file> -u: 运行单个 tests 目录下的测试。 python3 ok -q <function>: 运行单个函数的测试。 python3 ok: 运行全部测试。 python3 ok --score:查看分数。 python3 ok --local:本地运行测试。 python3 -m doctest lab00.py: 运行 doctest。 python3 -i xxx.py: 进入 python 交互模式 python3 -m doctest xxx.py: 运行函数的 doctest,如下,会运行»>后的函数,并与 2024 对比。如果 pass 的话不会有任何输出。 def twenty_twenty_four(): """Come up with the most creative expression that evaluates to 2024 using only numbers and the +, *, and - operators....
Building Abstractions with Data 2.1 Introduction 2.1.1 Native Data Types Python includes three native numeric types: integers (int), real numbers (float), and complex numbers (complex). >>> type(2) <class 'int'> >>> type(1.5) <class 'float'> >>> type(1+1j) <class 'complex'> 2.2 Data Abstraction 2.3 Sequences 2.3.1 Lists >>> digits = [1, 8, 2, 7] >>> len(digits) # 返回list长度 4 >>> digits[3] 8 >>> digits[-1] # 最后一个元素 7 # 这样也可以取list中的值 >>> digits = [1, 2, 3] >>> x, y, z = digits # 注意这边必须和list中元素的数量对应上才能unpack >>> x 1 >>> y 2 >>> z 3 List 的加法和乘法:...