当前位置: 首页 > article >正文

YAML | The Norway Problem

注本文为 “YAML | The Norway Problem” 相关合辑。英文引文机翻未校。略作重排如有内容异常请看原文。The Norway Problem - why StrictYAML refuses to do implicit typing and so should you挪威问题 - 为什么 StrictYAML 拒绝隐式类型化你也应该这样做A while back I met an old coworker and he started telling me about this interesting bug he faced:不久前我遇到了一位老同事他开始告诉我他遇到的一个有趣的错误“So, we started internationalizing the website by creating a config file. We added the UK, Ireland, France and Germany at first.”“所以我们开始通过创建一个配置文件来国际化网站。起初我们添加了英国、爱尔兰、法国和德国。”countries: - GB - IE - FR - DE“This was all fine. However, one day after a quick configuration change all hell broke loose. It turned out that while the UK, France and Germany were all fine,Norwaywasnot…”“这都很好。然而有一天在一次快速的配置更改后一切都崩溃了。结果发现虽然英国、法国和德国都没问题但挪威却不是……”“While the website went down and we were losing money we chased down a number of loose ends until finally finding the root cause.”“当网站瘫痪我们在亏损时我们追踪了许多松散的环节直到最终找到根本原因。”“If turned out that if feed this configuration file into pyyaml:”“如果将这个配置文件输入到 pyyaml 中结果如下”countries: - GB - IE - FR - DE - NO“This is what you got in return:”“你得到的结果是” from pyyaml import load load(the_configuration) {countries: [GB, IE, FR, DE, False]}It snows alotin False.在 False 中下了很多雪。When this is fed to code that expects a string of the form ‘NO’, then the code will usually break, often with a cryptic error, Typically it would be a KeyError when trying to use ‘False’ as a key in a dict when no such key exists.当这个值传递给期望字符串形式为 ‘NO’ 的代码时代码通常会崩溃通常会出现难以理解的错误通常在尝试使用 ‘False’ 作为字典中的键时会出现 KeyError因为没有这样的键。It can be “quick fixed” by using quotes - a fix for sure, but kind of a hack - and by that time the damage is done:可以通过使用引号进行“快速修复”——这确实是一个修复但有点像黑客行为——而到那时损害已经造成countries: - GB - IE - FR - DE - NOThe most tragic aspect of this bug, however, is that it isintendedbehavior according to the YAML 1.2 specification. The real fix requires explicitly disregarding the spec - which is why most YAML parsers have it.然而这个错误最惨痛的方面是根据 YAML 1.2 规范这是预期的行为。真正的修复需要明确无视规范——这就是大多数 YAML 解析器之所以存在的原因。StrictYAML sidesteps this problem by ignoring key parts of the spec, in an attempt to create a “zero surprises” parser.StrictYAML 通过忽略规范的关键部分来规避这个问题试图创建一个“零惊讶”的解析器。Everythingis a string by default:所有内容默认为字符串 from strictyaml import load load(the_configuration).data {countries: [GB, IE, FR, DE, NO]} from strictyaml import load load(the_configuration).data {国家: [GB, IE, FR, DE, NO]}String or float?字符串还是浮点数Norway is just the tip of the iceberg. The first time this problem hit me I was maintaining a configuration file of application versions. I had a file like this initially - which caused no issues:挪威只是冰山一角。第一次遇到这个问题时我正在维护一个应用程序版本的配置文件。起初我有一个这样的文件——没有造成任何问题python: 3.5.3 postgres: 9.3.0python: 3.5.3 postgres: 9.3.0However, if I changed itveryslightly:然而如果我稍微更改一下python: 3.5.3 postgres: 9.3python: 3.5.3 postgres: 9.3I started getting type errors because it was parsed like this:我开始收到类型错误因为它被解析为这样 from ruamel.yaml import load load(versions) [{python: 3.5.3, postgres: 9.3}]# oops those *both* should have been strings from ruamel.yaml import load load(versions) [{python: 3.5.3, postgres: 9.3}]# 哎呀这两个*都*应该是字符串Again, this led to type errors in my code. Again, I ‘quick fixed’ it with quotes. However, the solution I really wanted was:再次这导致我的代码中出现类型错误。再次我用引号“快速修复”了它。然而我真正想要的解决方案是 from strictyaml import load load(versions) [{python: 3.5.3, postgres: 9.3}]# thats betterThe world’s most buggy name世界上最麻烦的名字Christopher Null has a name that is notorious for breaking software code - airlines, banks, every bug caused by a programmer who didn’t know a type from their elbow has hit him.Christopher Null 的名字因破坏软件代码而臭名昭著——航空公司、银行以及每个由于程序员对类型一无所知而导致的错误都影响了他。YAML, sadly, is no exception:可悲的是YAML 也不例外first name: Christopher surname: Null # Is it okay if we just call you Christopher None instead? load(name) {first name: Christopher, surname: None}名字: Christopher 姓: Null # 我们可以称呼你为 Christopher None 吗 load(name) {名字: Christopher, 姓: None}With StrictYAML:使用 StrictYAML from strictyaml import load load(name) {first name: Christopher, surname: Null} from strictyaml import load load(name) {名字: Christopher, 姓: Null}Type theoretical concerns类型理论问题Type theory is a popular topic with regards to programming languages, where a well designed type system is regarded (rightly) as a yoke that can catch bugs at an early stage of development whilepoorlydesigned type systems provide fertile breeding ground for edge case bugs.类型理论是一个与编程语言相关的热门话题设计良好的类型系统被认为正确地是一个可以在开发早期阶段捕获错误的束缚而设计不良的类型系统则为边缘情况错误提供了肥沃的滋生土壤。(it’s equally true that extremely strict type systems require a lot more upfront and the law of diminishing returns applies to type strictness - a cogent answer to the question “why is so little software written in haskell?”).同样极其严格的类型系统需要更多的前期工作并且收益递减法则适用于类型的严格性——这是对“为什么如此少的软件是用 Haskell 编写的”这个问题的有力回答。A less popular, although equally true idea is the notion that markup languages like YAML have the same issues with types - as demonstrated above.一个不太流行但同样真实的观点是像 YAML 这样的标记语言在类型上也存在相同的问题——如上所示。User Experience用户体验In a way, type systems can be considered both a mathematical concern and a UX device.在某种程度上类型系统可以被视为数学问题和用户体验设备的结合。In the above, and in most cases, implicit typing represents a major violation of the UX principle of least astonishment.在上述情况中以及大多数情况下隐式类型化代表了对用户体验最少惊讶原则的重大违反。What design trade-offs led to the “Norway problem” in YAML, and when are they worthwhile?什么设计权衡导致了 YAML 中的“挪威问题”何时是值得的A well-known problem in YAML is a type-inference issue in parsing where a string is misinterpreted as a boolean. This is known as the “Norway problem”, because it occurs when a field or array entry intended to hold an ISO-3166-2 country code as a string is given the code for Norway —NO.一个众所周知的 YAML 问题是解析中的类型推断问题其中字符串被误解为布尔值。这被称为“挪威问题”因为它发生在一个字段或数组条目旨在作为字符串存储ISO-3166-2 国家代码时却给出了挪威的代码 —NO。countries:-SE-NO-FIYAML acceptsyesandnoas true and false values, and so when processed the expected string value in the field is instead a boolean. The syntax highlighting aboveshouldindicate that.YAML 将yes和no视为真和假值因此在处理时字段中预期的字符串值反而变成了布尔值。上面的语法高亮应该表明这一点。Norway is the most noted source of these issues, but it would also happen for Ontario, and for values expected to include the strings “yes”, “true”, “false” (Unix commands), “off” (not leg), “null” (as a surname), “nan” (a relative), and some others. A similar, but separate, issue can arise with version numbers, where1.2.1and1.2are different types, or ratios, where1:12is the float 1.2 but5:60is a string.挪威是这些问题最显著的来源但它也会发生在安大略省以及期望包含字符串 “yes”、“true”、“false”Unix 命令、“off”不是腿、“null”作为姓氏、“nan”亲属等值的情况下。与版本号相关的类似但不同的问题也可能出现其中1.2.1和1.2是不同的类型或者比例其中1:12是浮点数 1.2但5:60是字符串。While YAML is a human-editable serialization format, reminiscent issues could arise in Perl, PHP, shell scripts, and a number of other unequivocal programming languages with unmarked string literals, as well as some other configuration and transfer formats. Later versions of YAML attempted to remove much of this overloading, and it and similar constructions are generally frowned upon — but still present in real-world systems.虽然 YAML 是一种人可编辑的序列化格式但在 Perl、PHP、Shell 脚本以及一些其他没有标记字符串文字的明确编程语言中可能会出现类似的问题以及一些其他配置和传输格式。后来的 YAML 版本试图消除许多这种重载通常会对其及类似构造表示反感——但在现实世界的系统中仍然存在。There are variations, but versions of this sort of issue have arisen enough that the choices leading to them must have value. What conditions lead to these decisions, in YAML or elsewhere, and when (if ever) is this sort of “smart” value parsing a worthwhile trade-off?虽然存在变体但这种问题的版本已经出现得足够多以至于导致这些选择必然有其价值。是什么条件导致了这些决定无论是在 YAML 还是其他地方以及何时如果有这种“智能”值解析是值得的权衡asked May 26, 2023 at 23:44Michael Homer♦It’s not clear to me what you mean by “‘off’ (not leg)”. Are you referring to cricket terminology, perhaps?我不太明白你所说的“‘off’不是腿”是什么意思。你是在指板球术语吗– Karl Knechtel评论于 2024 年 5 月 21 日 21:52Being on one or other side of a line drawn through both middle stumps, yes.是的站在通过两个中间柱子画的线的任一侧。– Michael Homer ♦评论于 2024 年 5 月 21 日 22:03not leg 指板球术语在板球中投球手的投球方向分为“off”球和“leg”球。“off”球是指投向击球手的身体右侧而“leg”球则是投向身体左侧。因此“not leg”可以理解为投球不是针对击球手的左侧在运动中选择不同的方向或策略。Answers回答It is a somewhat reasonable idea to provide convenient facilities for presumed common cases, but when done carelessly, it tends to backfire in unexpected situations. Javascript is notoriously plagued by this problem. Introducing features like this makes the language generally simpler to use. That’s why you can see this in scripting and configuration languages, where it had been intended to facilitate simple tasks. However, the benefits tend to eventually get outweighed by the confusing and inconvenient experiences with unaccounted use-cases. I don’t believe there’s any further motive behind such features other than the near-sightedness of the language authors.提供方便的设施以处理假定的常见情况是一个相对合理的想法但如果做得不够仔细往往会在意想不到的情况下适得其反。JavaScript 因这一问题而臭名昭著。引入这样的特性使得语言通常更易于使用。这就是为什么你可以在脚本和配置语言中看到这一点因为它们旨在简化简单任务。然而随着未考虑的用例带来的困惑和不便利益往往最终被抵消。我不相信这些特性背后还有其他动机除了语言作者的短视。answered May 27, 2023 at 16:01abel1502“It makes easy things easier, and hard things impossible.”“它让简单的事情变得更简单而让困难的事情变得不可能。”– John Gordon评论于 2023 年 7 月 27 日 2:54JohnGordon is that a quote you’ve found elsewhere? I like it! I’d love the source, and if it’s you, to quote you :JohnGordon这是你从其他地方找到的引用吗我喜欢它我想知道来源如果是你我想引用你 :– 0atman评论于 2023 年 12 月 4 日 9:150atman It’s a half-remembered quote about something on Windows – possibly Visual Basic? It’s a deliberate snarky take on an earlier quote something like “the easy things should be easy, and the hard things should be possible”.0atman这是一个关于 Windows 的半记忆引用——可能是 Visual Basic这是对早期一句类似“简单的事情应该简单而困难的事情应该可能”的引用的故意讽刺。– John Gordon评论于 2023 年 12 月 4 日 13:31JohnGordon brilliant, that’s VB in a nutshell! thank you!JohnGordon太棒了这就是 VB 的精髓谢谢你– 0atman评论于 2023 年 12 月 13 日 16:43It’s derived from Larry Wall’s design philosophy for Perl: “Easy things should be easy and hard things should be possible”.它源自 Larry Wall 对 Perl 的设计哲学“简单的事情应该简单而困难的事情应该可能。”– Frank Kusters评论于 2024 年 8 月 30 日 12:15All programming languages (in a very broad sense, including markup and configuration languages, domain-specific languages, etc) can be seen as a way for humans to express ideas in a way that a computer can act on.所有编程语言在非常广泛的意义上包括标记和配置语言、领域特定语言等都可以被视为人类以计算机可以执行的方式表达思想的一种方式。One of the challenges this poses is that human thought is imprecise, fuzzy, and contextual; whereas electronics are (at least by design) precise, logical, and deterministic. This leads to an endless series of design decisions:when do we insist that the programmer must “think like a computer”, and when do we try to teach the computer to “think like a human”?这一挑战在于人类的思维是不精确的、模糊的和上下文相关的而电子设备至少在设计上是精确的、逻辑的和确定的。这导致了一系列无尽的设计决策我们何时坚持程序员必须“像计算机一样思考”而何时又试图教计算机“像人类一样思考”For example, an assembly language might assign mnemonics to locations in memory, but a higher-level language allows the programmer to ignore memory layout completely, and just “declare a variable”. To allocate the correct memory for that variable, the compiler needs to know its type, but may provide facilities toinferthat type from its surrounding context.例如汇编语言可能会将助记符分配给内存中的位置但高级语言允许程序员完全忽略内存布局只需“声明一个变量”。为了为该变量分配正确的内存编译器需要知道它的类型但可以提供从其周围上下文推断该类型的功能。Most of the time, these are powerful features that help programmers to express their ideas; but sometimes they hide details thatareimportant. The Java manual links to this style guide discussing the pros and cons of using thevarkeyword introduced in Java 10. One of its examples of thedangersof the feature is where a literal could represent multiple types:大多数情况下这些都是强大的功能可以帮助程序员表达他们的想法但有时它们会隐藏重要的细节。Java 手册链接到这个风格指南讨论使用 Java 10 中引入的var关键字的优缺点。它的一个示例是该特性的危险其中一个字面量可能代表多种类型// ORIGINAL byte flags 0; short mask 0x7fff; long base 17; // DANGEROUS: all infer as int var flags 0; var mask 0x7fff; var base 17;This is essentially what is happening in the “Norway problem”: rather than requiring the user to mark all string values with quote marks (or all non-string values with some other syntax), YAML requires parsers toinferthe type of expressions based on specific values. When the values are unambiguous, this makes the syntax look a lot more like what a human would naturally write - a list of strings can be as simple as:这基本上就是“挪威问题”中发生的事情YAML 不要求用户用引号标记所有字符串值或用其他语法标记所有非字符串值而是要求解析器根据特定值推断表达式的类型。当值不模糊时这使得语法看起来更像人类自然书写的内容——字符串列表可以简单到- item one - item two - item three- 项目一 - 项目二 - 项目三And a boolean setting can be:而布尔设置可以是spline_reticulation: onBut this syntax isinherently ambiguous. The language specification defines which interpretation should be followed, but it’s not always the interpretation that a human would choose with knowledge of the context.但这种语法本质上是模糊的。语言规范定义了应该遵循哪种解释但这并不总是人类在了解上下文时会选择的解释。Automatic type coercion can have similar problems. For instance, PHP is designed for use with HTTP, a string-based protocol, so allows users to treat numeric strings directly as numbers:1 2 3. But exactlywhento apply that coercion is not always clear-cut, e.g. if0 0and0.0 0are both true, is0 0.0also true? Neither answer is going to match intentions in 100% of cases.自动类型强制转换可能会有类似的问题。例如PHP 是为 HTTP 设计的这是一种基于字符串的协议因此允许用户将数字字符串直接视为数字1 2 3。但究竟何时应用这种强制转换并不总是明确的例如如果0 0和0.0 0都为真0 0.0也为真吗这两个答案都不会在 100% 的情况下符合意图。There is something of a paradox:the more you try to hide the complexity from the user, the more complexity you have to introduce. Every time we allow the computer toassumethe intention of the human, rather than demanding explicit information, we run the risk of it making awrongassumption.这有些矛盾你越是试图向用户隐藏复杂性就越需要引入更多的复杂性。每次我们允许计算机假设人类的意图而不是要求明确的信息时我们都面临着它做出错误假设的风险。edited Jun 15, 2024 at 13:56answered Jun 15, 2024 at 12:51IMSoPreferenceThe Norway Problem - why StrictYAML refuses to do implicit typing and so should you - HitchDevhttps://hitchdev.com/strictyaml/why/implicit-typing-removed/types - What design trade-offs led to the “Norway problem” in YAML, and when are they worthwhile? - 2023https://langdev.stackexchange.com/questions/1123/what-design-trade-offs-led-to-the-norway-problem-in-yaml-and-when-are-they-woISO - ISO 3166 — Country Codeshttps://www.iso.org/iso-3166-country-codes.htmlYAML挪威问题(The Norway Problem)根据 iso-3166-country-codes 标准每个国 - 2023https://juejin.cn/post/7195414234115620901

相关文章:

YAML | The Norway Problem

注:本文为 “YAML | The Norway Problem” 相关合辑。 英文引文,机翻未校。 略作重排,如有内容异常,请看原文。 The Norway Problem - why StrictYAML refuses to do implicit typing and so should you 挪威问题 - 为什么 Stric…...

EVE-NG抓包踩坑实录:手把手教你配置Wireshark wrapper.bat,解决密码错误报错

EVE-NG抓包故障深度解析:从密码错误到Wireshark完美联动的全流程指南 在虚拟网络实验室的构建中,EVE-NG无疑是工程师们的首选平台。然而当我们需要进行深度报文分析时,Wireshark与EVE-NG的联动配置却常常成为技术道路上的"拦路虎"…...

谷歌泄露Chromium未修复漏洞细节,数万用户或面临远程代码执行风险

Chromium漏洞泄露:从发现到“修复”的漫长历程 2022年12月,安全研究员Lyra Rebane报告了Chromium中一个未修复的漏洞,该漏洞会导致JavaScript在浏览器关闭后仍在后台运行,允许在设备上执行远程代码,此问题随后被确认为…...

从零构建Sora 2-UE5.4可信工作流:基于IEEE 1872标准的生成内容元数据注入方案(附GitHub认证仓库)

更多请点击: https://intelliparadigm.com 第一章:从零构建Sora 2-UE5.4可信工作流:基于IEEE 1872标准的生成内容元数据注入方案(附GitHub认证仓库) 核心目标与标准对齐 本工作流严格遵循 IEEE P1872™(O…...

精准数字化管控赋能医养融合

随着医养结合成为养老行业发展核心趋势,传统医养管理模式存在数据割裂、健康监测滞后、服务台账杂乱、管控统筹困难等问题,难以适配现代化康养机构运营需求。智慧养老医养管理数据大屏,聚焦医养融合核心场景,整合医疗健康与养老服…...

MCP模型控制平面:AI自动化系统的可观察、可治理底座

1. 项目概述:MCP到底是什么,它凭什么被称为AI自动化的“金钥匙”“MCP——The Golden Key for AI Automation”这个标题一出来,很多刚接触AI工程化的朋友第一反应是:又一个新造词?听着像营销话术。但我在过去三年里&am…...

跨越语言障碍:为MASA模组系列打造专业级中文体验解决方案

跨越语言障碍:为MASA模组系列打造专业级中文体验解决方案 【免费下载链接】masa-mods-chinese 一个masa mods的汉化资源包 项目地址: https://gitcode.com/gh_mirrors/ma/masa-mods-chinese 在Minecraft的模组生态系统中,MASA系列模组以其强大的功…...

trae 提示 测到模型循环,请求已被中断。请重试或新建任务。怎么处理?

这个提示是 Trae 的防死循环保护机制,核心原因是:模型陷入了「重复执行无效操作 → 无法推进任务 → 又重复执行」的循环,系统主动中断请求,避免资源浪费和任务卡死。下面给你拆解常见原因和对应的解决办法,按从高到低…...

终极指南:如何快速构建中文手写识别AI系统(免费数据集)

终极指南:如何快速构建中文手写识别AI系统(免费数据集) 【免费下载链接】Traditional-Chinese-Handwriting-Dataset Open source traditional chinese handwriting dataset. 项目地址: https://gitcode.com/gh_mirrors/tr/Traditional-Chin…...

NotebookLM显著性判断失效真相:92%用户忽略的3个统计学前提及实时校验脚本

更多请点击: https://codechina.net 第一章:NotebookLM显著性判断失效的典型现象与影响评估 NotebookLM 在处理多源异构文档时,其内置的“显著性判断”模块(Significance Scorer)常因语义稀疏、上下文截断或引用锚点偏…...

ARMv8 AArch32调试异常机制与断点技术详解

1. AArch32调试异常架构解析在ARMv8架构的AArch32执行状态下,调试异常机制为开发者提供了强大的程序控制能力。这套机制通过硬件断点和软件断点指令(BKPT)实现对程序执行流的精确控制,其核心设计哲学体现在三个层面:异…...

从NPN到FET:一文看懂LDO内部调整管的演进史,以及如何根据你的项目(IoT、可穿戴、汽车电子)选择最优架构

从NPN到FET:LDO调整管技术演进与选型实战指南 在可穿戴设备的心率传感器突然断电的瞬间,工程师们才意识到选错LDO的代价——这恰恰揭示了调整管架构对系统可靠性的决定性影响。从早期笨重的NPN稳压器到如今纳米级MOSFET LDO,电源管理芯片的进…...

保姆级教程:在Ubuntu 22.04上从源码编译RISC-V SPIKE模拟器(含libboost报错解决)

从零构建RISC-V开发环境:Ubuntu 22.04下SPIKE模拟器深度编译指南 当第一次接触RISC-V生态时,搭建可靠的开发环境往往成为新手面临的第一个挑战。作为RISC-V官方推荐的指令集模拟器,SPIKE以其轻量级和准确性成为学习RISC-V架构的理想工具。本文…...

量子近似优化算法(QAOA)原理与实践指南

1. 量子近似优化算法(QAOA)基础解析 量子近似优化算法(QAOA)是近年来量子计算领域最具应用前景的混合算法之一。作为一名长期从事量子算法研究的工程师,我见证了QAOA从理论构想到实际应用的完整发展历程。这种算法巧妙地将经典优化技术与量子线路相结合,…...

PaddleOCR车牌识别实战:从3万张数据集处理到模型训练部署的完整避坑指南

PaddleOCR车牌识别实战:从3万张数据集处理到模型训练部署的完整避坑指南 车牌识别作为计算机视觉领域的经典应用场景,在智慧交通、安防监控、停车场管理等行业有着广泛需求。PaddleOCR作为国内领先的OCR开源框架,凭借其优异的性能和丰富的预训…...

FSearch技术深度解析:如何用C语言和GTK3实现毫秒级文件搜索

FSearch技术深度解析:如何用C语言和GTK3实现毫秒级文件搜索 【免费下载链接】fsearch A fast file search utility for Unix-like systems based on GTK3 项目地址: https://gitcode.com/gh_mirrors/fs/fsearch 在Linux生态系统中,文件搜索一直是…...

Ender-3固件配置终极指南:5步简单快速性能优化

Ender-3固件配置终极指南:5步简单快速性能优化 【免费下载链接】Ender-3 The Creality3D Ender-3, a fully Open Source 3D printer perfect for new users on a budget. 项目地址: https://gitcode.com/gh_mirrors/en/Ender-3 Ender-3固件配置是解锁3D打印机…...

SPT-AKI存档编辑器:5分钟掌握离线塔科夫角色定制终极方案

SPT-AKI存档编辑器:5分钟掌握离线塔科夫角色定制终极方案 【免费下载链接】SPT-AKI-Profile-Editor Программа для редактирования профиля игрока на сервере SPT-AKI 项目地址: https://gitcode.com/gh_mirror…...

告别玄学:用Dobby+EdXposed精准Hook安卓Native函数的保姆级避坑指南

告别玄学:用DobbyEdXposed精准Hook安卓Native函数的保姆级避坑指南 在安卓逆向工程领域,Hook技术一直是分析应用行为、修改逻辑流程的利器。当常规的Java层Hook无法触及核心逻辑时,Native层的Hook就显得尤为重要。本文将带你深入Native Hook的…...

从MySQL迁移到GaussDB:一个后端开发者的初体验与核心操作对比(含表、索引、视图、联表查询)

从MySQL迁移到GaussDB:一个后端开发者的初体验与核心操作对比 作为一名长期使用MySQL的后端开发者,第一次接触GaussDB时既兴奋又忐忑。兴奋的是有机会体验国产数据库的强大性能,忐忑的是不知道这个"新朋友"会不会带来意想不到的挑战…...

Chrome二维码插件终极指南:3分钟解决跨设备链接传输难题

Chrome二维码插件终极指南:3分钟解决跨设备链接传输难题 【免费下载链接】chrome-qrcode :zap: A Chrome plugin to Genrate QRCode of URL / Text, or Decode the QRcode in website. 一个Chrome浏览器插件,用于生成当前URL或者选中内容的二维码&#x…...

OpenSCENARIO与OpenDRIVE如何协同工作?一份给仿真工程师的避坑指南

OpenSCENARIO与OpenDRIVE协同工程实践:从原理到避坑全指南 自动驾驶仿真测试中,动态场景与静态地图的精准配合如同交响乐团的指挥与乐谱——OpenSCENARIO负责编排车辆行为,OpenDRIVE则定义道路的物理结构。当两者协同出现毫米级偏差&#xff…...

【.NET新特性·第2篇】C# 12 全特性回顾:语法糖的盛宴

C# 12 带来了主构造函数、集合表达式、Inline Arrays 等 8 个新特性,让代码更简洁 版本定位 适用版本:.NET 8 | C# 12 前置知识:C# 11 基础语法 背景 C# 11 引入了原始字符串字面量、list patterns 等特性,但开发者们期待更多语法…...

多智能体路由:从场景定义到Agent解析的工程实践

大家好,我是程序员小策。 场景:你正在做一个 AI 面试系统。产品经理说:“我们不光要一个通用聊天机器人,还要一个能自动出题、能给用户答案打分、还能分析用户表情神态的面试官。” 你一拍脑袋:行,不就是…...

CANN 显存优化深度解析:梯度累积、混合精度与显存回收实战

CANN 显存优化深度解析:梯度累积、混合精度与显存回收实战显存不够跑不了大模型?这篇讲清楚昇腾上的显存优化技术,从原理到实践。显存问题诊断流程 OOM 报错 → 检查模型大小 → 分析梯度占用 → 定位瓶颈 → 选择优化方案显存问题是大模型训…...

2026 年好用的事业编面试软件盘点:AI 驱动的结构化备考解决方案

文章摘要 随着 2026 年全国事业单位招聘考试进入高峰期,越来越多的考生开始借助专业软件进行面试备考。本文从技术架构、功能完整性、用户体验和备考效果四个维度,对当前市场上主流的事业编面试软件进行全面测评。经过多轮实际测试和用户反馈分析&#…...

别再手动复制粘贴了!ChatGPT原生PPT导出功能已上线(仅限Enterprise Tier),3大未公开API接口实测报告

更多请点击: https://intelliparadigm.com 第一章:ChatGPT原生PPT导出功能的架构演进与企业级定位 ChatGPT原生PPT导出功能并非简单集成第三方渲染库,而是OpenAI在模型服务层、内容生成中间件与文档编排引擎三者深度协同下构建的端到端能力。…...

NotebookLM默认α=0.05合理吗?(基于127个真实知识图谱实验的P值稳健性评估报告)

更多请点击: https://codechina.net 第一章:NotebookLM默认α0.05合理吗?(基于127个真实知识图谱实验的P值稳健性评估报告) 在NotebookLM的知识图谱推理链中,显著性阈值α被硬编码为0.05,该设定…...

编程入门必存 100 个经典代码 自学提升一站式合集

前言 我记得刚开始接触编程的时候,觉得太难了。 也很好奇,写代码的那些人也太厉害了吧?全是英文的,他们的英文水平一定很好吧? 他们是怎么记住这么多代码格式的?而且错了一个标点符号,整个程…...

2026这6款宝藏降AIGC软件大起底,一键把AIGC率降至安全线!

步入 2026 年,学术圈的风向早已不是过去那个只看查重率的时代了。如今,AI 检测系统像长了眼睛一样,精准捕捉每一段文字中的 AI 痕迹。高校的审核标准也愈发严苛,论文不仅要“看起来像人写的”,更要“读起来像人写的”。…...