This media is not supported in your browser
VIEW IN TELEGRAM
duangsuse::Echo
😊 Sticker
#home duangsuse 返校,哦不是回家快乐……
这次,我要完成的一些事情:
+ Zhuazhou 的细节修改,此外,为了代码复用,我还得完成 num_preety.js, stream.js 和 zhang.js 插件
+ Dokuss 的 unsigned write (Byte, Short, Char.uext; Int.byteIterator) 和 Doku 封装,(即将)重写
如果使用 Dokuss 的 Java class serializer 和 AXML serializer 都成功的话
+ Badge.dex 和
+ RingBuffer 重写
+ Parser.kt (想了很久,也打了不少稿子)
+ Reflex (一门 JVM 脚本语言,送的,因为我正好需要解决
+ Montage.py (其实已经不重要了,因为之前的已经很多了…… 这个就是一个 DrawPlan, TintedDrawable, Range2D, Averager 和 samplePixel, colorInBound, ratioGT)
backgroundColor = hexcolor('#FFFFFF')
bound = (0x00, 0x00, 0x00)
shouldDrawText = compose(ratioGT(percent(50.0)), project(colorInBound(bound, backgroundColor)), samplePixel)
其中,
这次,我要完成的一些事情:
+ Zhuazhou 的细节修改,此外,为了代码复用,我还得完成 num_preety.js, stream.js 和 zhang.js 插件
+ Dokuss 的 unsigned write (Byte, Short, Char.uext; Int.byteIterator) 和 Doku 封装,(即将)重写
如果使用 Dokuss 的 Java class serializer 和 AXML serializer 都成功的话
+ Badge.dex 和
@builder kapt+ RingBuffer 重写
+ Parser.kt (想了很久,也打了不少稿子)
+ Reflex (一门 JVM 脚本语言,送的,因为我正好需要解决
TypeEqualizer 没写出来的问题)+ Montage.py (其实已经不重要了,因为之前的已经很多了…… 这个就是一个 DrawPlan, TintedDrawable, Range2D, Averager 和 samplePixel, colorInBound, ratioGT)
backgroundColor = hexcolor('#FFFFFF')
bound = (0x00, 0x00, 0x00)
shouldDrawText = compose(ratioGT(percent(50.0)), project(colorInBound(bound, backgroundColor)), samplePixel)
其中,
project: ((Iterable<E>) -> R) -> (Iterable<E>) -> Pair<Iterable<E>, R>RingBuffer.kt
3.8 KB
#Kotlin 我又写了一遍,不太好看,之前想的时候觉得是很清楚的,坐在屏幕前的时候就麻烦了
>>>
listOf(1,2,3).zipWith(listOf(4,5,6)) { a,b->println("$a $b") }.take(2)
1 4
2 5
3 6
[kotlin.Unit, kotlin.Unit]
好像正常,为什么刚才测试的时候 addMany 好像不正确?RingBuffer.kt
3.5 KB
我修改了一下代码,比如移除了不适合的类型抽象、改进了
until (新模型),现在看起来代码更好看了>>> r.addAll(listOf(1,2,3))好。
>>> r.viewport()
[1, 2, 3]
>>> r.pop()
1
>>> r.add(2)
>>> r.viewport()
[2, 3, 2]
>>> r
Ring[[2, 2, 3]; ^1, _1, 3]
RingBuffer.kt
4 KB
#Kotlin 『用四种方法写 RingBuffer……』
DiffAlgorithm.kt
5.6 KB
最终版本的 diff 算法,到底是没有什么…… 都是实现细节
Forwarded from dnaugsuz
就是 diff 算法啦,规定输出是一个序列
diff 操作符不考虑其对称性等性质,只作为子程序看待
举例:
这样。
sealed class Change<out T>像是这样,[] 里面的东西代表 Inserted, () 里面的东西代表 Deleted,主语是第一个输入序列
data class Same(part: List<T>)
data class Inserted(added: List<T>)
data class Deleted(removed: List<T>)
diff 操作符不考虑其对称性等性质,只作为子程序看待
举例:
diff("abc", "aebc").toString() // a [e] bc
diff("abc", "ac").toString() // a (b) c
diff("abc", "aec").toString() // a (b) [e] c
diff("abcd", "a0c1").toString() // a (b) [0] c (d) [1] 这样。
Forwarded from dnaugsuz
>>> Diff.diff("Hello beautiful world".split(' '), "Goodbye cruel world".split(' '))
(Hello,beautiful) [Goodbye,cruel] world>>> Diff.diff("Good morning".split(' '), "Good bye".split(' '))
Good (morning) [bye]>>> Diff.diff("a b c".split(' '), "a b c".split(' '))
a,b,c>>> Diff.diff("a b c".split(' '), "a c".split(' '))
a (b) c>>> Diff.diff("a b c".split(' '), "a e b c".split(' '))
a [e] b,c>>> Diff.diff("a b c".split(' '), "a e c".split(' '))
a (b) [e] c>>> Diff.diff("a b c d".split(' '), "a 0 c 1".split(' '))
a (b) [0] c (d) [1]Forwarded from duangsues.is_a? SaltedFish
duangsuse::Echo
两个文件均可在 GitHub Share 里访问到。 [1] 随时欢迎大家加入讨论和使用(暂时没有附加任何许可证)。
我马上要把它们移植到 Kotlin Common(因为它们本来就对 Java 特性没啥依赖)
然后我会写 TypeEqualizer,写完我最后修复、更新一下我的《抓周》
然后我会写 TypeEqualizer,写完我最后修复、更新一下我的《抓周》
[master 78af361] Kotlin: three files因为是自己的抽象,完美兼容 KotlinJS/JVM,除了 java.io.Closeable 和 Kotlin @Throws, assert 不能用外都可以,其中前两个接口都可以直接在 Common 里静态链接实现
3 files changed, 283 insertions(+)
create mode 100644 Others/three-kt-files/DiffAlgorithm.kt
create mode 100644 Others/three-kt-files/RingBuffer.kt
create mode 100644 Others/three-kt-files/common.kt