首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏灰子学技术

    Go之heap

    // Init 操作对于堆不变性(invariants)具有幂等性, // 无论堆不变性是否有效, 它都可以被调用。 // Init 函数的复杂度为 O(n) , 其中 n 等于 h.Len() 。 routines in this package. // Any type that implements it may be used as a // min-heap with the following invariants Len() Pop() interface{} // remove and return element Len() - 1. } // Init establishes the heap invariants required by the other routines in this package. // Init is idempotent with respect to the heap invariants // and may be called whenever the heap invariants may have been invalidated. // The complexity is O(

    96620发布于 2020-08-21
  • 来自专栏C++核心准则原文翻译

    C++核心准则E4,5:设计并构建不变量

    E.4: Design your error-handling strategy around invariants E.4:围绕不变量设计错误处理策略 Reason(原因) To use an object isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#e4-design-your-error-handling-strategy-around-invariants

    64820发布于 2020-07-29
  • 来自专栏Dance with GenAI

    用ChatGPT编写Excel函数公式进行表格数据处理分析,so easy!

    实际中的单元格位置是B2,在这里替换一下,然后下拉: 例子2: Excel表格单元格A331的内容为: Vladimir Vapnik-Predicates, Invariants, and the Essence of Intelligence 将其开头加上“72 –”,变成:72 –Vladimir Vapnik-Predicates, Invariants, and the Essence of Intelligence

    31710编辑于 2024-06-24
  • 来自专栏后端云

    Golang标准库 container/heap

    . // Any type that implements it may be used as a // min-heap with the following invariants (established element Len() Pop() any // remove and return element Len() - 1. } // Init establishes the heap invariants required by the other routines in this package. // Init is idempotent with respect to the heap invariants // and may be called whenever the heap invariants may have been invalidated. // The complexity is O( , } // Create a priority queue, put the items in it, and // establish the priority queue (heap) invariants

    59410编辑于 2023-02-10
  • 来自专栏JusterZhu

    Contract

    它允许开发人员定义前置条件(Preconditions)、后置条件(Postconditions)和不变式(Invariants),从而提高代码的健壮性和可维护性。 不变式(Invariants):在对象生命周期内始终保持为真的条件。

    36600编辑于 2025-01-23
  • 来自专栏Keegan小钢

    AI+Web3实战营日志 #9 | 完成第二个里程碑

    Web/APP 背景,对 EVM 语义、交易原子性、重入、存储布局、权限模型 等缺乏直觉,也不熟悉 Foundry/Hardhat、mainnet-fork、预言机/DEX 的 mock、fuzz 与 invariants 工具门槛:mainnet-fork、Oracle/DEX mock、fuzz/invariants、cheatcodes 的学习与维护成本高。 可执行规格:把关键业务规则写成断言、属性测试与不变量(invariants),持续守护核心假设。

    17510编辑于 2025-11-12
  • 来自专栏JAVA烂猪皮

    基于CAS非阻塞并发队列ConcurrentLinkedQueue源码解析

    private static final long serialVersionUID = 196745693267521676L; /** * The fundamental invariants * Invariants: * - all live nodes are reachable from head via succ() * - head ! = head * Non-invariants: * - head.item may or may not be null. * Invariants: * - the last node is always reachable from tail via succ() * - tail ! = null * Non-invariants: * - tail.item may or may not be null.

    47030编辑于 2023-09-04
  • 来自专栏用户2442861的专栏

    Java的NIO之ByteBuffer底层分析

    不多说,上源码: Java代码   public abstract class Buffer {   // Invariants: mark <= position <= limit <=  c.Invariants 各种指针变量 d.Clearing, flipping, and rewinding 清除数据,位置(position)置0(界限limit为当前位置),位置(position // Creates a new buffer with the given mark, position, limit, and capacity, // after checking invariants

    1.4K40发布于 2018-09-19
  • FreeBSD 14.3 候选版本附带 Docker 镜像和关键修复

    Beta 版本为希望轻松设置现代图形环境的桌面用户带来了极大的便利,但 RC1 的重点在于一些底层改进,包括修复了导致 arm64 系统出现问题的棘手 Wi-Fi 驱动程序问题,以及mac_do启用 INVARIANTS

    29010编辑于 2025-06-08
  • 来自专栏C++核心准则原文翻译

    C++核心准则C.90:依靠构造函数和赋值运算符,而不是内存初始化和内存拷贝‍

    constructor and/or copy assignment operator to appropriately make a copy of the class, preserving the type's invariants

    1.2K20发布于 2020-03-25
  • 来自专栏个人分享

    JAVA源码走读(二)二分查找与Arrays类

    * less k great * * Invariants * less k great * * Invariants | * less k great * * Invariants

    51540发布于 2018-09-06
  • 来自专栏木鸟杂记

    写对代码的利器——“循环不变性”

    本文就从”不变性“(invariants)的角度,给大家一些增加信心的”打开方式“。 循环不变性 如果大家看过算法导论,应该对这个词不陌生。 粗略来说,在算法中,循环不变性(loop invariants)指的是在迭代三个关键环节(初始化、迭代中、结束时)上维持某种性质的不变。

    29410编辑于 2024-03-22
  • 来自专栏健程之道

    Java面试-List中的sort详细解读

    lo; int right = start; assert left <= right; /* * Invariants left = mid + 1; } assert left == right; /* * The invariants

    92910发布于 2019-11-04
  • 来自专栏C++核心准则原文翻译

    C++核心准则​NR.5:不要使用两阶段初始化

    two-phase initialization NR.5:不要使用两阶段初始化 Reason(原因) Splitting initialization into two leads to weaker invariants

    66010发布于 2020-11-10
  • 来自专栏阿林前端开发攻城狮

    什么是NIO

    获取一个容量大小为1024字节的字节缓冲区 ByteBuffer byteBuffer = ByteBuffer.allocate(1024); 核心属性 缓冲区的父类Buffer中有几个核心属性,如下 // Invariants

    66420发布于 2021-09-26
  • 来自专栏C++核心准则原文翻译

    C++核心准则E.16:析构函数,内存释放和swap操作永远不能失败

    If they do, basic standard-library invariants are broken. 标准库假设析构函数,内存释放函数(例如delete运算符),swap都不会抛出异常。

    87930发布于 2020-08-04
  • 来自专栏算法与编程之美

    排序算法在JDK中的应用(二)快速排序

    * less k great * * Invariants * less k great * * Invariants | * less k great * * Invariants

    1.6K30发布于 2019-07-17
  • 来自专栏安全基础

    egg教程(一):e-graphs and equality saturation的概念

    []; // read-only phase, invariants are preserved for rw in rewrites { for (subst matches.push((rw, subst, eclass)); } } // write-only phase, temporarily break invariants egraph.add(rw.rhs.subst(subst)); egraph.union(eclass, eclass2); } // restore the invariants

    1.7K20编辑于 2023-10-17
  • 来自专栏计算机视觉理论及其实现

    tf.while_loop

    tf.while_loop( cond, body, loop_vars, shape_invariants=None, parallel_iterations=10, = lambda i, m: [i+1, tf.concat([m, m], axis=0)]tf.while_loop( c, b, loop_vars=[i0, m0], shape_invariants

    3.3K40编辑于 2022-09-03
  • 来自专栏于晓飞的专栏

    DualPivotQuickSort 双轴快速排序 源码 笔记

    | * less k great * * Invariants * less k great * * Invariants | | * less k great * * Invariants

    1.3K20发布于 2018-09-11
领券