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

    Kotlin Contracts DSL

    text.isEmpty()) { text = "我永远喜欢燕结芽" } println(text.length) // ok, smart cast to String 为了解决这个问题,于是就有了 Contracts Contracts DSL Contracts DSL 可以为编译器提供关于函数行为的附加信息,帮助编译器分析函数的实际运行情况。 如果启用了该特性,那么编译器就能解析获取 Contracts DSL 所表达的信息,用于数据流分析。 为了开启这个特性,我们需要给编译器传入提供额外的编译参数: -Xeffect-system 和 -Xread-deserialized-contracts。 现在 Contracts DSL 位于 kotlin.internal.contracts 这个包内,是 internal 的,一般用户还无法直接拿来写自己的 contract,等JB那帮人把这个功能做好了就会公开这套

    1.2K10发布于 2020-02-20
  • 来自专栏码农编程进阶笔记

    浅析 Laravel 底层原理:契约(Contracts

    例如,Illuminate\Contracts\Queue\Queue 契约定义了队列任务所需的方法,而 Illuminate\Contracts\Mail\Mailer 契约定义了发送电子邮件所需的方法 php namespace App\Orders; use Illuminate\Contracts\Cache\Repository as Cache; class Repository { php namespace App\Listeners; use App\User; use App\Events\OrderWasPlaced; use Illuminate\Contracts\

    1.5K20发布于 2021-07-20
  • 来自专栏小坤探游架构笔记

    Contracts - 如何进行架构契约决策

    Strict Contracts 首先我们需要先了解什么是Strict Contracts? Strict Contracts要求严格遵循名称、类型、顺序以及所有其他细节, 不能存在任何的歧义, 在软件领域最严格的契约类型示例是我们熟悉的RPC方式, 比如两个服务之间采用gRPC协议来定义客户资料如下 Strict & Loose Contracts 对比 Customer Driven Contracts 在上面我们讨论到微服务架构如果采用松散的契约类型, 比如像KV形式, 那么必然需要有一个模式验证契约的准确性 "required": ["id", "name"] } 通过上述定义的scheme可以为我们在服务通信过程中提供了相关的元数据, 然而在微服务架构中还有一种基于Customer Driven Contracts 在《Software Architecture: The Hard Parts》关于Customer Driven Contracts是这样阐述: The concept of a consumer-driven

    16110编辑于 2025-11-20
  • 来自专栏全栈程序员必看

    浅析 Laravel 底层原理:契约(Contracts)「建议收藏」

    例如,Illuminate\Contracts\Queue\Queue 契约定义了队列任务所需的方法,而 Illuminate\Contracts\Mail\Mailer 契约定义了发送电子邮件所需的方法 php namespace App\Orders; use Illuminate\Contracts\Cache\Repository as Cache; class Repository php namespace App\Listeners; use App\User; use App\Events\OrderWasPlaced; use Illuminate\Contracts

    1.3K10编辑于 2022-07-12
  • 来自专栏代码男人

    Contracts 函数说起~

    Contracts是什么? Contracts是合同、契约的意思。从Kotlin1.3版本的时候就被引入了,简单的来说Contracts可以用来解决一些编译器无法完成的功能。 这就需要Contracts出场了。 Contracts的使用方法 Contracts API 一般如下所示: fun A() {     contract {     } } 当前主要使用方式有returns、callsInPlace等 CallInPlace Contracts CallInPlace的使用也是很广泛的,比如我们在Kotlin中常用的标准函数apply、also等。 Contracts的源码 首先我们来看下contract函数的源码,如下所示: @ContractsDsl @ExperimentalContracts @InlineOnly @SinceKotlin

    88420编辑于 2022-06-12
  • 来自专栏YYDS

    Meta佛萨奇系统开发(Smart contracts)成熟技术

    Blockchain games do give many players a unique and novel experience.Decentralization through smart contract and blockchain technology applications

    45040编辑于 2023-04-10
  • 来自专栏后端

    C# 一分钟浅谈:Code Contracts 与契约编程

    其中,Code Contracts 是一个非常有用的工具,它允许开发者通过契约编程的方式来增强代码的健壮性和可维护性。 本文将从浅到深地介绍 Code Contracts 的基本概念、常见问题、易错点及如何避免这些问题,并通过具体的代码案例进行解释。什么是 Code Contracts? Code Contracts 是 .NET Framework 提供的一个库,用于在代码中定义前置条件、后置条件和对象不变量。 安装 Code Contracts在 Visual Studio 中使用 Code Contracts 需要安装相应的 NuGet 包。可以通过以下步骤安装:打开 Visual Studio。 然而,使用 Code Contracts 时也需要注意一些常见的问题和易错点,避免过度依赖契约和忽略性能影响。希望本文的内容能够帮助你更好地理解和使用 Code Contracts

    35310编辑于 2024-11-08
  • 来自专栏大数据

    C# 一分钟浅谈:Code Contracts 与契约编程

    其中,Code Contracts 是一个非常有用的工具,它允许开发者通过契约编程的方式来增强代码的健壮性和可维护性。 本文将从浅到深地介绍 Code Contracts 的基本概念、常见问题、易错点及如何避免这些问题,并通过具体的代码案例进行解释。 什么是 Code Contracts? Code Contracts 是 .NET Framework 提供的一个库,用于在代码中定义前置条件、后置条件和对象不变量。 安装 Code Contracts 在 Visual Studio 中使用 Code Contracts 需要安装相应的 NuGet 包。可以通过以下步骤安装: 打开 Visual Studio。 然而,使用 Code Contracts 时也需要注意一些常见的问题和易错点,避免过度依赖契约和忽略性能影响。希望本文的内容能够帮助你更好地理解和使用 Code Contracts

    23310编辑于 2024-11-10
  • 来自专栏生如夏花绚烂

    Laravel核心概念:服务容器(ServiceContainer),服务提供者(Service Provider),门面(Facade),契约(Contracts

    php namespace Illuminate\Cache; use Illuminate\Contracts\Support\DeferrableProvider; use Illuminate 各种Facades类 Facade Class 服务容器绑定 App Illuminate\Foundation\Application app Artisan Illuminate\Contracts \Console\Kernel artisan Auth Illuminate\Auth\AuthManager auth Auth (Instance) Illuminate\Contracts \Broadcasting\Factory Broadcast (Instance) Illuminate\Contracts\Broadcasting\Broadcaster Bus Illuminate \Auth\Access\Gate Hash Illuminate\Contracts\Hashing\Hasher hash Lang Illuminate\Translation\Translator

    3.4K31编辑于 2022-09-08
  • 来自专栏区块链入门

    第三十四课 采用TRUFFLE框架如何创建自己的ERC721非同质化资产生物商店?

    /contracts/Factory.sol... Compiling ./contracts/Migrations.sol... Compiling . /contracts/Strings.sol... Compiling ./contracts/TradeableERC721Token.sol... /contracts/openzeppelin-solidity/contracts/Bounty.sol... Compiling . /contracts/openzeppelin-solidity/contracts/ECRecovery.sol... Compiling . /contracts/openzeppelin-solidity/contracts/MerkleProof.sol... Compiling .

    1.6K10发布于 2019-02-22
  • 来自专栏JusterZhu

    Contract

    什么是 ContractsContracts 是一种用于在代码中指定条件和约束的机制。 使用 Contracts 要在 C# 中使用 Contracts,您需要引用 System.Diagnostics.Contracts 命名空间。以下是一些基本用法示例: 1. 何时使用 Contracts 复杂逻辑:当方法逻辑复杂且易出错时,使用 Contracts 可以帮助明确输入输出条件。 快速调试:在开发和测试阶段,Contracts 可以帮助快速捕捉异常条件,便于调试和修复。 团队协作:在团队开发中,Contracts 可以帮助团队成员理解业务逻辑的期望条件。 注意事项 性能影响:在生产环境中,启用 Contracts 可能会影响性能,因此通常在开发和测试阶段使用。 工具支持:需要安装 Contracts 工具来充分利用其功能。

    36500编辑于 2025-01-23
  • 来自专栏SAP最佳业务实践

    SAP S/4HANA最佳业务实践:Order-to-Cash订单到收款-3合同处理

    •The tile Manage Sales Contracts is part of the business catalog Sales –Contract Processing. •The number of contracts is indicated on the tile, in this example there are 101 sales contracts. a list of existing sales contracts. Enter a Name and choose OK Manage Sales Contracts –Results List: Personalization 合同查询列表 1. 管理销售合同Manage Sales Contracts –Actions Actions: 可以使用SAP Fiori theme创建销售合同. 快速拒绝所有的合同的行项目 4.

    1.1K91发布于 2018-03-28
  • 来自专栏深入浅出区块链技术

    探索Openzeppelin 新增的跨链功能

    "; import {FxBaseRootTunnel} from "https://github.com/fx-portal/contracts/blob/main/contracts/tunnel /OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/AccessControlCrossChain.sol [13] 这里 /openzeppelin-contracts/tree/master/contracts/crosschain [15] 这里: https://docs.openzeppelin.com/contracts /4.x/api/crosschain [16] FxBaseRootTunnel.sol: https://github.com/fx-portal/contracts/blob/main/contracts [20] CrossChainEnabled.sol: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.6.0/contracts

    69320编辑于 2022-11-07
  • 来自专栏IT码农

    Laravel5.3之IoC Container实例化源码解析

    \Cookie\Factory', 'Illuminate\Contracts\Cookie\QueueingFactory'], 'encrypter' => ['Illuminate\Encryption\Encrypter', 'Illuminate\Contracts\Encryption\Encrypter'], 'db' '], 'filesystem.cloud' => ['Illuminate\Contracts\Filesystem\Cloud'], 'hash ' => ['Illuminate\Contracts\Hashing\Hasher'], 'translator' => [ \Factory', 'Illuminate\Contracts\Queue\Monitor'], 'queue.connection' => ['Illuminate\

    2.3K41编辑于 2022-01-10
  • 来自专栏一个会写诗的程序员的博客

    《Kotlin Contract 契约》极简教程

    package kotlin.contracts import kotlin.internal.ContractsDsl import kotlin.internal.InlineOnly /** * */ // @sample samples.contracts.returnsContract @ContractsDsl public fun returns * */ // @sample samples.contracts.returnsTrueContract // @sample samples.contracts.returnsFalseContract * */ /* @sample samples.contracts.callsInPlaceAtMostOnceContract * @sample samples.contracts.callsInPlaceAtLeastOnceContract * @sample samples.contracts.callsInPlaceExactlyOnceContract * @sample samples.contracts.callsInPlaceUnknownContract

    1.7K20发布于 2019-08-09
  • 来自专栏Java与Android技术栈

    Kotlin Contract

    当前 Contract 有两种类型: Returns Contracts CallInPlace Contracts 2.1 Returns Contracts Returns Contracts 表示当 Kotlin 的 Scope Function 都使用了上述 Contracts。 三. * */ // @sample samples.contracts.returnsTrueContract // @sample samples.contracts.returnsFalseContract * */ /* @sample samples.contracts.callsInPlaceAtMostOnceContract * @sample samples.contracts.callsInPlaceAtLeastOnceContract * @sample samples.contracts.callsInPlaceExactlyOnceContract * @sample samples.contracts.callsInPlaceUnknownContract

    94431发布于 2020-10-30
  • 来自专栏华仔的技术笔记

    在Spectrum测试链用Truffle启动第一个宠物商店Dapp

    Commands: Compile: truffle compile Migrate: truffle migrate Test contracts: truffle test Run dev server: npm run dev ben:petShop a212$ ls LICENSE contracts package.json /contracts/Adoption.sol... Compiling ./contracts/Migrations.sol... Writing artifacts to . /build/contracts 部署合约 1,在 migratios/ 目录内创建新文件 2_deploy_contracts.js 内容如下: var Adoption = artifacts.require /contracts/Adoption.sol... Compiling ./test/TestAdoption.sol... Compiling truffle/Assert.sol...

    1.4K30发布于 2018-10-25
  • 来自专栏YYDS

    关于uniswap系统开发项目方案技术讲解(成熟代码)

    ,  1.首先,创建一个名为`exchange.sol`的文件,并添加以下代码:  ```solidity  pragma solidity^0.8.0;  import" openzeppelin/contracts /token/ERC20/ERC20.sol";  import" openzeppelin/contracts/utils/Counters.sol";  import" openzeppelin/contracts /utils/SafeMath.sol";  import" openzeppelin/contracts/access/Ownable.sol";  import" openzeppelin/contracts /access/OwnableContract.sol";  import" openzeppelin/contracts/token/ERC20/ERC20Interface.sol";  contract

    59850编辑于 2023-06-07
  • 来自专栏网管叨bi叨

    Laravel源码解析之用户认证系统(一)

    \Contracts\Auth\StatefulGuard 和 Illuminate\Contracts\Auth\SupportsBasicAuth契约里的方法,这些Guard Contracts里定义的方法都是 Illuminate\Contracts\Auth\Guard 这个文件定义了基础的认证方法 namespace Illuminate\Contracts\Auth; interface Guard \Auth\StatefulGuard 这个Contracts定义了Laravel auth系统里认证用户时使用的方法,除了认证用户外还会涉及用户认证成功后如何持久化用户的认证状态。 \Auth\SupportsBasicAuth 定义了通过Http Basic Auth 认证用户的方法 namespace Illuminate\Contracts\Auth; interface php namespace Illuminate\Contracts\Auth; interface UserProvider { /** * 通过用户唯一ID获取用户数据

    3.9K30发布于 2019-10-13
  • 来自专栏超级架构师

    呃哦:区块链可能没有我们想象的那么安全

    That’s not all they can do: while smart contracts can be as simple as the above, they can also be far The group analyzed roughly one million smart contracts using a custom-built tool called MAIAN. Their analysis tool flagged 34,200 contracts. The team then manually analyzed 3,759 contracts and found they could exploit vulnerabilities in 3,686 Determining that roughly 3.4 percent of smart contracts could be vulnerable to attackers is huge.

    86550发布于 2018-04-09
领券