Candid: the interface description language of the Internet Computer smart contracts - 陈研第三届中国Rust开发者大会 Candid: the interface description language of the Internet Computer smart contracts Yan Chen DFINITY Foundation Rust China Conf 2023 −− How DFINITY uses procedure macro to extend Rust Send (42 : nat) Decode as () Decode as (record { name : text }) Candid: a strongly typed interface description language • Primitive types • nat, int, nat{8-64}, int{8-64}, float{32,64}, bool implement type reflection in Rust • Export interface description • How to simulate monomorphization and share states across procedure macro • Import interface description • How to control generated code0 码力 | 35 页 | 1.35 MB | 1 年前3
10 为Python Function自动生成Web UI 彭未康为 Python Function 自动生成 Web UI 彭未康 Touch-Callable The web framework for less serious application. Touch-Callable vs (Flask, Django) • Django, Flask • 起步快且容易(getting started quick and easy) • 扩展为复杂应用(scale 3.6 例子:生成测试用户 例子:生成测试用户 例子:生成测试用户 例子:远程控制饮水机 接下来: • 支持更多的数据类型 • 类型对应的控件可配置 大胆的想法: • 直接使用 Function 构建小型应用的管理后台? • Serverless 管理后台? 谢谢大家0 码力 | 11 页 | 791.38 KB | 1 年前3
Python in Azure Functions 基于Python的Azure Functions实践 赵健0 码力 | 28 页 | 12.57 MB | 1 年前3
Idris 语言文档 Version 1.3.1性(奔 奲 奡奩 奴 )。为了定义接口,我们提供了一组可重载的的函数。Show 接口就是个简单的例子, 它在 奐 奲 奥 奬 奵 奤 奥 中定义,并提供了将值转换为 String 的接口: interface Show a where show : a -> String 它会生成一个类型如下的函数,我们称之为 Show 接口的 方 方 方法 法 法( ( (M e t h od ) ) ): Vect n a 对 Show 的实现为…… 1. 4. 1 默 默 默认 认 认定 定 定义 义 义 库中定义了 Eq 接口,它提供了比较值是否相等的方法,所有内建类型都实现了它: interface Eq a where (==) : a -> a -> Bool (/=) : a -> a -> Bool 要为类型实现一个接口,我们必须给出所有方法的定义。例如,为 Nat 实现 Eq: False x /= y = not (x == y) 很难想象在哪些情况下 /= 方法不是应用了 == 方法的结果的否定。 因此,利用接口声明中的某个方法 为其它方法提供默认的定义会很方便: interface Eq a where (==) : a -> a -> Bool (/=) : a -> a -> Bool x /= y = not (x == y) x == y = not (x /=0 码力 | 224 页 | 2.06 MB | 1 年前3
Laravel 5.1 中文文档@param \Closure $next * @param string $role * @return mixed */ public function handle($request, Closure $next, $role) { if (! $request->user()->hasRole($role)) { 更多关于中间件的内容,请查看中间件一节。 测试革新 Laravel 中内置的测试功能获得了引入注目的提升,多个新方法提供了平滑的,富有变现力 的接口和应用进行交互并测试响应: public function testNewUserRegistration(){ $this->visit('/register') ->type('Taylor', 'name') 模型定义一系列默认属性,然后为测试或数据库填充生成模型实例。 模型工厂还可以利用强大的 PHP 扩展库 Faker 类生成随机的属性数据。 $factory->define('App\User', function ($faker) { return [ 'name' => $faker->name, 'email' => $faker->email,0 码力 | 307 页 | 3.46 MB | 1 年前3
Laravel 5.2 中文文档org)提供 Laravel 学院致力于提供优质 Laravel 中文学习资源 2 use App\User; Route::get('/user/{user}', function (User $user) { return $user; }); 在 Laravel 5.1 中,你需要通过 Route::model 方法告诉 Laravel 注入 App\User 'throttle:60,1', ], ]; 然后,web 组像这样分配给路由: Route::group(['middleware' => ['web']], function () { // }); 访问频率限制 一个新的访问频率限制中间件已经被内置到框架中,从而允许你轻松限制给定 IP 地址在 指定时间内对某个路由发起请求的数目。例如,要限制某个 制某个 IP 地址每分钟只能访问某个 路由 60 次,你可以这么做: Route::get('/api/users', ['middleware' => 'throttle:60,1', function () { // }]); 数组输入验证 在 Laravel 5.2 可轻松实现表单字段的数组输入验证。例如,要验证给定数组输入字段中 的每一个 email 是唯一的,可以这么实现:0 码力 | 377 页 | 4.56 MB | 1 年前3
Rust 语言学习笔记no bug..................................................................... 67 6.3 FFI(Foreign Function Interface).................................................... 68 6.3.1 rust调用 ffi函数 ......... 其实不然,这其实是根据变量类型是否实现 Copy 特性决定的。对于 实现 Copy 特性的变量,在 move 时会拷贝资源到新内存区域,并把新内存区域 的资源 binding 为 b。特性有点类似于 interface,但是在 rust 中必须显式实 现。 Before move: a <=> 内存(地址:A,内容:100) After move: a <=> 内存(地址:A,内容:100) b 空结构体的内存占用为 0。但是我们依然可以针对这样的类型实现它的“成员 函数”。 4.1.3 结构体的方法 Rust 没有继承,它和 Golang 不约而同的选择了 trait(Golang 叫 Interface)作 为其实现多态的基础。 不同的是,golang 是匿名继承,rust 是显式继承。如果需要实现匿名继承的话, 可以通过隐藏实现类型可以由 generic 配合 trait 作出。 struct0 码力 | 117 页 | 2.24 MB | 1 年前3
Laravel 5.3 中文文档升: /* * Authenticate the channel subscription... */ Broadcast::channel('orders.*', function ($user, $orderId) { return $user->placedOrder($orderId); }); Laravel Echo,通过 NPM 安装的全新的 status', ]); 此外,Passport 还包含了用于验证访问令牌认证请求包含必要令牌域的中间件: Route::get('/orders/{order}/status', function (Order $order) { // Access token has "check-status" scope... })->middleware('scope:check-status'); /** * Build the message. * * @return $this */ public function build() 本文档由 Laravel 学院(LaravelAcademy.org)提供 Laravel 学院致力于提供优质 Laravel 中文学习资源 90 码力 | 691 页 | 9.37 MB | 1 年前3
陈东 - 利用Rust重塑移动应用开发-230618performance 2); Photo / image / chart Rust FFI Rust FFI (Foreign Function Interface) refers to the ability of Rust programming language to interface with code written in other languages, typically C or types of apps, this can help you reuse code libraries written in those languages. - JNI JNI is an interface that allows Java to interact with code written in another language. Motivation for JNI is code IOS - Rust targets for IOS - Build the static universal library for different target - Call the function on the swift code 利用 Rust 重塑移动应用开发 Photo / image / chart Rust 在 Keystone 业务上的实践 Rust Crypto0 码力 | 22 页 | 2.10 MB | 1 年前3
TiDB v7.1 中文手册Titan 插件 Y Y Y Y Y Y Y Y Y 1TiDB 误将 latin1 处理为 utf8 的子集。见 TiDB #18955。 2从 v6.5.0 起,系统变量tidb_allow_function_for_expression_index 所列出的函数已通过表达式索引的测试,可以在生产环境中创建 并使用,未来版本会持续增加。对于没有列出的函数,则不建议在生产环境中使用相应的表达式索引。详情请参考表达式索引。 Repository Bean。同时,JpaRepository 接口的默认实现类 SimpleJpaRepository 提供了增删改查函数的具体实现。 119 @Repository public interface PlayerRepository extends JpaRepository{ } 随后,在需要使用 PlayerRepository 的类中,你可以通过 import * as fs from "fs"; // 步骤 2. 将连接参数从 .env 文件中读取到 process.env 中。 dotenv.config(); 163 async function main() { // 步骤 3. 创建与 TiDB 集群的连接。 const options = { host: process.env.TIDB_HOST || '127.0.0.1' 0 码力 | 4369 页 | 98.92 MB | 1 年前3
共 699 条
- 1
- 2
- 3
- 4
- 5
- 6
- 70













