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 年前3安全简介
0 码力 | 2 页 | 304.16 KB | 5 月前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 年前3Kubernetes安全求生指南
Kubernetes安全求生指南 ©2019 VMware, Inc. 2 您的Kubernetes環境夠安全嗎? Kubernetes安全最佳實務 VMware Enterprise PKS平台如何實踐K8s與容器的安全強化 最困難的部分其實是.... 總結 本日議程 3 ©2019 VMware, Inc. 您的Kubernetes環境夠安全嗎? ©2019 VMware, Inc. 4 整個Kubernetes運作環境是相當不安全的.... 原生Kubernetes在安全設計上就有許多改善空間 公版Kubernetes許多預設值是不適當的 關於網路層級的安全實際上還有許多地方並未涵蓋 設計上並不特別考慮企業多團隊/多應用的分工與隔離 有非常多層次例如: 容器/映像/作業系統/基礎架構也須涵蓋 您知道所謂 “安全”的“標準”是什麼? 這些“標準”涵蓋範圍夠嗎? 足夠讓我們安心推上生產嗎? 我們具體該怎麼做來強化安全? 我們怎麼知道我們做強化安全以後有滿足這個標準...還是這些標準? 我們該如何確保安全性在未來開發/維運一直維持達標? 我們如何用最低的負荷與最快的速度完成上述任務? 隨便Google就可找到好幾卡車的Kubernetes安全最佳實務/指南0 码力 | 23 页 | 2.14 MB | 1 年前3Hello 算法 1.1.0 Kotlin版
Hello 算法 Kotlin 语言版 作者:靳宇栋(@krahets) 代码审阅:陈东辉(@curtishd) Release 1.1.0 2024‑04‑15 序 两年前,我在力扣上分享了“剑指 Offer”系列题解,受到了许多读者的鼓励和支持。在与读者交流期间,我 最常被问的一个问题是“如何入门算法”。逐渐地,我对这个问题产生了浓厚的兴趣。 两眼一抹黑地刷题似乎是最受欢迎的方法 i } return -1 } 值得说明的是,我们在实际中很少使用最佳时间复杂度,因为通常只有在很小概率下才能达到,可能会带来 一定的误导性。而最差时间复杂度更为实用,因为它给出了一个效率安全值,让我们可以放心地使用算法。 从上述示例可以看出,最差时间复杂度和最佳时间复杂度只出现于“特殊的数据分布”,这些情况的出现概率 可能很小,并不能真实地反映算法运行效率。相比之下,平均时间复杂度可以体现算法在随机输入数据下的 indices) { if (nums[i] == target) return i } return -1 } 7. 扩容数组 在复杂的系统环境中,程序难以保证数组之后的内存空间是可用的,从而无法安全地扩展数组容量。因此在 大多数编程语言中,数组的长度是不可变的。 如果我们希望扩容数组,则需重新建立一个更大的数组,然后把原数组元素依次复制到新数组。这是一个 ?(?) 的操作,在数组很大的情况下非常耗时。代码如下所示:0 码力 | 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 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100