duangsues.is_a? SaltedFish
60 subscribers
609 photos
6 videos
91 files
562 links
🌶🐔🐟 duangsuse 的日常
尤其喜欢发些奇奇怪怪的东西
和转载别人的东西
Download Telegram
Forwarded from dnaugsuz
噢,原来递归类型就是编译期能解决类型检查…… 不对
这个和 C 的 tail=NULL 没有区别吧,只是用了 std:: u_ptr 和 variant

using List=std::variant<Cons,struct Nil>,
Cons=struct{int x, std::unique_ptr<List> xs};
struct Nil{};
auto Nil=std::make_unique<List>(Nil{});

List ll1 = Cons{2,Nil};
Forwarded from dnaugsuz
元函数元在哪里啊,这个字大概是「基础」的含义吧

template struct/func 都可以取 decltype ,那就是说能得到模板参数? lambda 不能,所以类型侧和程序侧都不能递归?(对了 有 f=>(f f) 的方法,但不能作参数没用)
#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 写一篇博客?
when 选题:
选到简单的主题:
@简单@这么简单,大家都知道吧?没什么好写的……
link 退出
选到复杂的主题:
有点复杂,我还没全搞懂呢,没把握写好……
when 研究一下:
alt 一段时间后
搞明白了: link 简单
没搞明白:
when 继续研究?:
alt 算了,好的
@退出@不写了,结束
link 研究一下
🤔 考虑下…… graphviz
console.log(subExprs("zipReplace(...给定)(src) == expect", s=>eval(s))); // JS 是没有显式 binding ,只有 eval 调用处 caller 带 binding
呃……
#android #net #js replace 了下 XMLHttpRequest 的 open() 和 send()
Forwarded from BUG
我前天发现自己写的http框架在使用ssl时正常访问一些外网,Url.openConnection和okhttp、浏览器均不行,然后突发奇想接手webview的资源加载
Forwarded from BUG
Forwarded from BUG
get拦截可以采取页面加载时注入js hook原型
#Android #db
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 Perol
Forwarded from Luke
EROFS是一个完全由华为开源并贡献到Linux内核主线的文件系统,遵守GPLv2开源协议,也就是说,搭载EROFS的手机如果不遵守GPL协议开源的话,相当于窃取了华为的技术。
Forwarded from 朱雀院 紅葉
只应用在系统分区并且只读
Forwarded from Haruue | 春上ひつき
记得华为自己的设备搭载的 EROFS 和内核里开源的那个的并不一样。。。
Forwarded from Haruue | 春上ひつき
不过还好华为设备的内核有些是开源的, 扒出来丢到正经的同版本内核树里编译, 是可以挂上 dump 出来的华为 system image 。。。
Forwarded from Haruue | 春上ひつき
然而没有对应的 erofs-utils , 生成不了能在华为设备上用的系统镜像。。。
Forwarded from ️タナバタ カヤ
华为的设备好像抓不到dmesg,让我十分好奇他们的内核在搞什么小动作。