Coroutines in Kotlin
Coroutines in Kotlin Andrey.Breslav@JetBrains.com This talk could have been named… • async/await/yield • fibers • [stackless] continuations Suspendable Computations Outline • Motivation/Examples Motivation/Examples • Solutions in other languages • Kotlin’s Solution – Client code – Library code • Compiling Coroutines • Exception Handling • Appendix. Serializable Coroutines? “Legal” • All I’m saying is no more Stackful Language restrictions Use in special contexts L Use anywhere J Implemented in C#, Scala, Kotlin, … Quasar, Javaflow, … Code transformation Local (compiler magic) J All over the place L Runtime0 码力 | 39 页 | 1.01 MB | 1 年前3Kotlin Language Documentation 1.9.20
Kotlin Language Documentation 1.9.20 Table of Contents Kotlin Docs Get started with Kotlin Install Kotlin Create your powerful application with Kotlin Is anything missing? Welcome to our tour of of Kotlin! Hello world Variables String templates Practice Next step Basic types Practice Next step Collections List Set Map Practice Next step Control flow Conditional expressions Ranges calls Use Elvis operator Practice What's next? Kotlin Multiplatform Kotlin Multiplatform use cases Code sharing between platforms Get started Kotlin for server side 77 78 78 79 79 79 80 830 码力 | 1299 页 | 32.44 MB | 1 年前3A Security Guide for Kotlin Developers
.........................1 Kotlin’s Security Profile............................................2 Most Common Security Attacks...............................3 Top Kotlin Security Risk.............. ......10 Protect Your Kotlin Programs with Kiuwan.............. 11 1 A pragmatic, modern, and statically typed coding language that’s essentially a Java alternative, Kotlin offers some key benefits Virtual Machine (JVM) and Android app development while also being interoperable alongside Java. Kotlin language is general purpose and open sourced—available on GitHub for anyone to use—combining functional0 码力 | 13 页 | 1.80 MB | 1 年前3Kotlin Language Documentation 1.3
Kotlin Language Documentation Table of Contents Overview Using Kotlin for Server-side Development Using Kotlin for Android Development Kotlin JavaScript Overview Kotlin/Native for Native Kotlin asynchronous programming and more Multiplatform Programming What's New in Kotlin 1.1 What's New in Kotlin 1.2 What's New in Kotlin 1.3 Standard library Tooling Getting Started Basic Syntax Idioms Functions and Lambdas Functions Higher-Order Functions and Lambdas Inline Functions Collections Kotlin Collections Overview Constructing Collections Iterators Ranges and Progressions Sequences Collection0 码力 | 597 页 | 3.61 MB | 1 年前3Kotlin 1.4 language features
Kotlin 1.4 Online Event October 12, 2020 @sveta_isakova Kotlin 1.4 Language Features Svetlana Isakova Kotlin 1.4 Language Features • SAM conversions for Kotlin classes • Explicit API mode arguments • New type inference • Unified exception type for null checks SAM conversions for Kotlin interfaces SAM = Single abstract method interface Action { fun run() } SAM conversion Ability println("I'm Kotlin 1.3") } SAM conversion for a Java interface public interface Action { void run(); } public static void runAction(Action action) { action.run(); } Java: Kotlin: runAction0 码力 | 69 页 | 3.29 MB | 1 年前3Kotlin 1.2 Language Documentation
Kotlin Language Documentation Table of Contents Overview Using Kotlin for Server-side Development Using Kotlin for Android Development Kotlin JavaScript Overview Kotlin/Native for Native Coroutines asynchronous programming and more Multiplatform Programming What's New in Kotlin 1.1 What's New in Kotlin 1.2 What's Coming in Kotlin 1.3 Standard library Tooling Getting Started Basic Syntax Idioms structure Java Interop Calling Java code from Kotlin Calling Kotlin from Java JavaScript Dynamic Type Calling JavaScript from Kotlin Calling Kotlin from JavaScript JavaScript Modules JavaScript0 码力 | 333 页 | 2.22 MB | 1 年前3Hello 算法 1.1.0 Kotlin版
Hello 算法 Kotlin 语言版 作者:靳宇栋(@krahets) 代码审阅:陈东辉(@curtishd) Release 1.1.0 2024‑04‑15 序 两年前,我在力扣上分享了“剑指 Offer”系列题解,受到了许多读者的鼓励和支持。在与读者交流期间,我 最常被问的一个问题是“如何入门算法”。逐渐地,我对这个问题产生了浓厚的兴趣。 两眼一抹黑地刷题似乎是最受欢迎的方法 maxHeap.add(_val) // 从底至顶堆化 siftUp(size() - 1) } /* 从节点 i 开始,从底至顶堆化 */ fun siftUp(it: Int) { // Kotlin 的函数参数不可变,因此创建临时变量 var i = it while (true) { // 获取节点 i 的父节点 val p = parent(i) // 当“越过根节点”或“节点无须修复”时,结束堆化 从顶至底堆化 siftDown(0) // 返回堆顶元素 return _val } /* 从节点 i 开始,从顶至底堆化 */ fun siftDown(it: Int) { // Kotlin 的函数参数不可变,因此创建临时变量 var i = it while (true) { // 判断节点 i, l, r 中值最大的节点,记为 ma val l = left(i) val0 码力 | 381 页 | 18.47 MB | 1 年前3Kotlin 入门学习笔记整理
final 修饰的静态变量的字符串,是个编译器常量(编译器编译的时候,已经确定并且不可改变的) 1 private static final String LALALA = "lalala"; kotlin 中的表示⽅式 1 companion object { 2 const val LALALA = "lalala" 3 } 定义变量 变量名后 “:” 跟着他的类型,类型可以省略掉 2 ... 3 } 创建对象(直接调⽤构造器) 1 java: Java = Java(); 返回值 java void kotlin Unit kotlin 的类型推断 1 // 数据类型 ⾸字⺟⼤写 2 var age: Int = 18 3 // 因为类型推断,基本数据类型可以省略 4 var age = 18 也是⽤ class 静态内部类 java 中 ⽤static 修饰;静态内部类可以写静态函数 kotlin 静态内部类是没有关键字修饰; 嵌套内部类 不⽤ static 修饰的话默认的内部类就是嵌套内部类,嵌套内部类可以获取外部类的引⽤,不可以写静态函数; kotlin 嵌套内部类是有关键字修饰,⽤ inner 修饰 实现接⼝ 实现接⼝和继承都是没有关键字,实现接0 码力 | 8 页 | 5.41 MB | 1 年前3Kotlin 1.9.10 官方文档 中文版
关于本书 文档 入门 Kotlin 之旅 概述 Kotlin 多平台 Kotlin 用于服务器端开发 Kotlin 用于 Android 开发 Kotlin Wasm Kotlin 原生 Kotlin 用于 JavaScript 开发 Kotlin 用于数据科学 Kotlin 用于竞技程序设计 Kotlin 的新特性 Kotlin 1.9.0 Kotlin 1.9.20-RC 20-RC 早期版本 Kotlin 1.8.20 Kotlin 1.8.0 Kotlin 1.7.20 Kotlin 1.7.0 Kotlin 1.6.20 Kotlin 1.6.0 Kotlin 1.5.30 1.5.3.8 1.5.3.9 1.5.3.10 1.5.3.11 1.5.3.12 1.5.3.13 1.5.3.14 1.5.3.15 1.6 1.6.1 1 1.1.7 1.8.1.2 Kotlin 1.5.20 Kotlin 1.5.0 Kotlin 1.4.30 Kotlin 1.4.20 Kotlin 1.4.0 Kotlin 1.3 Kotlin 1.2 Kotlin 1.1 版本发布与路线图 Kotlin 版本发布 Kotlin 路线图 基础 基本语法 习惯用法 例学 Kotlin↗ 编码规范 概念 类型0 码力 | 3753 页 | 29.69 MB | 1 年前3Kotlin 1.9.10 官方文档 中文版
0 码力 | - 页 | 22.65 MB | 1 年前3
共 278 条
- 1
- 2
- 3
- 4
- 5
- 6
- 28