Skip to content

Instantly share code, notes, and snippets.

View ltaoist's full-sized avatar
🏢
Working from Office

21世纪工科青年 ltaoist

🏢
Working from Office
  • 历史现实主义
View GitHub Profile
@wanysteus
wanysteus / space-engineering.jpg
Last active January 29, 2024 09:08
Books—and more—for Space Engineering
space-engineering.jpg
@Tachiguishi
Tachiguishi / listdir.py
Created November 7, 2016 09:27
Python 遍历当前目录下的文件
# 只可以遍历指定文件夹rootdir中的文件夹名和文件名
# 无法遍历出其中包含的子文件夹中的内容
import os
rootdir = './' # 需要遍历的文件夹,这里设定为当前文件夹
list = os.listdir(rootdir)
for line in list:
filepath = os.path.join(rootdir, line)
if os.path.isdir(filepath):
@redraiment
redraiment / Y Combinator 简介
Last active December 23, 2020 07:44
Y Combinator (Fixed-point Combinator) 不动点组合子
Y组合子是Lambda演算的一部分,也是函数式编程的理论基础。
它是一种方法/技巧,在没有赋值语句的前提下定义递归的匿名函数。
即仅仅通过Lambda表达式这个最基本的“原子”实现循环/迭代。
颇有道生一、一生二、二生三、三生万物的感觉。
虽然Y组合子在理论上很优美,但在实际开发中并不会真的用到。
想要了解Y组合子是什么,请参见维基百科:http://en.wikipedia.org/wiki/Fixed-point_combinator#Y_combinator
或者知乎上的回答:http://www.zhihu.com/question/20115649