#python #code #huawei 开始还以为 reduce 的 op/init args 顺序都是 acc,x ,没想到一个 acc,x 一个 xs,acc 啊……
from functools import reduce
def subst(sa,sb,sep=" "):
reps = list(zip(*(s.split(sep) for s in [sa,sb])))
return lambda s: reduce(lambda acc,ab: acc.replace(*ab), reps, s)
print(subst("Google Android", "Huawei Haromny")("Google's Android"))Forwarded from dnaugsuz
def subst(sa,sb,sep=" "):
reps = list(zip(s.split(sep) for s in [sa,sb]))
return lambda s: reduce(lambda acc,ab: acc.replace(*ab), s, reps)
subst("Google Android", "Huawei Haromny")("Google's Android")proc 写一篇博客?🤔 考虑下…… graphviz
when 选题:
选到简单的主题:
@简单@这么简单,大家都知道吧?没什么好写的……
link 退出
选到复杂的主题:
有点复杂,我还没全搞懂呢,没把握写好……
when 研究一下:
alt 一段时间后
搞明白了: link 简单
没搞明白:
when 继续研究?:
alt 算了,好的
@退出@不写了,结束
link 研究一下
Forwarded from Ray Tracing (IFTTT)
Twitter
oldj
最近写博客的决策流程图是这样的。😂
console.log(subExprs("zipReplace(...给定)(src) == expect", s=>eval(s))); // JS 是没有显式 binding ,只有 eval 调用处 caller 带 binding
呃……Forwarded from BUG
我前天发现自己写的http框架在使用ssl时正常访问一些外网,Url.openConnection和okhttp、浏览器均不行,然后突发奇想接手webview的资源加载
#Android #db
预计可用 DSL 写法:
val query = MediaStore.Media.Image.run {
contentResolver.query(CONTENT_URI, projection, "${RELATIVE_PATH}=? and ${DISPLAY_NAME}=?", arrayOf(path,name), "${RELATIVE_PATH} ASC")
} 预计可用 DSL 写法:
import android.content.iss.onediaStore.Images.Media.*
fun queryPath(path,name) = contentResolver.queryURI { projection=projection; where(RELATIVE_PATH eq path and DISPLAY_NAME eq name); sorted(RELATIVE_PATH, asc=true) }Forwarded from Luke
EROFS是一个完全由华为开源并贡献到Linux内核主线的文件系统,遵守GPLv2开源协议,也就是说,搭载EROFS的手机如果不遵守GPL协议开源的话,相当于窃取了华为的技术。
Forwarded from Haruue | 春上ひつき
记得华为自己的设备搭载的 EROFS 和内核里开源的那个的并不一样。。。
Forwarded from Haruue | 春上ひつき
不过还好华为设备的内核有些是开源的, 扒出来丢到正经的同版本内核树里编译, 是可以挂上 dump 出来的华为 system image 。。。
Forwarded from Haruue | 春上ひつき
然而没有对应的 erofs-utils , 生成不了能在华为设备上用的系统镜像。。。