duangsuse::Echo
710 subscribers
4.23K photos
127 videos
583 files
6.44K links
import this:
美而不丑、明而不暗、短而不凡、长而不乱,扁平不宽,读而后码,行之天下,勿托地上天国。
异常勿吞,难过勿过,叹一真理。效率是很重要,盲目最是低效。
简明是可靠的先验,不是可靠的祭品。
知其变,守其恒,为天下式;穷其变,知不穷,得地上势。知变守恒却穷变知新,我认真理,我不认真。

技术相干订阅~
另外有 throws 闲杂频道 @dsuset
转载频道 @dsusep
极小可能会有批评zf的消息 如有不适可退出
suse小站(面向运气编程): https://WOJS.org/#/
Download Telegram
https://nasy.moe/Kusa/gron-make-json-greppable/
这个 gron 工具有意思!好像 find 的 recursive list 一样。
json[0].commit.author = {};
json[0].commit.author.date = "2016-07-02T10:51:21Z";

ParserKt v3 的 example 要包含这个实现!
https://nasy.moe/Hana/Python/python-002/ #Python

不是有点奇怪吗?这里提到了一些 stream 操作(惰性函数式里实际上就是列表操作) map, any, all, filter 什么的
一句话总结一下,nasy 为了显得函数式,把 for x in xs: f(x)map(f, xs) 替代,也因为禁止 for 关键字所以 [f(x) for x in xs] comprehension 也不可用。

Py3 里 map 是一个 generator 了,惰性求值每次 next(这样 takeWhile 之类的操作就可以避免多余的结果内存分配)
所以不可能这么做,有以下 workaround:
+ list(map(f, xs))
+ for l in ls: f(l)
+ all(map(f, xs)), any(map(f, xs))

我的意思是,为什么不定义 each_apply(f, xs) 或者 for_each(xs, f) 之类的,免得用 any(map(f, xs))
最后既然我都说了这么多了那总结完本文好了

[x+1 for x in range(0,10) if x > 5]
map(lambda x: x+1, filter(lambda x: x>5, range(0, 10))) #[7, 8, 9, 10]
This media is not supported in your browser
VIEW IN TELEGRAM
200 members, thank you! 🎉
🥳
duangsuse::Echo pinned «喜欢本频道的内容吗?»
简直太赞了…… (blend系官方示例)
2D 动画可以 3D 做的思路很好玩呢
还有 Node editor,来图形化编辑处理过程管道 好看
感觉 #Blender 设计越来越用心了,脚本一直以来也很方便 🤔
现在为 VFX / Video Editing / 2D Animation 有专门的分类支持,很方便
就是视频剪辑相当不完善,不过渲染速度快
This media is not supported in your browser
VIEW IN TELEGRAM
ffmpeg -i tik0004-0208.avi tik4-208.mp4
Forwarded from dnaugsuz
🤔 这样啊,那么我再举个栗子

def zip_with_next(xs: iter):
a = next(xs)
while True:
try: b = next(xs)
except StopIteration: break
yield (a, b); a = b

def generate_chain(initial_base, get_item, next_base):
base = initial_base
while True:
try:
yield get_item(base)
base = next_base(base)
except Exception: break

links = ("a", ("b", "c"))
flat_links = generate_chain(links, lambda t: t[0], lambda t: t[1])

list(flat_links) == ['a', 'b', 'c']

那么只需 list(zip_with_next(flat_links)) == [('a', 'b'), ('b', 'c')]
可以拿到上一项引用?(对于 1,2 项只需 zip_with_next([initial] + ) 即可指定初始项目)
#Python https://nasy.moe/Hana/Python/python-001/
Python 里 '(' 也可以开启一个布局
Python 里 \ 可以对换行进行转义
#Blender 有意思,布料弹簧
下面有个 plane,是靠位置变换动画来做到 刺激上面的布料 的