This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
print(juejinEncodeText('01234567890abcdefghijklmnopqrstuvwxyz')); | |
} | |
String juejinEncodeText(String text) { | |
String result = ''; | |
for (int i = 0; i < text.length; i++) { | |
int ascii = text.codeUnitAt(i); | |
int remainder = ascii % 8; | |
int baseAscii = ascii - remainder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 去除 Kotlin 中文站文档多余空格 | |
// @namespace http://demojameson.com/remove-kotlin-cn-doc-unnecessary-space | |
// @version 0.2 | |
// @description 去除 Kotlin 中文站文档多余空格 | |
// @author DemoJameson | |
// @match https://www.kotlincn.net/docs/* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typealias 布尔类型 = Boolean | |
fun main(vararg args: String) { | |
val 返回值 = ("42" == "真理") 问号 "是的,我看过《银河系漫游指南》" 冒号 "瞎扯啥" | |
println(返回值) // 瞎扯啥 | |
} | |
class 三块钱表达式<out 任意类型>(val 布尔值: 布尔类型, val 真值: 任意类型) | |
infix fun <任意类型> 布尔类型.问号(真值: 任意类型) = 三块钱表达式(this, 真值) | |
infix fun <任意类型> 三块钱表达式<任意类型>.冒号(假值: 任意类型) = if (布尔值) 真值 else 假值 |