Forwarded from dnaugsuz
你说是
🤔我觉得没影响,你要拿 String 那你就拿 String。
(html!!) 还是 body?.string() ?🤔我觉得没影响,你要拿 String 那你就拿 String。
Forwarded from dnaugsuz
如果你要做,还有更好的方法吗……
要这么写就别担心太多
为什么 html 是 var 啊…… 你应该写
为什么你要写
要这么写就别担心太多
为什么 html 是 var 啊…… 你应该写
val html: String = client.get(LOGIN_API).body?.string() ?: throw Errors.NetError() 不是么…为什么你要写
html!! 啊,而且如果你只 parse(resp.string()) 的话调用 string() 也没问题啊Forwarded from dnaugsuz
草生,你这么编程的话…… 在一段子程序里,是一类东西都可以叫一个名字了
用户的 1:1 宠物叫 val
如非必要,请别写
真正用 var 的情况往往是 for while 里循环更新变量,你这种完全可以内联的……
用户的 1:1 宠物叫 val
pat,用户 1:N 的寄养宠物也叫 for (pat in pats) ,然后你就可以把 pat 和 pat 变成一个 var 来“复用”废“好大脑力”编造的名字了,真棒……如非必要,请别写
var …… 你要明白有些 val 都是可以 inline 进引用处的,只不过为了简化代码提升可读性才拆开成不可变具名量,你用 var 语义就全毁了。真正用 var 的情况往往是 for while 里循环更新变量,你这种完全可以内联的……
Forwarded from dnaugsuz
#OCR #Java #code
float scale = 246f / 255;
Paint paint = new Paint() ;
ColorMatrix matrix = new ColorMatrix();
matrix.set(new float[] {
scale, 0, 0, 0, 0,
0, scale, 0, 0, 0,
0, 0, scale, 0, 0,
0, 0, 0, 1, 0,
});
ColorMatrixColorFilter filter = new ColorMatrixColorFilter(matrix);
paint.setColorFilter(filter);
getWindow().getDecorView().setLayerType(View.LAYER_TYPE_HARDWARE, paint);
Forwarded from Hinnka Zhou
matrix.setScale(scale, scale, scale, 1);就可以
Forwarded from dnaugsuz
ColorMatrix.set(float[]) 是有一定 (float[]) 长度要求的吗 🤔scale 后面跟着4个0 是什么意思
最后一个 1,0 是什么意思
Forwarded from dnaugsuz
fun setupColorFilter(scale: Float = 246.0 / 0xFF) {
val matrix = floatArrayOf(
scale, 0,0,0,0,
0, scale, 0,0,0,
0,0, scale, 0,0,
0,0,0,1,0
)
val rgbaMatrix = ColorMatrix().apply { set(matrix) }
val filter = ColorMatrixFilter(rgbaMatrix)
val paint = Paint().apply { colorFilter = filter }
window.decorView.setLayerType(View.LAYER_TYPE_HARDWARE, paint)
}说实话,看到 #Ruby 关系式求解器 里作者实现了个
作者的实现方式也很奇怪, interleaveWith 就是
Iterable.interleave_with 我觉得挺奇怪的,真的是要 interleave? 总觉得可以 zipWith 什么的,但作者的水平又不可能不知道 zipWith作者的实现方式也很奇怪, interleaveWith 就是
(xs=[a, b], ys=[c, d]) res=[a, c, b, d] 而已,但他用的方式是一个 Array 不断 push pop 这么 cycle 下去的Forwarded from 开发者日报
GitHub is now free for teams
GitHub 刚才宣布,团队的私库也免费了。这就是说,GitHub 基本上是一个免费网站了,核心功能几乎都不要钱,只剩下企业版收费了。「分享自ruanyf」
GitHub 刚才宣布,团队的私库也免费了。这就是说,GitHub 基本上是一个免费网站了,核心功能几乎都不要钱,只剩下企业版收费了。「分享自ruanyf」
The GitHub Blog
GitHub is now free for teams
Every developer and team can now get private repositories with unlimited collaborators at no cost with GitHub Free, and we reduced prices for some of our paid plans.