Skip to content

知乎收藏夹整理

有哪些命令行的软件堪称神器?

原文摘要

  • cppman:C++ 98/11/14 手册查询 for Linux/MacOS
  • icdiff:分屏显示 diff
  • cgasm:命令行查询汇编指令
  • ncdu:可视化的空间分析程序
  • glances:更强大的 htop/top 代替者
  • mc:内容浏览/预览
  • ranger:内容浏览/预览
  • cheat:命令行笔记

额外拓展

  • dua-cli:可视化的空间分析程序
  • tokei:显示代码信息的统计程序
  • tldr:如果你经常不想详读man文档,那么你应该试试这个小工具

总结python中可操作pdf的库

原文摘要

  • python-pdfkit, 可将html转换为pdf
  • ReportLab, 久经考验的、超级健壮的开源引擎,用于创建复杂的、数据驱动的PDF文档和自定义矢量图形
  • pdfminer.six, 它是一个从PDF文档中提取信息的工具, 重点是获取和分析文本数据

额外拓展

Python开源数据库引擎

原文摘要

  • NoSQL
    • pickleDB: 轻量级 key-value 存储引擎,受到Redis启发,基于Python simplejson模块搭建
    • TinyDB: 轻量级文档数据库,类似MongoDB,纯Python实现
  • Relational database
    • dask-sql: 分布式 SQL query engine,基于Dask(并行计算及分布式计算库)开发
  • SQL parser
    • SQLGlot: 高效SQL Parser,纯Python开发,自称目前最快的纯python SQL parser
  • 通用型Python解析器
    • PLY (Python Lex-Yacc): lex 和 yacc 的纯Python实现
    • PyParsing: Python解析库,可用于替代 lex/yacc

如何用 Github 找到需要的代码?

原文摘要

你写代码的起手式是什么样的?

原文摘要

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")

#include<bits/stdc++.h>

#define re register
#define ll long long
#define ull unsigned long long
#define maxx(a,b) (a)>(b)?(a):(b)
#define minn(a,b) (a)<(b)?(a):(b)

using namespace std;

inline int read(){
    int x=0,f=1;
    char ch;
    while(ch<'0'||ch>'9')  {if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return f*x;
}

inline void wrtn(int x) {
  static char buf[15];
  static int len = -1;
  if(x>=0) {
    do {
      buf[++len]=x%10+48,x/= 10;
    } while(x);
  } else {
    putchar('-');
    do {
      buf[++len]=-(x%10)+48,x/=10;
    } while (x);
  }
  while (len >= 0) {
    putchar(buf[len]),--len;
  }
}
int main() {


    return 0;
}

使用Rust编写操作系统(一):独立式可执行程序

额外拓展

哪些语言有别出心裁的脏话?

原文摘要

埃尔热《丁丁历险记》

  • 大众化
    • 白痴、卑鄙、笨蛋、坏蛋、混蛋、混球、畜生、恶棍、匪徒、泼皮、流氓、暴徒、该死的、可恶、见鬼、无法无天、无赖
  • 表示对对手严重的鄙视
    • 胆小鬼、低能的杂碎、废物、贱丨人、孬种、懦夫、蹩脚货、蠢货、蠢驴、蠢猪
  • 带有宗族偏见的,严肃的讲简直是莫名其妙的种族偏见
    • 巴塔哥尼亚人、波利尼西亚人、臭犹大、吸血鬼、食人族、瞎子、小坏蛋 、野蛮的家伙、野蛮人、野人 、穴居人
  • 职业性的偏见,也足以体现船长与众不同的品味
    • 奴隶贩子、地毯贩子、你这个江湖骗子!无赖!小丑!老皮猴!风琴手、海盗、恐怖分子、流窜犯、乞丐、强盗、人贩子
  • 带有诽谤性的
    • 孽种、叛徒、绊脚石、大麻子、丑八怪、衣冠禽兽、异教徒
  • 动物性的
    • 卑鄙的蚯蚓、笨水母、长臂猿、臭狗、臭海参、臭海驴、狒狒、海臭虫、腌咸鱼、旱鸭子、黑甲虫、寄生虫、老鼠、虱子、跳蚤、蜈蚣、象鼻虫、鸭嘴兽、卡尔巴阡毛毛虫、你们这两只碦尔巴阡山上的臭虫……该死的成千上万只臭贝壳!
  • 船长的特色,植物性的他也骂
    • 刺儿梅、鹅冠子、海水淹的黄瓜、酸苹果
  • 比较匪夷所思的骂法,我怀疑船长不熟悉的东西他都厌恶
    • 压路机、陀螺仪、咯吱咯吱响的牛皮糖
  • 有政治倾向、严重愤青的
    • 垄断家、马屁精、魔鬼、阴谋家、政客、猪猡、讨厌的家伙、投机商、伪善人

物化他人就是物化自己

额外拓展

I’m looking to get married to a guy who makes at least half a million a year. I know how that sounds, but keep in mind that a million a year is middle class in New York City, so I don’t think I’m overreaching at all… I am looking for MARRIAGE ONLY… I wouldn’t be searching for these kind of guys if I wasn’t able to match them – in looks, culture, sophistication, and keeping a nice home and hearth. What am I doing wrong?

I read your posting with great interest and have thought meaningfully about your dilemma. I offer the following analysis of your predicament. Firstly, I’m not wasting your time, I qualify as a guy who fits your bill; that is I make more than $500K per year. That said here’s how I see it.

Your offer, from the prospective of a guy like me, is plain and simple a cr@ppy business deal. Here’s why. Cutting through all the B.S., what you suggest is a simple trade: you bring your looks to the party and I bring my money. Fine, simple. But here’s the rub, your looks will fade and my money will likely continue into perpetuity … in fact, it is very likely that my income increases but it is an absolute certainty that you won’t be getting any more beautiful!

So, in economic terms you are a depreciating asset and I am an earning asset. Not only are you a depreciating asset, your depreciation accelerates! Let me explain, you’re 25 now and will likely stay pretty hot for the next 5 years, but less so each year. Then the fade begins in earnest. By 35 stick a fork in you!

So in Wall Street terms, we would call you a trading position, not a buy and hold … hence the rub … marriage. It doesn’t make good business sense to “buy you” (which is what you’re asking) so I’d rather lease. In case you think I’m being cruel, I would say the following. If my money were to go away, so would you, so when your beauty fades I need an out. It’s as simple as that. So a deal that makes sense is dating, not marriage.

Separately, I was taught early in my career about efficient markets. So, I wonder why a girl as “articulate, classy and spectacularly beautiful” as you has been unable to find your sugar daddy. I find it hard to believe that if you are as gorgeous as you say you are that the $500K hasn’t found you, if not only for a tryout.

By the way, you could always find a way to make your own money and then we wouldn’t need to have this difficult conversation.

With all that said, I must say you’re going about it the right way. Classic “pump and dump.”

其他

GitHub 仓库

  • GPT2-Chinese: Chinese version of GPT2 training code, using BERT tokenizer
  • scikit-opt: Genetic Algorithm, Particle Swarm Optimization, Simulated Annealing, Ant Colony Optimization Algorithm,Immune Algorithm, Artificial Fish Swarm Algorithm, Differential Evolution and TSP (Traveling salesman)
  • pyinstrument: Call stack profiler for Python. Shows you why your code is slow!
  • Ventoy: A new bootable USB solution
  • Kats: Kats, a kit to analyze time series data, a lightweight, easy-to-use, generalizable, and extendable framework to perform time series analysis, from understanding the key statistics and characteristics, detecting change points and anomalies, to forecasting future trends
  • PokemonUnity: A framework to build Pokémon RPG games
  • Multiplayer-FPS: A multiplayer first person shooter game based on Unity Game Engine
  • cutecharts.py: Hand drawing style charts library for Python
  • rust_magazine_2021: RustMagazine 2021 期刊
  • fitlog: 一款在深度学习训练中用于辅助用户记录日志和管理代码的工具
  • deskreen: Deskreen turns any device with a web browser into a secondary screen for your computer
  • Nuitka: Nuitka is a Python compiler written in Python

杂文