Swift
Swift
作用域
global scope
变量和常量
// 定义变量和常量, 自动推导类型
var myVariable = 42
let myConstant = 42
// 指定类型
let implicitInteger = 70
let implicitDouble = 70.0
let explicitDouble: Double = 70
// 不支持隐式类型转换, 需要显示转换
let label = "The width is "
let width = 94
let widthLabel = label + String(width)
// 类型后面加上`?`, 标记这个值是可选的. 可以包含一个值或者nil
va...
Python
Python
Mac m1 pyenv install
2.7.18 是唯一支持m1平台的2代版本
3.9.1 是支持m1平台最小的版本
Cannot build 2.7.18 on Apple Silicon #2136
pyenv install 2.7.18 BUILD FAILED (OS X 12.3): ld: symbol(s) not found for architecture x86_64: “_Py_Main”, referenced from: _main in python.o #2283
Unable to use pyenv to install Python 3.7.0 in Mac Big Sur, no module named _s...
Kotlin Type
Kotlin
Type
打印对象类型
val obj: Double = 5.0
println(obj.javaClass.name) // double
println(obj.javaClass.kotlin) // class kotlin.Double
println(obj.javaClass.kotlin.qualifiedName) // kotlin.Double
println(obj::clsss.simpleName) // kotlin.String? = Double
反射class对比
// kotlin class
class Person...
Javascript
Javascript
Client-side JavaScript - Web browsers
Server-side JavaScript - Node.js
JavaScript and Java are similar in some ways but fundamentally different in some others
JavaScript has a prototype-based object model instead of the more common class-based object model.
Basics
Comments
// a one line comment
/* this is a longer,
mu...
463 post articles, 58 pages.